From c8d473f573d1acd18d4da64b1440be89de1da640 Mon Sep 17 00:00:00 2001 From: Xel'Bayria <12866666+Xelbayria@users.noreply.github.com> Date: Mon, 23 Dec 2024 02:03:45 -0700 Subject: [PATCH] DramaticDoorsMacawModule: Fixed #733 - Missing Item Textures in Model --- .../DramaticDoorsMacawModule.java | 111 +++++++----------- 1 file changed, 44 insertions(+), 67 deletions(-) diff --git a/forge/src/main/java/net/mehvahdjukaar/every_compat/modules/forge/dramaticdoors/DramaticDoorsMacawModule.java b/forge/src/main/java/net/mehvahdjukaar/every_compat/modules/forge/dramaticdoors/DramaticDoorsMacawModule.java index eec10c7be..49851485a 100644 --- a/forge/src/main/java/net/mehvahdjukaar/every_compat/modules/forge/dramaticdoors/DramaticDoorsMacawModule.java +++ b/forge/src/main/java/net/mehvahdjukaar/every_compat/modules/forge/dramaticdoors/DramaticDoorsMacawModule.java @@ -11,6 +11,7 @@ import net.mehvahdjukaar.every_compat.api.SimpleModule; import net.mehvahdjukaar.every_compat.dynamicpack.ClientDynamicResourcesHandler; import net.mehvahdjukaar.every_compat.misc.SpriteHelper; +import net.mehvahdjukaar.moonlight.api.resources.BlockTypeResTransformer; import net.mehvahdjukaar.moonlight.api.resources.RPUtils; import net.mehvahdjukaar.moonlight.api.resources.textures.Palette; import net.mehvahdjukaar.moonlight.api.resources.textures.TextureImage; @@ -23,6 +24,8 @@ import net.minecraft.tags.BlockTags; import net.minecraft.world.level.block.Block; +//SUPPORT: Dramatic Doors v3.2.8+ +//SUPPORT: Macaw's Fences & Walls v1.1.2+ public class DramaticDoorsMacawModule extends SimpleModule { public final SimpleEntrySet tallBarkGlassDoors; @@ -51,12 +54,12 @@ public DramaticDoorsMacawModule(String modId) { tallBarnDoors = SimpleEntrySet.builder(WoodType.class, "barn_door", "tall_macaw", getModBlock("tall_macaw_oak_barn_door"), () -> WoodTypeRegistry.OAK_TYPE, - w -> new TallDoorBlock(BlockInit.OAK_BARN_DOOR.get(), w.toVanillaOrOak().setType())) + w -> new TallDoorBlock(BlockInit.OAK_BARN_DOOR.get(), w.toVanillaOrOak().setType()) + ) .addTextureM(modRes("block/macaw/tall_oak_barn_door_lower"), EveryCompat.res("block/ddm/tall_oak_barn_door_lower_m")) .addTextureM(modRes("block/macaw/tall_oak_barn_door_middle"), EveryCompat.res("block/ddm/tall_oak_barn_door_middle_m")) .addTextureM(modRes("block/macaw/tall_oak_barn_door_upper"), EveryCompat.res("block/ddm/tall_oak_barn_door_upper_m")) .addTextureM(modRes("item/macaw/tall_oak_barn_door"), EveryCompat.res("item/ddm/tall_oak_barn_door_m")) - .addModelTransform(m -> m.replaceGenericType("oak", "item/macaw")) .addTag(modRes("tall_wooden_doors"), Registries.BLOCK) .addTag(modRes("tall_wooden_doors"), Registries.ITEM) .addTag(BlockTags.MINEABLE_WITH_AXE, Registries.BLOCK) @@ -69,12 +72,12 @@ public DramaticDoorsMacawModule(String modId) { tallBarnGlassedDoors = SimpleEntrySet.builder(WoodType.class, "barn_glass_door", "tall_macaw", getModBlock("tall_macaw_oak_barn_glass_door"), () -> WoodTypeRegistry.OAK_TYPE, - w -> new TallDoorBlock(BlockInit.OAK_BARN_GLASS_DOOR.get(), w.toVanillaOrOak().setType())) + w -> new TallDoorBlock(BlockInit.OAK_BARN_GLASS_DOOR.get(), w.toVanillaOrOak().setType()) + ) .addTextureM(modRes("block/macaw/tall_oak_barn_door_lower"), EveryCompat.res("block/ddm/tall_oak_barn_door_lower_m")) .addTextureM(modRes("block/macaw/tall_oak_barn_glass_door_middle"), EveryCompat.res("block/ddm/tall_oak_barn_glass_door_middle_m")) .addTextureM(modRes("block/macaw/tall_oak_barn_glass_door_upper"), EveryCompat.res("block/ddm/tall_oak_barn_glass_door_upper_m")) .addTextureM(modRes("item/macaw/tall_oak_barn_glass_door"), EveryCompat.res("item/ddm/tall_oak_barn_glass_door_m")) - .addModelTransform(m -> m.replaceGenericType("oak", "item/macaw")) .addTag(modRes("tall_wooden_doors"), Registries.BLOCK) .addTag(modRes("tall_wooden_doors"), Registries.ITEM) .addTag(BlockTags.MINEABLE_WITH_AXE, Registries.BLOCK) @@ -87,12 +90,12 @@ public DramaticDoorsMacawModule(String modId) { tallStableDoors = SimpleEntrySet.builder(WoodType.class, "stable_door", "tall_macaw", getModBlock("tall_macaw_oak_stable_door"), () -> WoodTypeRegistry.OAK_TYPE, - w -> new TallStableDoorBlock(BlockInit.OAK_STABLE_DOOR.get(), w.toVanillaOrOak().setType())) + w -> new TallStableDoorBlock(BlockInit.OAK_STABLE_DOOR.get(), w.toVanillaOrOak().setType()) + ) .addTextureM(modRes("block/macaw/tall_oak_stable_door_lower"), EveryCompat.res("block/ddm/tall_oak_stable_door_lower_m")) .addTextureM(modRes("block/macaw/tall_oak_stable_door_middle"), EveryCompat.res("block/ddm/tall_oak_stable_door_middle_m")) .addTextureM(modRes("block/macaw/tall_oak_stable_door_upper"), EveryCompat.res("block/ddm/tall_oak_stable_door_upper_m")) .addTextureM(modRes("item/macaw/tall_oak_stable_door"), EveryCompat.res("item/ddm/tall_oak_stable_door_m")) - .addModelTransform(m -> m.replaceGenericType("oak", "item/macaw")) .addTag(modRes("tall_wooden_doors"), Registries.BLOCK) .addTag(modRes("tall_wooden_doors"), Registries.ITEM) .addTag(BlockTags.MINEABLE_WITH_AXE, Registries.BLOCK) @@ -105,12 +108,12 @@ public DramaticDoorsMacawModule(String modId) { tallStableHorseDoors = SimpleEntrySet.builder(WoodType.class, "stable_head_door", "tall_macaw", getModBlock("tall_macaw_oak_stable_head_door"), () -> WoodTypeRegistry.OAK_TYPE, - w -> new TallStableDoorBlock(BlockInit.OAK_STABLE_HEAD_DOOR.get(), w.toVanillaOrOak().setType())) + w -> new TallStableDoorBlock(BlockInit.OAK_STABLE_HEAD_DOOR.get(), w.toVanillaOrOak().setType()) + ) .addTextureM(modRes("block/macaw/tall_oak_stable_door_lower"), EveryCompat.res("block/ddm/tall_oak_stable_door_lower_m")) .addTextureM(modRes("block/macaw/tall_oak_stable_head_door_middle"), EveryCompat.res("block/ddm/tall_oak_stable_head_door_middle_m")) .addTextureM(modRes("block/macaw/tall_oak_stable_door_upper"), EveryCompat.res("block/ddm/tall_oak_stable_door_upper_m")) .addTextureM(modRes("item/macaw/tall_oak_stable_head_door"), EveryCompat.res("item/ddm/tall_oak_stable_head_door_m")) - .addModelTransform(m -> m.replaceGenericType("oak", "item/macaw")) .addTag(modRes("tall_wooden_doors"), Registries.BLOCK) .addTag(modRes("tall_wooden_doors"), Registries.ITEM) .addTag(BlockTags.MINEABLE_WITH_AXE, Registries.BLOCK) @@ -123,9 +126,10 @@ public DramaticDoorsMacawModule(String modId) { tallBarkGlassDoors = SimpleEntrySet.builder(WoodType.class, "bark_glass_door", "tall_macaw", getModBlock("tall_macaw_oak_bark_glass_door"), () -> WoodTypeRegistry.OAK_TYPE, - w -> new TallDoorBlock(BlockInit.OAK_BARK_GLASS_DOOR.get(), w.toVanillaOrOak().setType())) - .addTextureM(modRes("item/macaw/tall_oak_bark_glass_door"), EveryCompat.res("block/ddm/tall_oak_bark_glass_door_m")) - .addModelTransform(m -> m.replaceGenericType("oak", "item/macaw")) + w -> new TallDoorBlock(BlockInit.OAK_BARK_GLASS_DOOR.get(), w.toVanillaOrOak().setType()) + ) + .createPaletteFromChild("log", SpriteHelper.LOOKS_LIKE_SIDE_LOG_TEXTURE) + .addTextureM(modRes("item/macaw/tall_oak_bark_glass_door"), EveryCompat.res("item/ddm/tall_oak_bark_glass_door_m")) .addTag(modRes("tall_wooden_doors"), Registries.BLOCK) .addTag(modRes("tall_wooden_doors"), Registries.ITEM) .addTag(BlockTags.MINEABLE_WITH_AXE, Registries.BLOCK) @@ -138,12 +142,12 @@ public DramaticDoorsMacawModule(String modId) { tallGlassDoors = SimpleEntrySet.builder(WoodType.class, "glass_door", "tall_macaw", getModBlock("tall_macaw_oak_glass_door"), () -> WoodTypeRegistry.OAK_TYPE, - w -> new TallDoorBlock(BlockInit.OAK_GLASS_DOOR.get(), w.toVanillaOrOak().setType())) + w -> new TallDoorBlock(BlockInit.OAK_GLASS_DOOR.get(), w.toVanillaOrOak().setType()) + ) .addTextureM(modRes("block/macaw/tall_oak_glass_door_lower"), EveryCompat.res("block/ddm/tall_oak_glass_door_lower_m")) .addTextureM(modRes("block/macaw/tall_oak_glass_door_middle"), EveryCompat.res("block/ddm/tall_oak_glass_door_middle_m")) .addTextureM(modRes("block/macaw/tall_oak_glass_door_upper"), EveryCompat.res("block/ddm/tall_oak_glass_door_upper_m")) .addTextureM(modRes("item/macaw/tall_oak_glass_door"), EveryCompat.res("item/ddm/tall_oak_glass_door_m")) - .addModelTransform(m -> m.replaceGenericType("oak", "item/macaw")) .addTag(modRes("tall_wooden_doors"), Registries.BLOCK) .addTag(modRes("tall_wooden_doors"), Registries.ITEM) .addTag(BlockTags.MINEABLE_WITH_AXE, Registries.BLOCK) @@ -156,12 +160,12 @@ public DramaticDoorsMacawModule(String modId) { tallModernDoors = SimpleEntrySet.builder(WoodType.class, "modern_door", "tall_macaw", getModBlock("tall_macaw_oak_modern_door"), () -> WoodTypeRegistry.OAK_TYPE, - w -> new TallDoorBlock(BlockInit.OAK_MODERN_DOOR.get(), w.toVanillaOrOak().setType())) + w -> new TallDoorBlock(BlockInit.OAK_MODERN_DOOR.get(), w.toVanillaOrOak().setType()) + ) .addTextureM(modRes("block/macaw/tall_oak_modern_door_lower"), EveryCompat.res("block/ddm/tall_oak_modern_door_lower_m")) .addTextureM(modRes("block/macaw/tall_oak_modern_door_middle"), EveryCompat.res("block/ddm/tall_oak_modern_door_middle_m")) .addTextureM(modRes("block/macaw/tall_oak_modern_door_upper"), EveryCompat.res("block/ddm/tall_oak_modern_door_upper_m")) .addTextureM(modRes("item/macaw/tall_oak_modern_door"), EveryCompat.res("item/ddm/tall_oak_modern_door_m")) - .addModelTransform(m -> m.replaceGenericType("oak", "item/macaw")) .addTag(modRes("tall_wooden_doors"), Registries.BLOCK) .addTag(modRes("tall_wooden_doors"), Registries.ITEM) .addTag(BlockTags.MINEABLE_WITH_AXE, Registries.BLOCK) @@ -174,12 +178,12 @@ public DramaticDoorsMacawModule(String modId) { tallShojiDoors = SimpleEntrySet.builder(WoodType.class, "japanese_door", "tall_macaw", getModBlock("tall_macaw_oak_japanese_door"), () -> WoodTypeRegistry.OAK_TYPE, - w -> new TallSlidingDoorBlock(BlockInit.OAK_JAPANESE_DOOR.get(), w.toVanillaOrOak().setType())) - .addTextureM(modRes("block/macaw/tall_oak_japanese_lower"), EveryCompat.res("block/ddm/tall_oak_japanese_door_lower_m")) - .addTextureM(modRes("block/macaw/tall_oak_japanese_middle"), EveryCompat.res("block/ddm/tall_oak_japanese_door_middle_m")) - .addTextureM(modRes("block/macaw/tall_oak_japanese_upper"), EveryCompat.res("block/ddm/tall_oak_japanese_door_upper_m")) + w -> new TallSlidingDoorBlock(BlockInit.OAK_JAPANESE_DOOR.get(), w.toVanillaOrOak().setType()) + ) + .addTextureM(modRes("block/macaw/tall_oak_japanese_door_lower"), EveryCompat.res("block/ddm/tall_oak_japanese_door_lower_m")) + .addTextureM(modRes("block/macaw/tall_oak_japanese_door_middle"), EveryCompat.res("block/ddm/tall_oak_japanese_door_middle_m")) + .addTextureM(modRes("block/macaw/tall_oak_japanese_door_upper"), EveryCompat.res("block/ddm/tall_oak_japanese_door_upper_m")) .addTextureM(modRes("item/macaw/tall_oak_japanese_door"), EveryCompat.res("item/ddm/tall_oak_japanese_door_m")) - .addModelTransform(m -> m.replaceGenericType("oak", "item/macaw")) .addTag(modRes("tall_wooden_doors"), Registries.BLOCK) .addTag(modRes("tall_wooden_doors"), Registries.ITEM) .addTag(BlockTags.MINEABLE_WITH_AXE, Registries.BLOCK) @@ -192,12 +196,12 @@ public DramaticDoorsMacawModule(String modId) { tallShojiWholeDoors = SimpleEntrySet.builder(WoodType.class, "japanese2_door", "tall_macaw", getModBlock("tall_macaw_oak_japanese2_door"), () -> WoodTypeRegistry.OAK_TYPE, - w -> new TallSlidingDoorBlock(BlockInit.OAK_JAPANESE2_DOOR.get(), w.toVanillaOrOak().setType())) + w -> new TallSlidingDoorBlock(BlockInit.OAK_JAPANESE2_DOOR.get(), w.toVanillaOrOak().setType()) + ) .addTextureM(modRes("block/macaw/tall_oak_japanese2_door_lower"), EveryCompat.res("block/ddm/tall_oak_japanese2_door_lower_m")) .addTextureM(modRes("block/macaw/tall_oak_japanese2_door_middle"), EveryCompat.res("block/ddm/tall_oak_japanese2_door_middle_m")) .addTextureM(modRes("block/macaw/tall_oak_japanese2_door_upper"), EveryCompat.res("block/ddm/tall_oak_japanese2_door_upper_m")) .addTextureM(modRes("item/macaw/tall_oak_japanese2_door"), EveryCompat.res("item/ddm/tall_oak_japanese2_door_m")) - .addModelTransform(m -> m.replaceGenericType("oak", "item/macaw")) .addTag(modRes("tall_wooden_doors"), Registries.BLOCK) .addTag(modRes("tall_wooden_doors"), Registries.ITEM) .addTag(BlockTags.MINEABLE_WITH_AXE, Registries.BLOCK) @@ -210,12 +214,12 @@ public DramaticDoorsMacawModule(String modId) { tallClassicDoors = SimpleEntrySet.builder(WoodType.class, "classic_door", "tall_macaw", getModBlock("tall_macaw_spruce_classic_door"), () -> WoodTypeRegistry.getValue(new ResourceLocation("spruce")), - w -> new TallDoorBlock(BlockInit.SPRUCE_CLASSIC_DOOR.get(), w.toVanillaOrOak().setType())) + w -> new TallDoorBlock(BlockInit.SPRUCE_CLASSIC_DOOR.get(), w.toVanillaOrOak().setType()) + ) .addTextureM(modRes("block/macaw/tall_spruce_classic_door_lower"), EveryCompat.res("block/ddm/tall_oak_classic_door_lower_m")) .addTextureM(modRes("block/macaw/tall_spruce_classic_door_middle"), EveryCompat.res("block/ddm/tall_oak_classic_door_middle_m")) .addTextureM(modRes("block/macaw/tall_spruce_classic_door_upper"), EveryCompat.res("block/ddm/tall_oak_classic_door_upper_m")) .addTextureM(modRes("item/macaw/tall_spruce_classic_door"), EveryCompat.res("item/ddm/tall_oak_classic_door_m")) - .addModelTransform(m -> m.replaceGenericType("spruce", "item/macaw")) .addTag(modRes("tall_wooden_doors"), Registries.BLOCK) .addTag(modRes("tall_wooden_doors"), Registries.ITEM) .addTag(BlockTags.MINEABLE_WITH_AXE, Registries.BLOCK) @@ -228,12 +232,12 @@ public DramaticDoorsMacawModule(String modId) { tallCottageDoors = SimpleEntrySet.builder(WoodType.class, "cottage_door", "tall_macaw", getModBlock("tall_macaw_oak_cottage_door"), () -> WoodTypeRegistry.OAK_TYPE, - w -> new TallDoorBlock(BlockInit.OAK_COTTAGE_DOOR.get(), w.toVanillaOrOak().setType())) + w -> new TallDoorBlock(BlockInit.OAK_COTTAGE_DOOR.get(), w.toVanillaOrOak().setType()) + ) .addTextureM(modRes("block/macaw/tall_oak_cottage_door_lower"), EveryCompat.res("block/ddm/tall_oak_cottage_door_lower_m")) .addTextureM(modRes("block/macaw/tall_oak_cottage_door_middle"), EveryCompat.res("block/ddm/tall_oak_cottage_door_middle_m")) .addTextureM(modRes("block/macaw/tall_oak_cottage_door_upper"), EveryCompat.res("block/ddm/tall_oak_cottage_door_upper_m")) .addTextureM(modRes("item/macaw/tall_oak_cottage_door"), EveryCompat.res("item/ddm/tall_oak_cottage_door_m")) - .addModelTransform(m -> m.replaceGenericType("oak", "item/macaw")) .addTag(modRes("tall_wooden_doors"), Registries.BLOCK) .addTag(modRes("tall_wooden_doors"), Registries.ITEM) .addTag(BlockTags.MINEABLE_WITH_AXE, Registries.BLOCK) @@ -246,12 +250,12 @@ public DramaticDoorsMacawModule(String modId) { tallPaperDoors = SimpleEntrySet.builder(WoodType.class, "paper_door", "tall_macaw", getModBlock("tall_macaw_oak_paper_door"), () -> WoodTypeRegistry.OAK_TYPE, - w -> new TallDoorBlock(BlockInit.OAK_PAPER_DOOR.get(), w.toVanillaOrOak().setType())) + w -> new TallDoorBlock(BlockInit.OAK_PAPER_DOOR.get(), w.toVanillaOrOak().setType()) + ) .addTextureM(modRes("block/macaw/tall_oak_paper_door_lower"), EveryCompat.res("block/ddm/tall_oak_paper_door_lower_m")) .addTextureM(modRes("block/macaw/tall_oak_paper_door_middle"), EveryCompat.res("block/ddm/tall_oak_paper_door_middle_m")) .addTextureM(modRes("block/macaw/tall_oak_paper_door_upper"), EveryCompat.res("block/ddm/tall_oak_paper_door_upper_m")) .addTextureM(modRes("item/macaw/tall_oak_paper_door"), EveryCompat.res("item/ddm/tall_oak_paper_door_m")) - .addModelTransform(m -> m.replaceGenericType("oak", "item/macaw")) .addTag(modRes("tall_wooden_doors"), Registries.BLOCK) .addTag(modRes("tall_wooden_doors"), Registries.ITEM) .addTag(BlockTags.MINEABLE_WITH_AXE, Registries.BLOCK) @@ -264,12 +268,12 @@ public DramaticDoorsMacawModule(String modId) { tallBeachDoors = SimpleEntrySet.builder(WoodType.class, "beach_door", "tall_macaw", getModBlock("tall_macaw_oak_beach_door"), () -> WoodTypeRegistry.OAK_TYPE, - w -> new TallDoorBlock(BlockInit.OAK_BEACH_DOOR.get(), w.toVanillaOrOak().setType())) + w -> new TallDoorBlock(BlockInit.OAK_BEACH_DOOR.get(), w.toVanillaOrOak().setType()) + ) .addTextureM(modRes("block/macaw/tall_oak_beach_door_lower"), EveryCompat.res("block/ddm/tall_oak_beach_door_lower_m")) .addTextureM(modRes("block/macaw/tall_oak_beach_door_middle"), EveryCompat.res("block/ddm/tall_oak_beach_door_middle_m")) .addTextureM(modRes("block/macaw/tall_oak_beach_door_upper"), EveryCompat.res("block/ddm/tall_oak_beach_door_upper_m")) .addTextureM(modRes("item/macaw/tall_oak_beach_door"), EveryCompat.res("item/ddm/tall_oak_beach_door_m")) - .addModelTransform(m -> m.replaceGenericType("oak", "item/macaw")) .addTag(modRes("tall_wooden_doors"), Registries.BLOCK) .addTag(modRes("tall_wooden_doors"), Registries.ITEM) .addTag(BlockTags.MINEABLE_WITH_AXE, Registries.BLOCK) @@ -282,12 +286,12 @@ public DramaticDoorsMacawModule(String modId) { tallTropicalDoors = SimpleEntrySet.builder(WoodType.class, "tropical_door", "tall_macaw", getModBlock("tall_macaw_oak_tropical_door"), () -> WoodTypeRegistry.OAK_TYPE, - w -> new TallDoorBlock(BlockInit.OAK_TROPICAL_DOOR.get(), w.toVanillaOrOak().setType())) + w -> new TallDoorBlock(BlockInit.OAK_TROPICAL_DOOR.get(), w.toVanillaOrOak().setType()) + ) .addTextureM(modRes("block/macaw/tall_oak_tropical_door_lower"), EveryCompat.res("block/ddm/tall_oak_tropical_door_lower_m")) .addTextureM(modRes("block/macaw/tall_oak_tropical_door_middle"), EveryCompat.res("block/ddm/tall_oak_tropical_door_middle_m")) .addTextureM(modRes("block/macaw/tall_oak_tropical_door_upper"), EveryCompat.res("block/ddm/tall_oak_tropical_door_upper_m")) .addTextureM(modRes("item/macaw/tall_oak_tropical_door"), EveryCompat.res("item/ddm/tall_oak_tropical_door_m")) - .addModelTransform(m -> m.replaceGenericType("oak", "item/macaw")) .addTag(modRes("tall_wooden_doors"), Registries.BLOCK) .addTag(modRes("tall_wooden_doors"), Registries.ITEM) .addTag(BlockTags.MINEABLE_WITH_AXE, Registries.BLOCK) @@ -300,12 +304,12 @@ public DramaticDoorsMacawModule(String modId) { tallFourPanelDoors = SimpleEntrySet.builder(WoodType.class, "four_panel_door", "tall_macaw", getModBlock("tall_macaw_oak_four_panel_door"), () -> WoodTypeRegistry.OAK_TYPE, - w -> new TallDoorBlock(BlockInit.OAK_FOUR_PANEL_DOOR.get(), w.toVanillaOrOak().setType())) + w -> new TallDoorBlock(BlockInit.OAK_FOUR_PANEL_DOOR.get(), w.toVanillaOrOak().setType()) + ) .addTextureM(modRes("block/macaw/tall_oak_four_panel_door_lower"), EveryCompat.res("block/ddm/tall_oak_four_panel_door_lower_m")) .addTextureM(modRes("block/macaw/tall_oak_four_panel_door_middle"), EveryCompat.res("block/ddm/tall_oak_four_panel_door_middle_m")) .addTextureM(modRes("block/macaw/tall_oak_four_panel_door_upper"), EveryCompat.res("block/ddm/tall_oak_four_panel_door_upper_m")) .addTextureM(modRes("item/macaw/tall_oak_four_panel_door"), EveryCompat.res("item/ddm/tall_oak_four_panel_door_m")) - .addModelTransform(m -> m.replaceGenericType("oak", "item/macaw")) .addTag(modRes("tall_wooden_doors"), Registries.BLOCK) .addTag(modRes("tall_wooden_doors"), Registries.ITEM) .addTag(BlockTags.MINEABLE_WITH_AXE, Registries.BLOCK) @@ -318,12 +322,12 @@ public DramaticDoorsMacawModule(String modId) { tallSwampDoors = SimpleEntrySet.builder(WoodType.class, "swamp_door", "tall_macaw", getModBlock("tall_macaw_oak_swamp_door"), () -> WoodTypeRegistry.OAK_TYPE, - w -> new TallDoorBlock(BlockInit.OAK_SWAMP_DOOR.get(), w.toVanillaOrOak().setType())) + w -> new TallDoorBlock(BlockInit.OAK_SWAMP_DOOR.get(), w.toVanillaOrOak().setType()) + ) .addTextureM(modRes("block/macaw/tall_oak_swamp_door_lower"), EveryCompat.res("block/ddm/tall_oak_swamp_door_lower_m")) .addTextureM(modRes("block/macaw/tall_oak_swamp_door_middle"), EveryCompat.res("block/ddm/tall_oak_swamp_door_middle_m")) .addTextureM(modRes("block/macaw/tall_oak_swamp_door_upper"), EveryCompat.res("block/ddm/tall_oak_swamp_door_upper_m")) .addTextureM(modRes("item/macaw/tall_oak_swamp_door"), EveryCompat.res("item/ddm/tall_oak_swamp_door_m")) - .addModelTransform(m -> m.replaceGenericType("oak", "item/macaw")) .addTag(modRes("tall_wooden_doors"), Registries.BLOCK) .addTag(modRes("tall_wooden_doors"), Registries.ITEM) .addTag(BlockTags.MINEABLE_WITH_AXE, Registries.BLOCK) @@ -337,12 +341,12 @@ public DramaticDoorsMacawModule(String modId) { tallNetherDoors = SimpleEntrySet.builder(WoodType.class, "nether_door", "tall_macaw", getModBlock("tall_macaw_oak_nether_door"), () -> WoodTypeRegistry.OAK_TYPE, - w -> new TallDoorBlock(BlockInit.OAK_NETHER_DOOR.get(), w.toVanillaOrOak().setType())) + w -> new TallDoorBlock(BlockInit.OAK_NETHER_DOOR.get(), w.toVanillaOrOak().setType()) + ) .addTextureM(modRes("block/macaw/tall_oak_nether_door_lower"), EveryCompat.res("block/ddm/tall_oak_nether_door_lower_m")) .addTextureM(modRes("block/macaw/tall_oak_nether_door_middle"), EveryCompat.res("block/ddm/tall_oak_nether_door_middle_m")) .addTextureM(modRes("block/macaw/tall_oak_nether_door_upper"), EveryCompat.res("block/ddm/tall_oak_nether_door_upper_m")) .addTextureM(modRes("item/macaw/tall_oak_nether_door"), EveryCompat.res("item/ddm/tall_oak_nether_door_m")) - .addModelTransform(m -> m.replaceGenericType("oak", "item/macaw")) .addTag(modRes("tall_wooden_doors"), Registries.BLOCK) .addTag(modRes("tall_wooden_doors"), Registries.ITEM) .addTag(BlockTags.MINEABLE_WITH_AXE, Registries.BLOCK) @@ -355,12 +359,12 @@ public DramaticDoorsMacawModule(String modId) { tallMysticDoors = SimpleEntrySet.builder(WoodType.class, "mystic_door", "tall_macaw", getModBlock("tall_macaw_oak_mystic_door"), () -> WoodTypeRegistry.OAK_TYPE, - w -> new TallDoorBlock(BlockInit.OAK_MYSTIC_DOOR.get(), w.toVanillaOrOak().setType())) + w -> new TallDoorBlock(BlockInit.OAK_MYSTIC_DOOR.get(), w.toVanillaOrOak().setType()) + ) .addTextureM(modRes("block/macaw/tall_oak_mystic_door_lower"), EveryCompat.res("block/ddm/tall_oak_mystic_door_lower_m")) .addTextureM(modRes("block/macaw/tall_oak_mystic_door_middle"), EveryCompat.res("block/ddm/tall_oak_mystic_door_middle_m")) .addTextureM(modRes("block/macaw/tall_oak_mystic_door_upper"), EveryCompat.res("block/ddm/tall_oak_mystic_door_upper_m")) .addTextureM(modRes("item/macaw/tall_oak_mystic_door"), EveryCompat.res("item/ddm/tall_oak_mystic_door_m")) - .addModelTransform(m -> m.replaceGenericType("oak", "item/macaw")) .addTag(modRes("tall_wooden_doors"), Registries.BLOCK) .addTag(modRes("tall_wooden_doors"), Registries.ITEM) .addTag(BlockTags.MINEABLE_WITH_AXE, Registries.BLOCK) @@ -377,31 +381,4 @@ private void swampDoorPalette(Palette p) { p.remove(p.getDarkest()); } - @Override - public void addDynamicClientResources(ClientDynamicResourcesHandler handler, ResourceManager manager) { - super.addDynamicClientResources(handler, manager); - - - try (TextureImage mask = TextureImage.open(manager, EveryCompat.res("item/ddm/tall_bark_glass_door_mask")); - TextureImage overlay = TextureImage.open(manager, EveryCompat.res("item/ddm/tall_bark_glass_door_overlay")) - ) { - tallBarkGlassDoors.blocks.forEach((wood, block) -> { - var id = Utils.getID(block); - - try (TextureImage logTexture = TextureImage.open(manager, - RPUtils.findFirstBlockTextureLocation(manager, wood.log, SpriteHelper.LOOKS_LIKE_SIDE_LOG_TEXTURE))) { - - var t = mask.makeCopy(); - t.applyOverlayOnExisting(logTexture.makeCopy(), overlay.makeCopy()); - - handler.dynamicPack.addAndCloseTexture(new ResourceLocation(id.getNamespace(), - "item/macaw/" + id.getPath().replace("_macaw", "")), t); - - } catch (Exception ignored) { - } - }); - } catch (Exception ex) { - handler.getLogger().error("Could not generate any Tall Bark Door item textures : ", ex); - } - } }