Пример #1
0
def test_context_manager_load(tmp_path: Path):
    with DataPack(path=tmp_path / "foobar") as p1:
        p1["hello:world"] = Function(["say hello"], tags=["minecraft:load"])

    p2 = DataPack()
    p2.load(tmp_path / "foobar")
    assert p2 == p1
Пример #2
0
 def __call__(self, fragment: Fragment, assets: ResourcePack,
              data: DataPack):
     data.load(self.bundle_pack_fragment(fragment))