aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/CactusBlock.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/CactusBlock.java.patch')
-rw-r--r--patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/CactusBlock.java.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/CactusBlock.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/CactusBlock.java.patch
new file mode 100644
index 0000000000..b1cf4e1b6a
--- /dev/null
+++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/CactusBlock.java.patch
@@ -0,0 +1,43 @@
+--- a/net/minecraft/world/level/block/CactusBlock.java
++++ b/net/minecraft/world/level/block/CactusBlock.java
+@@ -20,6 +21,7 @@
+ import net.minecraft.world.level.pathfinder.PathComputationType;
+ import net.minecraft.world.phys.shapes.CollisionContext;
+ import net.minecraft.world.phys.shapes.VoxelShape;
++import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
+ public class CactusBlock extends Block {
+ public static final MapCodec<CactusBlock> CODEC = simpleCodec(CactusBlock::new);
+@@ -57,12 +62,14 @@
+ }
+
+ if (i < 3) {
+- int i1 = state.getValue(AGE);
+- if (i1 == 15) {
+- level.setBlockAndUpdate(blockPos, this.defaultBlockState());
+- BlockState blockState = state.setValue(AGE, Integer.valueOf(0));
+- level.setBlock(pos, blockState, 4);
+- level.neighborChanged(blockState, blockPos, this, pos, false);
++ int j = (Integer) state.getValue(CactusBlock.AGE);
++
++ if (j == 15) {
++ CraftEventFactory.handleBlockGrowEvent(level, blockposition1, this.defaultBlockState()); // CraftBukkit
++ IBlockData iblockdata1 = (IBlockData) state.setValue(CactusBlock.AGE, 0);
++
++ level.setBlock(pos, iblockdata1, 4);
++ level.neighborChanged(iblockdata1, blockposition1, this, pos, false);
+ } else {
+ level.setBlock(pos, state.setValue(AGE, Integer.valueOf(i1 + 1)), 4);
+ }
+@@ -103,8 +119,10 @@
+ }
+
+ @Override
+- public void entityInside(BlockState state, Level level, BlockPos pos, Entity entity) {
++ public void entityInside(IBlockData state, Level level, BlockPos pos, Entity entity) {
++ CraftEventFactory.blockDamage = level.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()); // CraftBukkit
+ entity.hurt(level.damageSources().cactus(), 1.0F);
++ CraftEventFactory.blockDamage = null; // CraftBukkit
+ }
+
+ @Override