geforkt von Mirrors/Paper
SPIGOT-240: Fire physics events for crops dying.
Dieser Commit ist enthalten in:
Ursprung
bc03b6f017
Commit
bae259e302
27
nms-patches/BlockPlant.patch
Normale Datei
27
nms-patches/BlockPlant.patch
Normale Datei
@ -0,0 +1,27 @@
|
|||||||
|
--- ../work/decompile-8eb82bde/net/minecraft/server/BlockPlant.java 2015-01-31 10:09:14.372634430 +1100
|
||||||
|
+++ src/main/java/net/minecraft/server/BlockPlant.java 2015-01-31 10:09:14.372634430 +1100
|
||||||
|
@@ -1,6 +1,8 @@
|
||||||
|
package net.minecraft.server;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
+import org.bukkit.craftbukkit.util.CraftMagicNumbers;
|
||||||
|
+import org.bukkit.event.block.BlockPhysicsEvent;
|
||||||
|
|
||||||
|
public class BlockPlant extends Block {
|
||||||
|
|
||||||
|
@@ -36,6 +38,15 @@
|
||||||
|
|
||||||
|
protected void e(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
||||||
|
if (!this.f(world, blockposition, iblockdata)) {
|
||||||
|
+ // CraftBukkit Start
|
||||||
|
+ org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||||
|
+ BlockPhysicsEvent event = new BlockPhysicsEvent(block, block.getTypeId());
|
||||||
|
+ world.getServer().getPluginManager().callEvent(event);
|
||||||
|
+
|
||||||
|
+ if (event.isCancelled()) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ // CraftBukkit end
|
||||||
|
this.b(world, blockposition, iblockdata, 0);
|
||||||
|
world.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 3);
|
||||||
|
}
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren