mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-18 08:36:13 +01:00
33 lines
1.3 KiB
Diff
33 lines
1.3 KiB
Diff
--- a/net/minecraft/server/BlockSweetBerryBush.java
|
|
+++ b/net/minecraft/server/BlockSweetBerryBush.java
|
|
@@ -1,6 +1,10 @@
|
|
package net.minecraft.server;
|
|
|
|
import java.util.Random;
|
|
+// CraftBukkit start
|
|
+import org.bukkit.craftbukkit.block.CraftBlock;
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
|
+// CraftBukkit end
|
|
|
|
public class BlockSweetBerryBush extends BlockPlant implements IBlockFragilePlantElement {
|
|
|
|
@@ -24,7 +28,7 @@
|
|
int i = (Integer) iblockdata.get(BlockSweetBerryBush.a);
|
|
|
|
if (i < 3 && random.nextInt(5) == 0 && worldserver.getLightLevel(blockposition.up(), 0) >= 9) {
|
|
- worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockSweetBerryBush.a, i + 1), 2);
|
|
+ CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, (IBlockData) iblockdata.set(BlockSweetBerryBush.a, i + 1), 2); // CraftBukkit
|
|
}
|
|
|
|
}
|
|
@@ -38,7 +42,9 @@
|
|
double d1 = Math.abs(entity.locZ() - entity.G);
|
|
|
|
if (d0 >= 0.003000000026077032D || d1 >= 0.003000000026077032D) {
|
|
+ CraftEventFactory.blockDamage = CraftBlock.at(world, blockposition); // CraftBukkit
|
|
entity.damageEntity(DamageSource.SWEET_BERRY_BUSH, 1.0F);
|
|
+ CraftEventFactory.blockDamage = null; // CraftBukkit
|
|
}
|
|
}
|
|
|