summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server
diff options
context:
space:
mode:
authorfeildmaster <admin@feildmaster.com>2012-11-22 23:05:27 -0600
committerfeildmaster <admin@feildmaster.com>2012-11-24 01:41:19 -0600
commitaa99d679632a9f8ac6560eced7457f6c72c9adc0 (patch)
treec43d4cb9c32e5b4637e4da6c7e655c16c67f572e /src/main/java/net/minecraft/server
parentcd66edd40f0895c26b2526b507988f27848fc3f3 (diff)
downloadcraftbukkit-aa99d679632a9f8ac6560eced7457f6c72c9adc0.tar
craftbukkit-aa99d679632a9f8ac6560eced7457f6c72c9adc0.tar.gz
craftbukkit-aa99d679632a9f8ac6560eced7457f6c72c9adc0.tar.lz
craftbukkit-aa99d679632a9f8ac6560eced7457f6c72c9adc0.tar.xz
craftbukkit-aa99d679632a9f8ac6560eced7457f6c72c9adc0.zip
Call EntityInteractEvent for Wood Buttons. Fixes BUKKIT-3022
Prior to this, there was no way to tell when arrows trigger buttons
Diffstat (limited to 'src/main/java/net/minecraft/server')
-rw-r--r--src/main/java/net/minecraft/server/BlockButton.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/BlockButton.java b/src/main/java/net/minecraft/server/BlockButton.java
index 908b1ede..ab8bc44f 100644
--- a/src/main/java/net/minecraft/server/BlockButton.java
+++ b/src/main/java/net/minecraft/server/BlockButton.java
@@ -3,7 +3,10 @@ package net.minecraft.server;
import java.util.List;
import java.util.Random;
-import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+// CraftBukkit start
+import org.bukkit.event.block.BlockRedstoneEvent;
+import org.bukkit.event.entity.EntityInteractEvent;
+// CraftBukkit end
public class BlockButton extends Block {
@@ -235,6 +238,14 @@ public class BlockButton extends Block {
if (!world.isStatic) {
if (this.a) {
if ((world.getData(i, j, k) & 8) == 0) {
+ // CraftBukkit start - Call interaction when entities (currently arrows) hit wooden buttons
+ EntityInteractEvent event = new EntityInteractEvent(entity.getBukkitEntity(), world.getWorld().getBlockAt(i, j, k));
+ world.getServer().getPluginManager().callEvent(event);
+
+ if (event.isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
this.o(world, i, j, k);
}
}