diff --git a/src/core/BlockState.ts b/src/core/BlockState.ts index cfba44b7..86d7e378 100644 --- a/src/core/BlockState.ts +++ b/src/core/BlockState.ts @@ -44,6 +44,9 @@ export class BlockState { if (!this.name.equals(other.name)) { return false } + if (Object.keys(this.properties).length !== Object.keys(other.properties).length) { + return false + } return Object.keys(this.properties).every(p => { return other.properties[p] === this.properties[p] }) diff --git a/src/render/BlockDefinition.ts b/src/render/BlockDefinition.ts index f9c15291..930bba28 100644 --- a/src/render/BlockDefinition.ts +++ b/src/render/BlockDefinition.ts @@ -18,7 +18,8 @@ type ModelVariantEntry = ModelVariant | (ModelVariant & { })[] type ModelMultiPartCondition = { - OR: ModelMultiPartCondition[], + OR?: ModelMultiPartCondition[], + AND?: ModelMultiPartCondition[], } | { [key: string]: string, } @@ -91,6 +92,9 @@ export class BlockDefinition { if (Array.isArray(condition.OR)) { return condition.OR.some(c => this.matchesCase(c, props)) } + if (Array.isArray(condition.AND)) { + return condition.AND.every(c => this.matchesCase(c, props)) + } const states = condition as {[key: string]: string} return Object.keys(states).every(k => { const values = states[k].split('|') diff --git a/src/render/SpecialRenderer.ts b/src/render/SpecialRenderer.ts index 5e0fec9a..ab1ddb77 100644 --- a/src/render/SpecialRenderer.ts +++ b/src/render/SpecialRenderer.ts @@ -840,6 +840,14 @@ export namespace SpecialRenderers { 'minecraft:chest': SpecialRenderers.chestRenderer(Identifier.create('normal')), 'minecraft:ender_chest': SpecialRenderers.chestRenderer(Identifier.create('ender')), 'minecraft:trapped_chest': SpecialRenderers.chestRenderer(Identifier.create('trapped')), + 'minecraft:copper_chest': SpecialRenderers.chestRenderer(Identifier.create('copper')), + 'minecraft:exposed_copper_chest': SpecialRenderers.chestRenderer(Identifier.create('copper_exposed')), + 'minecraft:weathered_copper_chest': SpecialRenderers.chestRenderer(Identifier.create('copper_weathered')), + 'minecraft:oxidized_copper_chest': SpecialRenderers.chestRenderer(Identifier.create('copper_oxidized')), + 'minecraft:waxed_copper_chest': SpecialRenderers.chestRenderer(Identifier.create('copper')), + 'minecraft:waxed_exposed_copper_chest': SpecialRenderers.chestRenderer(Identifier.create('copper_exposed')), + 'minecraft:waxed_weathered_copper_chest': SpecialRenderers.chestRenderer(Identifier.create('copper_weathered')), + 'minecraft:waxed_oxidized_copper_chest': SpecialRenderers.chestRenderer(Identifier.create('copper_oxidized')), })) const SkullRenderers = new Map(Object.entries({