summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft
diff options
context:
space:
mode:
authorsunkid <sunkid@iminurnetz.com>2011-09-15 11:07:40 -0700
committerDinnerbone <dinnerbone@dinnerbone.com>2011-09-15 19:24:23 +0100
commitcdbd318bb5bad2c6941377a1d64f42f074c93df2 (patch)
tree6dab0d84178c73299754690c1cc084feca627f04 /src/main/java/net/minecraft
parent9252230e3a2ce6d1169cb96097d2ebc160e3fedb (diff)
downloadcraftbukkit-cdbd318bb5bad2c6941377a1d64f42f074c93df2.tar
craftbukkit-cdbd318bb5bad2c6941377a1d64f42f074c93df2.tar.gz
craftbukkit-cdbd318bb5bad2c6941377a1d64f42f074c93df2.tar.lz
craftbukkit-cdbd318bb5bad2c6941377a1d64f42f074c93df2.tar.xz
craftbukkit-cdbd318bb5bad2c6941377a1d64f42f074c93df2.zip
Fixed missing PlayerInteractEvent call in creative mode
Diffstat (limited to 'src/main/java/net/minecraft')
-rw-r--r--src/main/java/net/minecraft/server/ItemInWorldManager.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/net/minecraft/server/ItemInWorldManager.java b/src/main/java/net/minecraft/server/ItemInWorldManager.java
index dc575f44..674f8ee9 100644
--- a/src/main/java/net/minecraft/server/ItemInWorldManager.java
+++ b/src/main/java/net/minecraft/server/ItemInWorldManager.java
@@ -82,20 +82,23 @@ public class ItemInWorldManager {
public void dig(int i, int j, int k, int l) {
// this.world.douseFire((EntityHuman) null, i, j, k, l); // CraftBukkit - moved down
+ // CraftBukkit start
+ PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_BLOCK, i, j, k, l, this.player.inventory.getItemInHand());
+
if (this.b()) {
+ if (event.isCancelled()) {
+ return;
+ }
this.c(i, j, k);
} else {
this.lastDigTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit
int i1 = this.world.getTypeId(i, j, k);
- // CraftBukkit start
// Swings at air do *NOT* exist.
if (i1 <= 0) {
return;
}
- PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_BLOCK, i, j, k, l, this.player.inventory.getItemInHand());
-
if (event.useInteractedBlock() == Event.Result.DENY) {
// If we denied a door from opening, we need to send a correcting update to the client, as it already opened the door.
if (i1 == Block.WOODEN_DOOR.id) {