From 6cd4461eeb506e27ca073fa29ae8698df7a50269 Mon Sep 17 00:00:00 2001 From: pluto7073 <20planetpluto05@gmail.com> Date: Wed, 1 Feb 2023 20:12:03 -0500 Subject: [PATCH] Changed how item settings are given --- .../plutoscoffee/blocks/CoffeeCrop.java | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/main/java/ml/pluto7073/plutoscoffee/blocks/CoffeeCrop.java b/src/main/java/ml/pluto7073/plutoscoffee/blocks/CoffeeCrop.java index 93ee736..fe64fc7 100644 --- a/src/main/java/ml/pluto7073/plutoscoffee/blocks/CoffeeCrop.java +++ b/src/main/java/ml/pluto7073/plutoscoffee/blocks/CoffeeCrop.java @@ -3,20 +3,20 @@ import ml.pluto7073.plutoscoffee.registry.ModItems; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.block.*; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.CropBlock; +import net.minecraft.block.ShapeContext; import net.minecraft.item.ItemConvertible; -import net.minecraft.sound.BlockSoundGroup; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; import net.minecraft.util.shape.VoxelShape; import net.minecraft.world.BlockView; -import net.minecraft.block.Block; public class CoffeeCrop extends CropBlock { private static final VoxelShape[] AGE_TO_SHAPE = new VoxelShape[]{Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 2.0D, 16.0D), Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 3.0D, 16.0D), Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 4.0D, 16.0D), Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 5.0D, 16.0D), Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 6.0D, 16.0D), Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 7.0D, 16.0D), Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 8.0D, 16.0D), Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 9.0D, 16.0D)}; - public CoffeeCrop() { - super(Settings.of(Material.PLANT).noCollision().ticksRandomly().breakInstantly().sounds(BlockSoundGroup.CROP).nonOpaque()); + public CoffeeCrop(Settings settings) { + super(settings); } @Environment(EnvType.CLIENT) @@ -25,12 +25,12 @@ protected ItemConvertible getSeedsItem() { } public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { - return AGE_TO_SHAPE[(Integer)state.get(this.getAgeProperty())]; + return AGE_TO_SHAPE[state.get(this.getAgeProperty())]; } @Override public boolean emitsRedstonePower(BlockState state) { - return true; + return false; } @Override @@ -38,18 +38,9 @@ public boolean hasSidedTransparency(BlockState state) { return true; } - @Override - public int getStrongRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction) { - return 15; - } - @Override public int getOpacity(BlockState state, BlockView world, BlockPos pos) { return 0; } - @Override - public int getWeakRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction) { - return 15; - } }