diff --git a/src/main/java/org/betterx/bclib/blocks/BaseBookshelfBlock.java b/src/main/java/org/betterx/bclib/blocks/BaseBookshelfBlock.java index 67b2546d..6288e387 100644 --- a/src/main/java/org/betterx/bclib/blocks/BaseBookshelfBlock.java +++ b/src/main/java/org/betterx/bclib/blocks/BaseBookshelfBlock.java @@ -26,6 +26,22 @@ import java.util.Optional; import org.jetbrains.annotations.Nullable; public class BaseBookshelfBlock extends BaseBlock { + public static class WithVanillaWood extends BaseBookshelfBlock { + public WithVanillaWood(Block source) { + super(source); + } + + @Override + @Environment(EnvType.CLIENT) + public @Nullable BlockModel getBlockModel(ResourceLocation blockId, BlockState blockState) { + Optional pattern = PatternsHelper.createJson( + BasePatterns.VANILLA_WOOD_BOOKSHELF, + replacePath(blockId) + ); + return ModelsHelper.fromPattern(pattern); + } + } + public BaseBookshelfBlock(Block source) { this(FabricBlockSettings.copyOf(source)); } @@ -53,7 +69,7 @@ public class BaseBookshelfBlock extends BaseBlock { return ModelsHelper.fromPattern(pattern); } - private ResourceLocation replacePath(ResourceLocation blockId) { + protected ResourceLocation replacePath(ResourceLocation blockId) { String newPath = blockId.getPath().replace("_bookshelf", ""); return new ResourceLocation(blockId.getNamespace(), newPath); } diff --git a/src/main/java/org/betterx/bclib/client/models/BasePatterns.java b/src/main/java/org/betterx/bclib/client/models/BasePatterns.java index 344ab807..db14c841 100644 --- a/src/main/java/org/betterx/bclib/client/models/BasePatterns.java +++ b/src/main/java/org/betterx/bclib/client/models/BasePatterns.java @@ -59,4 +59,6 @@ public class BasePatterns { public final static ResourceLocation ITEM_HANDHELD = BCLib.makeID("patterns/item/pattern_item_handheld.json"); public final static ResourceLocation ITEM_SPAWN_EGG = BCLib.makeID("patterns/item/pattern_item_spawn_egg.json"); + public final static ResourceLocation VANILLA_WOOD_BOOKSHELF = BCLib.makeID( + "patterns/block/vanilla_wood_bookshelf.json"); } diff --git a/src/main/java/org/betterx/bclib/complexmaterials/WoodenComplexMaterial.java b/src/main/java/org/betterx/bclib/complexmaterials/WoodenComplexMaterial.java index 954c73b5..519aebb3 100644 --- a/src/main/java/org/betterx/bclib/complexmaterials/WoodenComplexMaterial.java +++ b/src/main/java/org/betterx/bclib/complexmaterials/WoodenComplexMaterial.java @@ -215,7 +215,7 @@ public class WoodenComplexMaterial extends ComplexMaterial { .setItemTags(CommonItemTags.BARREL, CommonItemTags.WOODEN_BARREL)); } - final protected void initDecorations(FabricBlockSettings blockSettings, FabricItemSettings itemSettings) { + protected void initDecorations(FabricBlockSettings blockSettings, FabricItemSettings itemSettings) { addBlockEntry(new BlockEntry( BLOCK_CRAFTING_TABLE, (cmx, settings) -> new BaseCraftingTableBlock(getBlock(BLOCK_PLANKS)) diff --git a/src/main/resources/assets/bclib/patterns/block/vanilla_wood_bookshelf.json b/src/main/resources/assets/bclib/patterns/block/vanilla_wood_bookshelf.json new file mode 100644 index 00000000..f2305f1a --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/vanilla_wood_bookshelf.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "end": "minecraft:block/%texture%_planks", + "side": "%modid%:block/%texture%_bookshelf" + } +} \ No newline at end of file