From 236d773d08a3a437f27c0526645ef63f8ed68df1 Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 11 Jun 2023 14:34:11 +0200 Subject: [PATCH] [Feature] Slot for wooden walls --- .../bclib/complexmaterials/set/wood/Wall.java | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/main/java/org/betterx/bclib/complexmaterials/set/wood/Wall.java diff --git a/src/main/java/org/betterx/bclib/complexmaterials/set/wood/Wall.java b/src/main/java/org/betterx/bclib/complexmaterials/set/wood/Wall.java new file mode 100644 index 00000000..16087b10 --- /dev/null +++ b/src/main/java/org/betterx/bclib/complexmaterials/set/wood/Wall.java @@ -0,0 +1,38 @@ +package org.betterx.bclib.complexmaterials.set.wood; + +import org.betterx.bclib.blocks.BaseWallBlock; +import org.betterx.bclib.complexmaterials.ComplexMaterial; +import org.betterx.bclib.complexmaterials.WoodenComplexMaterial; +import org.betterx.bclib.complexmaterials.entry.MaterialSlot; +import org.betterx.bclib.complexmaterials.set.common.AbstractWall; +import org.betterx.bclib.recipes.BCLRecipeBuilder; + +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockBehaviour; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class Wall extends AbstractWall { + @Override + protected @NotNull Block createBlock(WoodenComplexMaterial parentMaterial, BlockBehaviour.Properties settings) { + return new BaseWallBlock.Wood(parentMaterial.getBlock(getSourceBlockSlot())); + } + + @Override + protected @Nullable void makeRecipe(ComplexMaterial parentMaterial, ResourceLocation id) { + BCLRecipeBuilder.crafting(id, parentMaterial.getBlock(suffix)) + .setOutputCount(6) + .setShape("* *", "|||") + .addMaterial('*', parentMaterial.getBlock(WoodSlots.PLANKS)) + .addMaterial('|', parentMaterial.getBlock(WoodSlots.FENCE)) + .setGroup("wall") + .build(); + } + + @Override + protected @Nullable MaterialSlot getSourceBlockSlot() { + return WoodSlots.PLANKS; + } +}