summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server
diff options
context:
space:
mode:
authorMeaglin <meaglin.wasabi@gmail.com>2011-02-01 18:06:17 +0100
committerErik Broes <erikbroes@grum.nl>2011-02-13 13:19:51 +0100
commit4a4b67cc425861f377d9575fe52c2053085fac40 (patch)
treecdc692c1923e7c8438c060ce9bc0eb2c53fbc8e1 /src/main/java/net/minecraft/server
parent9715e778526f18dbe9f3e304e6d30beef701ea09 (diff)
downloadcraftbukkit-4a4b67cc425861f377d9575fe52c2053085fac40.tar
craftbukkit-4a4b67cc425861f377d9575fe52c2053085fac40.tar.gz
craftbukkit-4a4b67cc425861f377d9575fe52c2053085fac40.tar.lz
craftbukkit-4a4b67cc425861f377d9575fe52c2053085fac40.tar.xz
craftbukkit-4a4b67cc425861f377d9575fe52c2053085fac40.zip
Implementation of BlockBreakEvent
Diffstat (limited to 'src/main/java/net/minecraft/server')
-rw-r--r--src/main/java/net/minecraft/server/ItemInWorldManager.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/ItemInWorldManager.java b/src/main/java/net/minecraft/server/ItemInWorldManager.java
index f89b0189..5ca0dca1 100644
--- a/src/main/java/net/minecraft/server/ItemInWorldManager.java
+++ b/src/main/java/net/minecraft/server/ItemInWorldManager.java
@@ -1,5 +1,10 @@
package net.minecraft.server;
+// CraftBukkit start
+import org.bukkit.craftbukkit.CraftServer;
+import org.bukkit.event.block.BlockBreakEvent;
+// CraftBukkit end
+
public class ItemInWorldManager {
private World b;
@@ -79,6 +84,21 @@ public class ItemInWorldManager {
}
public boolean c(int i, int j, int k) {
+ //CraftBukkit start
+ if (this.a instanceof EntityPlayer){
+ CraftServer server = ((WorldServer) this.b).getServer();
+ org.bukkit.block.Block block = ((WorldServer) this.b).getWorld().getBlockAt(i, j, k);
+ org.bukkit.entity.Player player = (org.bukkit.entity.Player) this.a.getBukkitEntity();
+
+ BlockBreakEvent event = new BlockBreakEvent(block,player);
+ server.getPluginManager().callEvent(event);
+
+ if (event.isCancelled()){
+ return true;
+ }
+ }
+ //CraftBukkit end
+
int l = this.b.getTypeId(i, j, k);
int i1 = this.b.getData(i, j, k);
boolean flag = this.b(i, j, k);