2021-03-16 09:00:00 +11:00
|
|
|
--- a/net/minecraft/world/level/block/BlockCactus.java
|
|
|
|
+++ b/net/minecraft/world/level/block/BlockCactus.java
|
2023-12-06 03:40:00 +11:00
|
|
|
@@ -22,6 +22,8 @@
|
2021-03-16 09:00:00 +11:00
|
|
|
import net.minecraft.world.phys.shapes.VoxelShape;
|
|
|
|
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
2014-11-26 08:32:16 +11:00
|
|
|
|
|
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
|
|
|
+
|
|
|
|
public class BlockCactus extends Block {
|
|
|
|
|
2023-12-06 03:40:00 +11:00
|
|
|
public static final MapCodec<BlockCactus> CODEC = simpleCodec(BlockCactus::new);
|
|
|
|
@@ -64,7 +66,7 @@
|
2021-11-22 09:00:00 +11:00
|
|
|
int j = (Integer) iblockdata.getValue(BlockCactus.AGE);
|
2014-12-11 00:13:27 +00:00
|
|
|
|
2020-06-25 10:00:00 +10:00
|
|
|
if (j == 15) {
|
2021-11-22 09:00:00 +11:00
|
|
|
- worldserver.setBlockAndUpdate(blockposition1, this.defaultBlockState());
|
|
|
|
+ CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition1, this.defaultBlockState()); // CraftBukkit
|
|
|
|
IBlockData iblockdata1 = (IBlockData) iblockdata.setValue(BlockCactus.AGE, 0);
|
2014-11-26 08:32:16 +11:00
|
|
|
|
2021-11-22 09:00:00 +11:00
|
|
|
worldserver.setBlock(blockposition, iblockdata1, 4);
|
2024-02-11 09:54:25 +11:00
|
|
|
@@ -119,7 +121,7 @@
|
2014-11-26 08:32:16 +11:00
|
|
|
|
2019-04-23 12:00:00 +10:00
|
|
|
@Override
|
2024-04-24 01:15:00 +10:00
|
|
|
protected void entityInside(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
2024-02-11 09:54:25 +11:00
|
|
|
- entity.hurt(world.damageSources().cactus(), 1.0F);
|
|
|
|
+ entity.hurt(world.damageSources().cactus().directBlock(world, blockposition), 1.0F); // CraftBukkit
|
2014-11-26 08:32:16 +11:00
|
|
|
}
|
|
|
|
|
2019-04-23 12:00:00 +10:00
|
|
|
@Override
|