diff --git a/src/main/java/com/fureniku/metropolis/blocks/decorative/MetroBlockDecorative.java b/src/main/java/com/fureniku/metropolis/blocks/decorative/MetroBlockDecorative.java index aba0b36..91e41d5 100644 --- a/src/main/java/com/fureniku/metropolis/blocks/decorative/MetroBlockDecorative.java +++ b/src/main/java/com/fureniku/metropolis/blocks/decorative/MetroBlockDecorative.java @@ -22,6 +22,10 @@ public MetroBlockDecorative(Properties props, VoxelShape shape, String modelName _modelName = modelName; } + public MetroBlockDecorative(MetroBlockDecorativeBuilder builder) { + this(builder.getProps(), builder.getShape(), builder.getModelName(), builder.getTextures()); + } + @Override protected VoxelShape getShapeFromBlockState(BlockState pState) { return BLOCK_SHAPE; diff --git a/src/main/java/com/fureniku/metropolis/blocks/decorative/MetroBlockDecorativeBuilder.java b/src/main/java/com/fureniku/metropolis/blocks/decorative/MetroBlockDecorativeBuilder.java index 68f2765..07b0702 100644 --- a/src/main/java/com/fureniku/metropolis/blocks/decorative/MetroBlockDecorativeBuilder.java +++ b/src/main/java/com/fureniku/metropolis/blocks/decorative/MetroBlockDecorativeBuilder.java @@ -3,7 +3,6 @@ import com.fureniku.metropolis.datagen.TextureSet; import com.fureniku.metropolis.enums.DecorativeBuilderType; import com.fureniku.metropolis.enums.ToggleType; -import com.fureniku.metropolis.utils.Debug; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; @@ -99,6 +98,21 @@ public MetroBlockDecorativeBuilder setLit() { return this; } + public MetroBlockDecorativeBuilder get() { return this; } + public BlockBehaviour.Properties getProps() { return _props; } + public VoxelShape getShape() { return _blockShape; } + public VoxelShape getShapeToggled() { return _toggledBlockShape; } + public String getModelName() { return _modelName; } + public String getToggledModelName() { return _toggledModelName; } + public ToggleType getToggleType() { return _toggleType; } + public Item getToggleItem() { return _toggleItem; } + public TextureSet[] getTextures() { return _textures; } + + /** + * Internal level build function. Fine to use for any blocks which can just use the metro base classes directly. + * If you are making a derived block, create the builder instance as a separate object and pass it through the super + * @return The created block instance + */ public MetroBlockDecorative build() { switch (_type) { case DECORATIVE: diff --git a/src/main/java/com/fureniku/metropolis/blocks/decorative/MetroBlockDecorativeRotatable.java b/src/main/java/com/fureniku/metropolis/blocks/decorative/MetroBlockDecorativeRotatable.java index f800cc5..f9077ee 100644 --- a/src/main/java/com/fureniku/metropolis/blocks/decorative/MetroBlockDecorativeRotatable.java +++ b/src/main/java/com/fureniku/metropolis/blocks/decorative/MetroBlockDecorativeRotatable.java @@ -40,6 +40,10 @@ public MetroBlockDecorativeRotatable(Properties props, VoxelShape shape, String this.registerDefaultState(this.stateDefinition.any().setValue(DIRECTION, Direction.NORTH)); } + public MetroBlockDecorativeRotatable(MetroBlockDecorativeBuilder builder) { + this(builder.getProps(), builder.getShape(), builder.getModelName(), builder.getTextures()); + } + @Override public void generateBlockState(RegistryObject blockRegistryObject, MetroBlockStateProvider blockStateProvider) { Block block = blockRegistryObject.get(); diff --git a/src/main/java/com/fureniku/metropolis/blocks/decorative/MetroBlockDecorativeRotatableToggle.java b/src/main/java/com/fureniku/metropolis/blocks/decorative/MetroBlockDecorativeRotatableToggle.java index cb038c3..a7c179f 100644 --- a/src/main/java/com/fureniku/metropolis/blocks/decorative/MetroBlockDecorativeRotatableToggle.java +++ b/src/main/java/com/fureniku/metropolis/blocks/decorative/MetroBlockDecorativeRotatableToggle.java @@ -60,6 +60,14 @@ public MetroBlockDecorativeRotatableToggle(Properties props, VoxelShape shape, V _item = item; } + public MetroBlockDecorativeRotatableToggle(MetroBlockDecorativeBuilder builder, Item item) { + this(builder.getProps(), builder.getShape(), builder.getShapeToggled(), builder.getModelName(), builder.getToggledModelName(), item, builder.getTextures()); + } + + public MetroBlockDecorativeRotatableToggle(MetroBlockDecorativeBuilder builder) { + this(builder.getProps(), builder.getShape(), builder.getShapeToggled(), builder.getModelName(), builder.getToggledModelName(), builder.getToggleType(), builder.getTextures()); + } + /** * Constructor for decorative blocks which have a specific shape. This shape is rotated automatically. * @param props diff --git a/src/main/java/com/fureniku/metropolis/blocks/decorative/MetroBlockDecorativeToggle.java b/src/main/java/com/fureniku/metropolis/blocks/decorative/MetroBlockDecorativeToggle.java index b404c9b..1752ffa 100644 --- a/src/main/java/com/fureniku/metropolis/blocks/decorative/MetroBlockDecorativeToggle.java +++ b/src/main/java/com/fureniku/metropolis/blocks/decorative/MetroBlockDecorativeToggle.java @@ -37,6 +37,14 @@ public MetroBlockDecorativeToggle(Properties props, VoxelShape shape, VoxelShape _item = item; } + public MetroBlockDecorativeToggle(MetroBlockDecorativeBuilder builder, Item item) { + this(builder.getProps(), builder.getShape(), builder.getShapeToggled(), builder.getModelName(), builder.getToggledModelName(), item, builder.getTextures()); + } + + public MetroBlockDecorativeToggle(MetroBlockDecorativeBuilder builder) { + this(builder.getProps(), builder.getShape(), builder.getShapeToggled(), builder.getModelName(), builder.getToggledModelName(), builder.getToggleType(), builder.getTextures()); + } + public MetroBlockDecorativeToggle(Properties props, VoxelShape shape, VoxelShape toggledShape, String modelName, String toggledModelName, ToggleType type, TextureSet... textures) { super(props, shape, modelName, textures); BLOCK_SHAPE = shape;