plugins/tools/plugin_network_loot.py
unimatrixgit 2f6b076b30
Some checks failed
Network Native Loot Datapack / network-loot (push) Successful in 28s
DuneRealms Plugin CI / plugins (push) Successful in 9m3s
DuneRealms Resourcepack CI / resourcepack (push) Failing after 19s
Package reviewed native loot rules through the canonical build pipeline
2026-12-05 17:34:31 +01:00

17 lines
900 B
Python

"""Package only the reviewed native loot definitions; never edits a game world."""
import argparse
import json
from pathlib import Path
from plugin_wild_update import write_archive
FILES={'pack.mcmeta','data/minecraft/loot_table/blocks/ender_chest.json','data/minecraft/loot_table/entities/shulker.json'}
def build(root,output):
actual={p.relative_to(root).as_posix() for p in root.rglob('*') if p.is_file()}
if actual!=FILES or any(p.is_symlink() for p in root.rglob('*')):raise ValueError('Unexpected loot pack files')
entries={name:(root/name).read_bytes() for name in sorted(FILES)}
for data in entries.values():json.loads(data)
with output.open('xb') as stream:stream.write(write_archive(entries))
if __name__=='__main__':
p=argparse.ArgumentParser(description=__doc__);p.add_argument('root',type=Path);p.add_argument('output',type=Path);build(**vars(p.parse_args()))