Fluid containers

This commit is contained in:
2026-10-25 15:02:31 -03:00
parent fc27771a92
commit 26b59a1899
24 changed files with 486 additions and 82 deletions
+10 -2
View File
@@ -372,7 +372,7 @@ Deno.test("cubes stay solid, and models that can't be drawn are placeholders", (
assertStringIncludes(report.warnings[0].warning, "placeholder");
});
Deno.test("items that aren't a block's get their sprite as their texture, or their model when java draws them in 3D", () => {
Deno.test("items that aren't a block's get their sprite as their texture and layers, or their model when java draws them in 3D", () => {
const output = Deno.makeTempDirSync();
const report = import_items(
assets({
@@ -380,6 +380,10 @@ Deno.test("items that aren't a block's get their sprite as their texture, or the
"models/block/gear": GEAR,
"models/item/gear": { parent: "gears:block/gear" },
"models/item/sheet": { parent: "item/generated", textures: { layer0: "gears:item/sheet" } },
"models/item/trimmed_sheet": {
parent: "item/generated",
textures: { layer0: "gears:item/sheet", layer1: "gears:item/trim" },
},
"models/item/wrench": { parent: "gears:item/wrench/item" },
"models/item/wrench/item": { textures: { handle: "gears:item/wrench" }, elements: GEAR.elements },
}),
@@ -387,10 +391,14 @@ Deno.test("items that aren't a block's get their sprite as their texture, or the
);
assertEquals(report.errors, []);
// the gear's item comes with its block, and the wrench's model parts aren't items
assertEquals(report.written.map(({ id }) => id).sort(), ["gears:sheet", "gears:wrench"]);
assertEquals(report.written.map(({ id }) => id).sort(), ["gears:sheet", "gears:trimmed_sheet", "gears:wrench"]);
const sheet = JSON.parse(Deno.readTextFileSync(`${output}/sheet.json`)).item;
assertEquals(sheet, { id: "gears:sheet", texture: "gears:item_sheet" });
assertEquals(validate_item(sheet), []);
// java's other layers are drawn over the first
const trimmed = JSON.parse(Deno.readTextFileSync(`${output}/trimmed_sheet.json`)).item;
assertEquals(trimmed.layers, [{ texture: "gears:item_trim" }]);
assertEquals(validate_item(trimmed), []);
// the model kind writes its model, and its texture is its model's
const wrench = JSON.parse(Deno.readTextFileSync(`${output}/wrench.json`)).item;
assertEquals(wrench, { id: "gears:wrench", texture: "gears:item_wrench", model: "gears:item_wrench" });