diff --git a/src/main/java/io/github/cottonmc/templates/Templates.java b/src/main/java/io/github/cottonmc/templates/Templates.java index 214a179..1a220b3 100644 --- a/src/main/java/io/github/cottonmc/templates/Templates.java +++ b/src/main/java/io/github/cottonmc/templates/Templates.java @@ -34,6 +34,7 @@ public class Templates implements ModInitializer { public static final Block DOOR = Registry.register(Registries.BLOCK, id("door") , new TemplateDoorBlock(cp(Blocks.OAK_DOOR), BlockSetType.OAK)); public static final Block FENCE = Registry.register(Registries.BLOCK, id("fence") , new TemplateFenceBlock(cp(Blocks.OAK_FENCE))); public static final Block FENCE_GATE = Registry.register(Registries.BLOCK, id("fence_gate") , new TemplateFenceGateBlock(cp(Blocks.OAK_FENCE_GATE))); + public static final Block IRON_DOOR = Registry.register(Registries.BLOCK, id("iron_door") , new TemplateDoorBlock(cp(Blocks.IRON_DOOR), BlockSetType.IRON)); public static final Block IRON_TRAPDOOR = Registry.register(Registries.BLOCK, id("iron_trapdoor") , new TemplateTrapdoorBlock(cp(Blocks.IRON_TRAPDOOR), BlockSetType.IRON)); public static final Block LEVER = Registry.register(Registries.BLOCK, id("lever") , new TemplateLeverBlock(cp(Blocks.LEVER))); public static final Block PANE = Registry.register(Registries.BLOCK, id("pane") , new TemplatePaneBlock(cp(Blocks.GLASS_PANE))); @@ -59,6 +60,7 @@ public class Templates implements ModInitializer { DOOR, FENCE, FENCE_GATE, + IRON_DOOR, IRON_TRAPDOOR, LEVER, PANE, @@ -93,6 +95,7 @@ public class Templates implements ModInitializer { Registry.register(Registries.ITEM, id("door") , new BlockItem(DOOR, new Item.Settings())); Registry.register(Registries.ITEM, id("fence") , new BlockItem(FENCE, new Item.Settings())); Registry.register(Registries.ITEM, id("fence_gate") , new BlockItem(FENCE_GATE, new Item.Settings())); + Registry.register(Registries.ITEM, id("iron_door") , new BlockItem(IRON_DOOR, new Item.Settings())); Registry.register(Registries.ITEM, id("iron_trapdoor") , new BlockItem(IRON_TRAPDOOR, new Item.Settings())); Registry.register(Registries.ITEM, id("lever") , new BlockItem(LEVER, new Item.Settings())); Registry.register(Registries.ITEM, id("pane") , new BlockItem(PANE, new Item.Settings())); @@ -126,6 +129,7 @@ public class Templates implements ModInitializer { e.add(FENCE_GATE); e.add(DOOR); e.add(TRAPDOOR); + e.add(IRON_DOOR); e.add(IRON_TRAPDOOR); e.add(PRESSURE_PLATE); e.add(BUTTON); diff --git a/src/main/java/io/github/cottonmc/templates/TemplatesClient.java b/src/main/java/io/github/cottonmc/templates/TemplatesClient.java index 76899ef..d4ba195 100644 --- a/src/main/java/io/github/cottonmc/templates/TemplatesClient.java +++ b/src/main/java/io/github/cottonmc/templates/TemplatesClient.java @@ -63,6 +63,7 @@ public class TemplatesClient implements ClientModInitializer { Templates.DOOR, Templates.FENCE, Templates.FENCE_GATE, + Templates.IRON_DOOR, Templates.IRON_TRAPDOOR, Templates.LEVER, Templates.PANE, diff --git a/src/main/resources/assets/templates/blockstates/iron_door.json b/src/main/resources/assets/templates/blockstates/iron_door.json new file mode 100644 index 0000000..ceb150a --- /dev/null +++ b/src/main/resources/assets/templates/blockstates/iron_door.json @@ -0,0 +1,124 @@ +{ + "variants": { + "facing=east,half=lower,hinge=left,open=false": { + "model": "templates:door_bottom_left_special" + }, + "facing=east,half=lower,hinge=left,open=true": { + "model": "templates:door_bottom_left_open_special", + "y": 90 + }, + "facing=east,half=lower,hinge=right,open=false": { + "model": "templates:door_bottom_right_special" + }, + "facing=east,half=lower,hinge=right,open=true": { + "model": "templates:door_bottom_right_open_special", + "y": 270 + }, + "facing=east,half=upper,hinge=left,open=false": { + "model": "templates:door_top_left_special" + }, + "facing=east,half=upper,hinge=left,open=true": { + "model": "templates:door_top_left_open_special", + "y": 90 + }, + "facing=east,half=upper,hinge=right,open=false": { + "model": "templates:door_top_right_special" + }, + "facing=east,half=upper,hinge=right,open=true": { + "model": "templates:door_top_right_open_special", + "y": 270 + }, + "facing=north,half=lower,hinge=left,open=false": { + "model": "templates:door_bottom_left_special", + "y": 270 + }, + "facing=north,half=lower,hinge=left,open=true": { + "model": "templates:door_bottom_left_open_special" + }, + "facing=north,half=lower,hinge=right,open=false": { + "model": "templates:door_bottom_right_special", + "y": 270 + }, + "facing=north,half=lower,hinge=right,open=true": { + "model": "templates:door_bottom_right_open_special", + "y": 180 + }, + "facing=north,half=upper,hinge=left,open=false": { + "model": "templates:door_top_left_special", + "y": 270 + }, + "facing=north,half=upper,hinge=left,open=true": { + "model": "templates:door_top_left_open_special" + }, + "facing=north,half=upper,hinge=right,open=false": { + "model": "templates:door_top_right_special", + "y": 270 + }, + "facing=north,half=upper,hinge=right,open=true": { + "model": "templates:door_top_right_open_special", + "y": 180 + }, + "facing=south,half=lower,hinge=left,open=false": { + "model": "templates:door_bottom_left_special", + "y": 90 + }, + "facing=south,half=lower,hinge=left,open=true": { + "model": "templates:door_bottom_left_open_special", + "y": 180 + }, + "facing=south,half=lower,hinge=right,open=false": { + "model": "templates:door_bottom_right_special", + "y": 90 + }, + "facing=south,half=lower,hinge=right,open=true": { + "model": "templates:door_bottom_right_open_special" + }, + "facing=south,half=upper,hinge=left,open=false": { + "model": "templates:door_top_left_special", + "y": 90 + }, + "facing=south,half=upper,hinge=left,open=true": { + "model": "templates:door_top_left_open_special", + "y": 180 + }, + "facing=south,half=upper,hinge=right,open=false": { + "model": "templates:door_top_right_special", + "y": 90 + }, + "facing=south,half=upper,hinge=right,open=true": { + "model": "templates:door_top_right_open_special" + }, + "facing=west,half=lower,hinge=left,open=false": { + "model": "templates:door_bottom_left_special", + "y": 180 + }, + "facing=west,half=lower,hinge=left,open=true": { + "model": "templates:door_bottom_left_open_special", + "y": 270 + }, + "facing=west,half=lower,hinge=right,open=false": { + "model": "templates:door_bottom_right_special", + "y": 180 + }, + "facing=west,half=lower,hinge=right,open=true": { + "model": "templates:door_bottom_right_open_special", + "y": 90 + }, + "facing=west,half=upper,hinge=left,open=false": { + "model": "templates:door_top_left_special", + "y": 180 + }, + "facing=west,half=upper,hinge=left,open=true": { + "model": "templates:door_top_left_open_special", + "y": 270 + }, + "facing=west,half=upper,hinge=right,open=false": { + "model": "templates:door_top_right_special", + "y": 180 + }, + "facing=west,half=upper,hinge=right,open=true": { + "model": "templates:door_top_right_open_special", + "y": 90 + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/templates/lang/en_us.json b/src/main/resources/assets/templates/lang/en_us.json index a956cd4..b9606c7 100644 --- a/src/main/resources/assets/templates/lang/en_us.json +++ b/src/main/resources/assets/templates/lang/en_us.json @@ -8,6 +8,7 @@ "block.templates.door": "Door Template", "block.templates.fence": "Fence Template", "block.templates.fence_gate": "Fence Gate Template", + "block.templates.iron_door": "Iron Door Template", "block.templates.iron_trapdoor": "Iron Trapdoor Template", "block.templates.lever": "Lever Template", "block.templates.pane": "Pane Template", diff --git a/src/main/resources/assets/templates/models/item/iron_door.json b/src/main/resources/assets/templates/models/item/iron_door.json new file mode 100644 index 0000000..f5985bf --- /dev/null +++ b/src/main/resources/assets/templates/models/item/iron_door.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "templates:item/door" + } +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/doors.json b/src/main/resources/data/minecraft/tags/blocks/doors.json new file mode 100644 index 0000000..9dcdb45 --- /dev/null +++ b/src/main/resources/data/minecraft/tags/blocks/doors.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "templates:iron_door" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json b/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json index 2408475..f8fedd4 100644 --- a/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json +++ b/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json @@ -1,6 +1,7 @@ { "replace": false, "values": [ + "templates:iron_door", "templates:iron_trapdoor" ] } \ No newline at end of file diff --git a/src/main/resources/data/templates/advancements/recipes/decorations/templates.json b/src/main/resources/data/templates/advancements/recipes/decorations/templates.json index 0e6eb3d..ecdce1e 100644 --- a/src/main/resources/data/templates/advancements/recipes/decorations/templates.json +++ b/src/main/resources/data/templates/advancements/recipes/decorations/templates.json @@ -9,6 +9,7 @@ "templates:door", "templates:fence", "templates:fence_gate", + "templates:iron_door", "templates:iron_trapdoor", "templates:lever", "templates:pane", diff --git a/src/main/resources/data/templates/loot_tables/blocks/iron_door.json b/src/main/resources/data/templates/loot_tables/blocks/iron_door.json new file mode 100644 index 0000000..c5fe380 --- /dev/null +++ b/src/main/resources/data/templates/loot_tables/blocks/iron_door.json @@ -0,0 +1,28 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "templates:iron_door", + "conditions": [ + { + "block": "templates:iron_door", + "condition": "minecraft:block_state_property", + "properties": { + "half": "lower" + } + } + ] + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/templates/recipes/iron_door.json b/src/main/resources/data/templates/recipes/iron_door.json new file mode 100644 index 0000000..2896a2a --- /dev/null +++ b/src/main/resources/data/templates/recipes/iron_door.json @@ -0,0 +1,24 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "II ", + "II~", + "IIX" + ], + "key": { + "I": { + "item": "minecraft:bamboo" + }, + "~": { + "item": "minecraft:string" + }, + "X": { + "item": "minecraft:iron_ingot" + } + }, + "result": { + "item": "templates:door", + "count": 2 + }, + "group": "templates" +} \ No newline at end of file