diff --git a/src/main/java/io/github/cottonmc/templates/Templates.java b/src/main/java/io/github/cottonmc/templates/Templates.java index 5a36e52..221defa 100644 --- a/src/main/java/io/github/cottonmc/templates/Templates.java +++ b/src/main/java/io/github/cottonmc/templates/Templates.java @@ -36,41 +36,31 @@ import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import java.util.ArrayList; -import java.util.List; import java.util.function.BiConsumer; public class Templates implements ModInitializer { public static final String MODID = "templates"; - public static final List BLOCKS = new ArrayList<>(); - private static B reg(String id, B block) { - B b = Registry.register(Registries.BLOCK, id(id), block); - BLOCKS.add(b); - return b; - } - private static AbstractBlock.Settings cp(Block base) { return TemplateInteractionUtil.configureSettings(AbstractBlock.Settings.copy(base)); } - public static final Block BUTTON = reg("button", new TemplateButtonBlock(cp(Blocks.OAK_BUTTON))); - public static final Block CANDLE = reg("candle", new TemplateCandleBlock(TemplateCandleBlock.configureSettings(cp(Blocks.CANDLE)))); - public static final Block CARPET = reg("carpet", new TemplateCarpetBlock(cp(Blocks.WHITE_CARPET))); - public static final Block CUBE = reg("cube", new TemplateBlock(TemplateInteractionUtil.makeSettings())); + public static final Block BUTTON = Registry.register(Registries.BLOCK, id("button") , new TemplateButtonBlock(cp(Blocks.OAK_BUTTON))); + public static final Block CANDLE = Registry.register(Registries.BLOCK, id("candle") , new TemplateCandleBlock(TemplateCandleBlock.configureSettings(cp(Blocks.CANDLE)))); + public static final Block CARPET = Registry.register(Registries.BLOCK, id("carpet") , new TemplateCarpetBlock(cp(Blocks.WHITE_CARPET))); + public static final Block CUBE = Registry.register(Registries.BLOCK, id("cube") , new TemplateBlock(TemplateInteractionUtil.makeSettings())); //door? (hard cause its a multiblock) - public static final Block FENCE = reg("fence", new TemplateFenceBlock(cp(Blocks.OAK_FENCE))); - public static final Block FENCE_GATE = reg("fence_gate", new TemplateFenceGateBlock(cp(Blocks.OAK_FENCE_GATE))); - public static final Block LEVER = reg("lever", new TemplateLeverBlock(cp(Blocks.LEVER))); - public static final Block PANE = reg("pane", new TemplatePaneBlock(cp(Blocks.GLASS_PANE))); - public static final Block POST = reg("post", new TemplatePostBlock(cp(Blocks.OAK_FENCE))); - public static final Block PRESSURE_PLATE = reg("pressure_plate", new TemplatePressurePlateBlock(cp(Blocks.OAK_PRESSURE_PLATE))); - public static final Block SLAB = reg("slab", new TemplateSlabBlock(cp(Blocks.OAK_SLAB))); - public static final Block STAIRS = reg("stairs", new TemplateStairsBlock(cp(Blocks.OAK_STAIRS))); - public static final Block TRAPDOOR = reg("trapdoor", new TemplateTrapdoorBlock(cp(Blocks.OAK_TRAPDOOR))); - public static final Block WALL = reg("wall", new TemplateWallBlock(cp(Blocks.COBBLESTONE_WALL))); - - public static final Block SLOPE = reg("slope", new TemplateSlopeBlock(TemplateInteractionUtil.makeSettings())); + 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 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))); + public static final Block POST = Registry.register(Registries.BLOCK, id("post") , new TemplatePostBlock(cp(Blocks.OAK_FENCE))); + public static final Block PRESSURE_PLATE = Registry.register(Registries.BLOCK, id("pressure_plate"), new TemplatePressurePlateBlock(cp(Blocks.OAK_PRESSURE_PLATE))); + public static final Block SLAB = Registry.register(Registries.BLOCK, id("slab") , new TemplateSlabBlock(cp(Blocks.OAK_SLAB))); + public static final Block STAIRS = Registry.register(Registries.BLOCK, id("stairs") , new TemplateStairsBlock(cp(Blocks.OAK_STAIRS))); + public static final Block TRAPDOOR = Registry.register(Registries.BLOCK, id("trapdoor") , new TemplateTrapdoorBlock(cp(Blocks.OAK_TRAPDOOR))); + public static final Block WALL = Registry.register(Registries.BLOCK, id("wall") , new TemplateWallBlock(cp(Blocks.COBBLESTONE_WALL))); + public static final Block SLOPE = Registry.register(Registries.BLOCK, id("slope") , new TemplateSlopeBlock(TemplateInteractionUtil.makeSettings())); //30 degree slope (shallow/deep) //corner slopes //quarter slabs???? @@ -78,7 +68,23 @@ public class Templates implements ModInitializer { //for addon devs: it's fine to make your own block entity type instead of gluing additional blocks to this one public static final BlockEntityType TEMPLATE_BLOCK_ENTITY = Registry.register( Registries.BLOCK_ENTITY_TYPE, id("slope"), - FabricBlockEntityTypeBuilder.create(Templates::makeTemplateBlockEntity, BLOCKS.toArray(new Block[0])).build(null) + FabricBlockEntityTypeBuilder.create(Templates::makeTemplateBlockEntity, + BUTTON, + CANDLE, + CARPET, + CUBE, + FENCE, + FENCE_GATE, + LEVER, + PANE, + POST, + PRESSURE_PLATE, + SLAB, + STAIRS, + TRAPDOOR, + WALL, + SLOPE + ).build(null) ); //Overridden in TemplatesClient @@ -95,10 +101,21 @@ public class Templates implements ModInitializer { .build() ); - for(Block b : BLOCKS) { - Identifier id = Registries.BLOCK.getId(b); - Registry.register(Registries.ITEM, id, new BlockItem(b, new Item.Settings())); - } + Registry.register(Registries.ITEM, id("button") , new BlockItem(BUTTON, new Item.Settings())); + Registry.register(Registries.ITEM, id("candle") , new BlockItem(CANDLE, new Item.Settings())); + Registry.register(Registries.ITEM, id("carpet") , new BlockItem(CARPET, new Item.Settings())); + Registry.register(Registries.ITEM, id("cube") , new BlockItem(CUBE, 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("lever") , new BlockItem(LEVER, new Item.Settings())); + Registry.register(Registries.ITEM, id("pane") , new BlockItem(PANE, new Item.Settings())); + Registry.register(Registries.ITEM, id("post") , new BlockItem(POST, new Item.Settings())); + Registry.register(Registries.ITEM, id("pressure_plate"), new BlockItem(PRESSURE_PLATE, new Item.Settings())); + Registry.register(Registries.ITEM, id("slab") , new BlockItem(SLAB, new Item.Settings())); + Registry.register(Registries.ITEM, id("stairs") , new BlockItem(STAIRS, new Item.Settings())); + Registry.register(Registries.ITEM, id("trapdoor") , new BlockItem(TRAPDOOR, new Item.Settings())); + Registry.register(Registries.ITEM, id("wall") , new BlockItem(WALL, new Item.Settings())); + Registry.register(Registries.ITEM, id("slope") , new BlockItem(SLOPE, new Item.Settings())); } public static Identifier id(String path) { diff --git a/src/main/java/io/github/cottonmc/templates/TemplatesClient.java b/src/main/java/io/github/cottonmc/templates/TemplatesClient.java index 81e0534..fc2bbe7 100644 --- a/src/main/java/io/github/cottonmc/templates/TemplatesClient.java +++ b/src/main/java/io/github/cottonmc/templates/TemplatesClient.java @@ -11,7 +11,6 @@ import net.fabricmc.fabric.api.renderer.v1.Renderer; import net.fabricmc.fabric.api.renderer.v1.RendererAccess; import net.fabricmc.fabric.api.resource.ResourceManagerHelper; import net.fabricmc.fabric.api.resource.SimpleSynchronousResourceReloadListener; -import net.minecraft.block.Block; import net.minecraft.client.MinecraftClient; import net.minecraft.client.render.RenderLayer; import net.minecraft.resource.ResourceManager; @@ -56,72 +55,88 @@ public class TemplatesClient implements ClientModInitializer { ModelLoadingRegistry.INSTANCE.registerResourceProvider(rm -> provider); //block models ModelLoadingRegistry.INSTANCE.registerVariantProvider(rm -> provider); //item models - BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), Templates.BLOCKS.toArray(new Block[0])); + BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), + Templates.BUTTON, + Templates.CANDLE, + Templates.CARPET, + Templates.CUBE, + Templates.FENCE, + Templates.FENCE_GATE, + Templates.LEVER, + Templates.PANE, + Templates.POST, + Templates.PRESSURE_PLATE, + Templates.SLAB, + Templates.STAIRS, + Templates.TRAPDOOR, + Templates.WALL, + Templates.SLOPE + ); //vanilla style models (using "auto" method) - provider.addTemplateModel(Templates.id("button_special"), new UnbakedAutoRetexturedModel(new Identifier("block/button"))); - provider.addTemplateModel(Templates.id("button_pressed_special"), new UnbakedAutoRetexturedModel(new Identifier("block/button_pressed"))); - provider.addTemplateModel(Templates.id("one_candle_special"), new UnbakedAutoRetexturedModel(new Identifier("block/template_candle"))); - provider.addTemplateModel(Templates.id("two_candles_special"), new UnbakedAutoRetexturedModel(new Identifier("block/template_two_candles"))); - provider.addTemplateModel(Templates.id("three_candles_special"), new UnbakedAutoRetexturedModel(new Identifier("block/template_three_candles"))); - provider.addTemplateModel(Templates.id("four_candles_special"), new UnbakedAutoRetexturedModel(new Identifier("block/template_four_candles"))); - provider.addTemplateModel(Templates.id("carpet_special"), new UnbakedAutoRetexturedModel(new Identifier("block/carpet"))); - provider.addTemplateModel(Templates.id("cube_special"), new UnbakedAutoRetexturedModel(new Identifier("block/cube"))); - provider.addTemplateModel(Templates.id("fence_post_special"), new UnbakedAutoRetexturedModel(new Identifier("block/fence_post"))); - provider.addTemplateModel(Templates.id("fence_gate_special"), new UnbakedAutoRetexturedModel(new Identifier("block/template_fence_gate"))); - provider.addTemplateModel(Templates.id("fence_gate_open_special"), new UnbakedAutoRetexturedModel(new Identifier("block/template_fence_gate_open"))); - provider.addTemplateModel(Templates.id("fence_gate_wall_special"), new UnbakedAutoRetexturedModel(new Identifier("block/template_fence_gate_wall"))); - provider.addTemplateModel(Templates.id("fence_gate_wall_open_special"), new UnbakedAutoRetexturedModel(new Identifier("block/template_fence_gate_wall_open"))); - provider.addTemplateModel(Templates.id("glass_pane_post_special"), new UnbakedAutoRetexturedModel(new Identifier("block/glass_pane_post"))); - provider.addTemplateModel(Templates.id("glass_pane_noside_special"), new UnbakedAutoRetexturedModel(new Identifier("block/glass_pane_noside"))); + provider.addTemplateModel(Templates.id("button_special") , new UnbakedAutoRetexturedModel(new Identifier("block/button"))); + provider.addTemplateModel(Templates.id("button_pressed_special") , new UnbakedAutoRetexturedModel(new Identifier("block/button_pressed"))); + provider.addTemplateModel(Templates.id("one_candle_special") , new UnbakedAutoRetexturedModel(new Identifier("block/template_candle"))); + provider.addTemplateModel(Templates.id("two_candles_special") , new UnbakedAutoRetexturedModel(new Identifier("block/template_two_candles"))); + provider.addTemplateModel(Templates.id("three_candles_special") , new UnbakedAutoRetexturedModel(new Identifier("block/template_three_candles"))); + provider.addTemplateModel(Templates.id("four_candles_special") , new UnbakedAutoRetexturedModel(new Identifier("block/template_four_candles"))); + provider.addTemplateModel(Templates.id("carpet_special") , new UnbakedAutoRetexturedModel(new Identifier("block/carpet"))); + provider.addTemplateModel(Templates.id("cube_special") , new UnbakedAutoRetexturedModel(new Identifier("block/cube"))); + provider.addTemplateModel(Templates.id("fence_post_special") , new UnbakedAutoRetexturedModel(new Identifier("block/fence_post"))); + provider.addTemplateModel(Templates.id("fence_gate_special") , new UnbakedAutoRetexturedModel(new Identifier("block/template_fence_gate"))); + provider.addTemplateModel(Templates.id("fence_gate_open_special") , new UnbakedAutoRetexturedModel(new Identifier("block/template_fence_gate_open"))); + provider.addTemplateModel(Templates.id("fence_gate_wall_special") , new UnbakedAutoRetexturedModel(new Identifier("block/template_fence_gate_wall"))); + provider.addTemplateModel(Templates.id("fence_gate_wall_open_special") , new UnbakedAutoRetexturedModel(new Identifier("block/template_fence_gate_wall_open"))); + provider.addTemplateModel(Templates.id("glass_pane_post_special") , new UnbakedAutoRetexturedModel(new Identifier("block/glass_pane_post"))); + provider.addTemplateModel(Templates.id("glass_pane_noside_special") , new UnbakedAutoRetexturedModel(new Identifier("block/glass_pane_noside"))); provider.addTemplateModel(Templates.id("glass_pane_noside_alt_special"), new UnbakedAutoRetexturedModel(new Identifier("block/glass_pane_noside_alt"))); - provider.addTemplateModel(Templates.id("pressure_plate_up_special"), new UnbakedAutoRetexturedModel(new Identifier("block/pressure_plate_up"))); - provider.addTemplateModel(Templates.id("pressure_plate_down_special"), new UnbakedAutoRetexturedModel(new Identifier("block/pressure_plate_down"))); - provider.addTemplateModel(Templates.id("slab_bottom_special"), new UnbakedAutoRetexturedModel(new Identifier("block/slab"))); - provider.addTemplateModel(Templates.id("slab_top_special"), new UnbakedAutoRetexturedModel(new Identifier("block/slab_top"))); - provider.addTemplateModel(Templates.id("stairs_special"), new UnbakedAutoRetexturedModel(new Identifier("block/stairs"))); - provider.addTemplateModel(Templates.id("inner_stairs_special"), new UnbakedAutoRetexturedModel(new Identifier("block/inner_stairs"))); - provider.addTemplateModel(Templates.id("outer_stairs_special"), new UnbakedAutoRetexturedModel(new Identifier("block/outer_stairs"))); - provider.addTemplateModel(Templates.id("trapdoor_bottom_special"), new UnbakedAutoRetexturedModel(new Identifier("block/template_trapdoor_bottom"))); - provider.addTemplateModel(Templates.id("trapdoor_top_special"), new UnbakedAutoRetexturedModel(new Identifier("block/template_trapdoor_top"))); - provider.addTemplateModel(Templates.id("wall_post_special"), new UnbakedAutoRetexturedModel(new Identifier("block/template_wall_post"))); + provider.addTemplateModel(Templates.id("pressure_plate_up_special") , new UnbakedAutoRetexturedModel(new Identifier("block/pressure_plate_up"))); + provider.addTemplateModel(Templates.id("pressure_plate_down_special") , new UnbakedAutoRetexturedModel(new Identifier("block/pressure_plate_down"))); + provider.addTemplateModel(Templates.id("slab_bottom_special") , new UnbakedAutoRetexturedModel(new Identifier("block/slab"))); + provider.addTemplateModel(Templates.id("slab_top_special") , new UnbakedAutoRetexturedModel(new Identifier("block/slab_top"))); + provider.addTemplateModel(Templates.id("stairs_special") , new UnbakedAutoRetexturedModel(new Identifier("block/stairs"))); + provider.addTemplateModel(Templates.id("inner_stairs_special") , new UnbakedAutoRetexturedModel(new Identifier("block/inner_stairs"))); + provider.addTemplateModel(Templates.id("outer_stairs_special") , new UnbakedAutoRetexturedModel(new Identifier("block/outer_stairs"))); + provider.addTemplateModel(Templates.id("trapdoor_bottom_special") , new UnbakedAutoRetexturedModel(new Identifier("block/template_trapdoor_bottom"))); + provider.addTemplateModel(Templates.id("trapdoor_top_special") , new UnbakedAutoRetexturedModel(new Identifier("block/template_trapdoor_top"))); + provider.addTemplateModel(Templates.id("wall_post_special") , new UnbakedAutoRetexturedModel(new Identifier("block/template_wall_post"))); //vanilla style models (using "special-sprite replacement" method) - provider.addTemplateModel(Templates.id("lever_special"), new UnbakedJsonRetexturedModel(Templates.id("block/lever"))); - provider.addTemplateModel(Templates.id("trapdoor_open_special"), new UnbakedJsonRetexturedModel(Templates.id("block/trapdoor_open"))); - provider.addTemplateModel(Templates.id("lever_on_special"), new UnbakedJsonRetexturedModel(Templates.id("block/lever_on"))); + provider.addTemplateModel(Templates.id("lever_special") , new UnbakedJsonRetexturedModel(Templates.id("block/lever"))); + provider.addTemplateModel(Templates.id("trapdoor_open_special") , new UnbakedJsonRetexturedModel(Templates.id("block/trapdoor_open"))); + provider.addTemplateModel(Templates.id("lever_on_special") , new UnbakedJsonRetexturedModel(Templates.id("block/lever_on"))); //these only exist because AutoRetexturedModels don't seem to rotate their textures the right way when rotated from a multipart blockstate - provider.addTemplateModel(Templates.id("fence_side_special"), new UnbakedJsonRetexturedModel(Templates.id("block/fence_side"))); - provider.addTemplateModel(Templates.id("glass_pane_side_special"), new UnbakedJsonRetexturedModel(Templates.id("block/glass_pane_side"))); - provider.addTemplateModel(Templates.id("glass_pane_side_alt_special"), new UnbakedAutoRetexturedModel(Templates.id("block/glass_pane_side_alt"))); - provider.addTemplateModel(Templates.id("wall_side_special"), new UnbakedJsonRetexturedModel(Templates.id("block/wall_side"))); - provider.addTemplateModel(Templates.id("wall_side_tall_special"), new UnbakedJsonRetexturedModel(Templates.id("block/wall_side_tall"))); + provider.addTemplateModel(Templates.id("fence_side_special") , new UnbakedJsonRetexturedModel(Templates.id("block/fence_side"))); + provider.addTemplateModel(Templates.id("glass_pane_side_special") , new UnbakedJsonRetexturedModel(Templates.id("block/glass_pane_side"))); + provider.addTemplateModel(Templates.id("glass_pane_side_alt_special") , new UnbakedAutoRetexturedModel(Templates.id("block/glass_pane_side_alt"))); + provider.addTemplateModel(Templates.id("wall_side_special") , new UnbakedJsonRetexturedModel(Templates.id("block/wall_side"))); + provider.addTemplateModel(Templates.id("wall_side_tall_special") , new UnbakedJsonRetexturedModel(Templates.id("block/wall_side_tall"))); //mesh models - provider.addTemplateModel(Templates.id("slope_special"), new UnbakedMeshRetexturedModel(Templates.id("block/slope_base"), SlopeBaseMesh::makeUpright)); - provider.addTemplateModel(Templates.id("slope_side_special"), new UnbakedMeshRetexturedModel(Templates.id("block/slope_base"), SlopeBaseMesh::makeSide)); + provider.addTemplateModel(Templates.id("slope_special") , new UnbakedMeshRetexturedModel(Templates.id("block/slope_base"), SlopeBaseMesh::makeUpright)); + provider.addTemplateModel(Templates.id("slope_side_special") , new UnbakedMeshRetexturedModel(Templates.id("block/slope_base"), SlopeBaseMesh::makeSide)); //item only models - provider.addTemplateModel(Templates.id("button_inventory_special"), new UnbakedAutoRetexturedModel(new Identifier("block/button_inventory"))); - provider.addTemplateModel(Templates.id("fence_inventory_special"), new UnbakedAutoRetexturedModel(new Identifier("block/fence_inventory"))); - provider.addTemplateModel(Templates.id("fence_post_inventory_special"), new UnbakedAutoRetexturedModel(Templates.id("block/fence_post_inventory"))); - provider.addTemplateModel(Templates.id("wall_inventory_special"), new UnbakedAutoRetexturedModel(new Identifier("block/wall_inventory"))); + provider.addTemplateModel(Templates.id("button_inventory_special") , new UnbakedAutoRetexturedModel(new Identifier("block/button_inventory"))); + provider.addTemplateModel(Templates.id("fence_inventory_special") , new UnbakedAutoRetexturedModel(new Identifier("block/fence_inventory"))); + provider.addTemplateModel(Templates.id("fence_post_inventory_special") , new UnbakedAutoRetexturedModel(Templates.id("block/fence_post_inventory"))); + provider.addTemplateModel(Templates.id("wall_inventory_special") , new UnbakedAutoRetexturedModel(new Identifier("block/wall_inventory"))); //item model assignments (in lieu of models/item/___.json) - provider.assignItemModel(Templates.id("button_inventory_special"), Templates.BUTTON); - provider.assignItemModel(Templates.id("one_candle_special"), Templates.CANDLE); //TODO vanilla uses its own item model - provider.assignItemModel(Templates.id("carpet_special"), Templates.CARPET); - provider.assignItemModel(Templates.id("cube_special"), Templates.CUBE); - provider.assignItemModel(Templates.id("fence_inventory_special"), Templates.FENCE); - provider.assignItemModel(Templates.id("fence_gate_special"), Templates.FENCE_GATE); - provider.assignItemModel(Templates.id("lever_special"), Templates.LEVER); //TODO vanilla uses its own item model + provider.assignItemModel(Templates.id("button_inventory_special") , Templates.BUTTON); + provider.assignItemModel(Templates.id("one_candle_special") , Templates.CANDLE); //TODO vanilla uses its own item model + provider.assignItemModel(Templates.id("carpet_special") , Templates.CARPET); + provider.assignItemModel(Templates.id("cube_special") , Templates.CUBE); + provider.assignItemModel(Templates.id("fence_inventory_special") , Templates.FENCE); + provider.assignItemModel(Templates.id("fence_gate_special") , Templates.FENCE_GATE); + provider.assignItemModel(Templates.id("lever_special") , Templates.LEVER); //TODO vanilla uses its own item model //provider.assignItemModel(Templates.id("glass_pane_side_special"), Templates.PANE); //Done with a regular json model actually - provider.assignItemModel(Templates.id("fence_post_inventory_special"), Templates.POST); - provider.assignItemModel(Templates.id("pressure_plate_up_special"), Templates.PRESSURE_PLATE); - provider.assignItemModel(Templates.id("slope_special"), Templates.SLOPE); - provider.assignItemModel(Templates.id("slab_bottom_special"), Templates.SLAB); - provider.assignItemModel(Templates.id("stairs_special"), Templates.STAIRS); - provider.assignItemModel(Templates.id("trapdoor_bottom_special"), Templates.TRAPDOOR); - provider.assignItemModel(Templates.id("wall_inventory_special"), Templates.WALL); + provider.assignItemModel(Templates.id("fence_post_inventory_special") , Templates.POST); + provider.assignItemModel(Templates.id("pressure_plate_up_special") , Templates.PRESSURE_PLATE); + provider.assignItemModel(Templates.id("slab_bottom_special") , Templates.SLAB); + provider.assignItemModel(Templates.id("stairs_special") , Templates.STAIRS); + provider.assignItemModel(Templates.id("trapdoor_bottom_special") , Templates.TRAPDOOR); + provider.assignItemModel(Templates.id("wall_inventory_special") , Templates.WALL); + provider.assignItemModel(Templates.id("slope_special") , Templates.SLOPE); } } diff --git a/src/main/java/io/github/cottonmc/templates/model/RetexturingBakedModel.java b/src/main/java/io/github/cottonmc/templates/model/RetexturingBakedModel.java index 4f36f40..3054a82 100644 --- a/src/main/java/io/github/cottonmc/templates/model/RetexturingBakedModel.java +++ b/src/main/java/io/github/cottonmc/templates/model/RetexturingBakedModel.java @@ -138,7 +138,7 @@ public abstract class RetexturingBakedModel extends ForwardingBakedModel { //The quad tag numbers were selected so this magic trick works: Direction dir = facePermutation.get(DIRECTIONS[quad.tag() - 1]); - if(ta.hasColor(dir)) quad.color(tint, tint, tint, tint); //TODO: still doesn't cover stuff like grass blocks, leaf blocks, etc + if(ta.hasColor(dir)) quad.color(tint, tint, tint, tint); quad.spriteBake(ta.getSprite(dir), MutableQuadView.BAKE_NORMALIZED | ta.getBakeFlags(dir) | (uvlock ? MutableQuadView.BAKE_LOCK_UV : 0)); @@ -161,7 +161,7 @@ public abstract class RetexturingBakedModel extends ForwardingBakedModel { if(tag == 0) return true; Direction dir = facePermutation.get(DIRECTIONS[quad.tag() - 1]); - if(ta.hasColor(dir)) quad.color(tint, tint, tint, tint); //TODO: still doesn't cover stuff like grass blocks, leaf blocks, etc + if(ta.hasColor(dir)) quad.color(tint, tint, tint, tint); return true; }