[Feature] Slot for wooden walls

This commit is contained in:
Frank 2023-06-11 14:34:11 +02:00
parent 8fddd5bb79
commit 236d773d08

View file

@ -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<WoodenComplexMaterial> {
@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<WoodenComplexMaterial> getSourceBlockSlot() {
return WoodSlots.PLANKS;
}
}