aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower/net/minecraft/world/level/block/NetherWartBlock.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower/net/minecraft/world/level/block/NetherWartBlock.java.patch')
-rw-r--r--patch-remap/mache-vineflower/net/minecraft/world/level/block/NetherWartBlock.java.patch87
1 files changed, 87 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower/net/minecraft/world/level/block/NetherWartBlock.java.patch b/patch-remap/mache-vineflower/net/minecraft/world/level/block/NetherWartBlock.java.patch
new file mode 100644
index 0000000000..efe2163707
--- /dev/null
+++ b/patch-remap/mache-vineflower/net/minecraft/world/level/block/NetherWartBlock.java.patch
@@ -0,0 +1,87 @@
+--- a/net/minecraft/world/level/block/NetherWartBlock.java
++++ b/net/minecraft/world/level/block/NetherWartBlock.java
+@@ -9,7 +9,7 @@
+ import net.minecraft.world.level.BlockGetter;
+ import net.minecraft.world.level.LevelReader;
+ import net.minecraft.world.level.block.state.BlockBehaviour;
+-import net.minecraft.world.level.block.state.BlockState;
++import net.minecraft.world.level.block.state.IBlockData;
+ import net.minecraft.world.level.block.state.StateDefinition;
+ import net.minecraft.world.level.block.state.properties.BlockStateProperties;
+ import net.minecraft.world.level.block.state.properties.IntegerProperty;
+@@ -17,57 +17,55 @@
+ import net.minecraft.world.phys.shapes.VoxelShape;
+
+ public class NetherWartBlock extends BushBlock {
++
+ public static final MapCodec<NetherWartBlock> CODEC = simpleCodec(NetherWartBlock::new);
+ public static final int MAX_AGE = 3;
+ public static final IntegerProperty AGE = BlockStateProperties.AGE_3;
+- private static final VoxelShape[] SHAPE_BY_AGE = new VoxelShape[]{
+- Block.box(0.0, 0.0, 0.0, 16.0, 5.0, 16.0),
+- Block.box(0.0, 0.0, 0.0, 16.0, 8.0, 16.0),
+- Block.box(0.0, 0.0, 0.0, 16.0, 11.0, 16.0),
+- Block.box(0.0, 0.0, 0.0, 16.0, 14.0, 16.0)
+- };
++ private static final VoxelShape[] SHAPE_BY_AGE = new VoxelShape[]{Block.box(0.0D, 0.0D, 0.0D, 16.0D, 5.0D, 16.0D), Block.box(0.0D, 0.0D, 0.0D, 16.0D, 8.0D, 16.0D), Block.box(0.0D, 0.0D, 0.0D, 16.0D, 11.0D, 16.0D), Block.box(0.0D, 0.0D, 0.0D, 16.0D, 14.0D, 16.0D)};
+
+ @Override
+ public MapCodec<NetherWartBlock> codec() {
+- return CODEC;
++ return NetherWartBlock.CODEC;
+ }
+
+ protected NetherWartBlock(BlockBehaviour.Properties properties) {
+ super(properties);
+- this.registerDefaultState(this.stateDefinition.any().setValue(AGE, Integer.valueOf(0)));
++ this.registerDefaultState((IBlockData) ((IBlockData) this.stateDefinition.any()).setValue(NetherWartBlock.AGE, 0));
+ }
+
+ @Override
+- public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
+- return SHAPE_BY_AGE[state.getValue(AGE)];
++ public VoxelShape getShape(IBlockData state, BlockGetter level, BlockPos pos, CollisionContext context) {
++ return NetherWartBlock.SHAPE_BY_AGE[(Integer) state.getValue(NetherWartBlock.AGE)];
+ }
+
+ @Override
+- protected boolean mayPlaceOn(BlockState state, BlockGetter level, BlockPos pos) {
++ protected boolean mayPlaceOn(IBlockData state, BlockGetter level, BlockPos pos) {
+ return state.is(Blocks.SOUL_SAND);
+ }
+
+ @Override
+- public boolean isRandomlyTicking(BlockState state) {
+- return state.getValue(AGE) < 3;
++ public boolean isRandomlyTicking(IBlockData state) {
++ return (Integer) state.getValue(NetherWartBlock.AGE) < 3;
+ }
+
+ @Override
+- public void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) {
+- int i = state.getValue(AGE);
++ public void randomTick(IBlockData state, ServerLevel level, BlockPos pos, RandomSource random) {
++ int i = (Integer) state.getValue(NetherWartBlock.AGE);
++
+ if (i < 3 && random.nextInt(10) == 0) {
+- state = state.setValue(AGE, Integer.valueOf(i + 1));
+- level.setBlock(pos, state, 2);
++ state = (IBlockData) state.setValue(NetherWartBlock.AGE, i + 1);
++ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(level, pos, state, 2); // CraftBukkit
+ }
++
+ }
+
+ @Override
+- public ItemStack getCloneItemStack(LevelReader levelReader, BlockPos blockPos, BlockState blockState) {
++ public ItemStack getCloneItemStack(LevelReader iworldreader, BlockPos blockposition, IBlockData iblockdata) {
+ return new ItemStack(Items.NETHER_WART);
+ }
+
+ @Override
+- protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
+- builder.add(AGE);
++ protected void createBlockStateDefinition(StateDefinition.Builder<Block, IBlockData> builder) {
++ builder.add(NetherWartBlock.AGE);
+ }
+ }