plugins/tools/test_plugin_pillager_art.py
unimatrixgit c599b2b708
All checks were successful
DuneRealms Plugin CI / plugins (push) Successful in 3m8s
feat: integrate Beta 1.0.2.0 Pillager update with paid raid recovery
2026-11-29 16:27:58 +01:00

27 lines
1.7 KiB
Python

import hashlib
import json
from pathlib import Path
import struct
import unittest
ROOT=Path(__file__).resolve().parents[1]
PACK=ROOT/'network/resource-pack/central/overlay/assets'
class PillagerArtworkTests(unittest.TestCase):
def test_custom_shovel_has_real_modern_definition_handheld_model_and_png(self):
item='pillager/goldmembers_shovel_mk8'
definition=json.loads((PACK/'dunerealms/items'/f'{item}.json').read_text())
self.assertEqual(definition['model'],{'type':'minecraft:model','model':'dunerealms:item/'+item})
model=json.loads((PACK/'dunerealms/models/item'/f'{item}.json').read_text())
self.assertEqual(model['parent'],'minecraft:item/handheld');self.assertEqual(model['textures']['layer0'],'dunerealms:item/'+item)
image=(PACK/'dunerealms/textures/item'/f'{item}.png').read_bytes();self.assertEqual(image[:8],b'\x89PNG\r\n\x1a\n');self.assertEqual(struct.unpack('>II',image[16:24]),(32,32))
def test_sardaukar_skins_are_only_the_two_approved_illager_sheets(self):
entity=PACK/'minecraft/textures/entity'
self.assertEqual({p.relative_to(entity).as_posix() for p in entity.rglob('*.png')},{'illager/pillager.png','illager/vindicator.png'})
for p in entity.rglob('*.png'):self.assertEqual(struct.unpack('>II',p.read_bytes()[16:24]),(64,64))
def test_shovel_uses_real_existing_harvest_material_and_explicit_eighth_mark(self):
templates=json.loads((ROOT/'JarvisConnector/src/main/resources/item-templates.json').read_text())['templates']
row=templates['goldmembers_shovel_mk8'];self.assertEqual(row['material'],'netherite_shovel');self.assertEqual(row['equipmentMark'],8);self.assertEqual(row['itemClass'],'mining-tool')
self.assertEqual(row['quality'],templates['dr_s1_spice_shovel_mk8']['quality'])
if __name__=='__main__':unittest.main()