summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorEvilSeph <evilseph@unaligned.org>2011-05-02 04:30:51 -0400
committerEvilSeph <evilseph@unaligned.org>2011-05-02 04:30:51 -0400
commitbf1f5b00d7c8cb078adc7528f2a3d85561ca09f6 (patch)
tree90afb48e979a4de168c6fc8bcb0bc87d001075ae /src/main
parentfdb077e814932d55111b9d60746a7a95306ce57a (diff)
downloadcraftbukkit-bf1f5b00d7c8cb078adc7528f2a3d85561ca09f6.tar
craftbukkit-bf1f5b00d7c8cb078adc7528f2a3d85561ca09f6.tar.gz
craftbukkit-bf1f5b00d7c8cb078adc7528f2a3d85561ca09f6.tar.lz
craftbukkit-bf1f5b00d7c8cb078adc7528f2a3d85561ca09f6.tar.xz
craftbukkit-bf1f5b00d7c8cb078adc7528f2a3d85561ca09f6.zip
Added PlayerInteractEntityEvent which fires when a player right clicks an entity. Thanks fullwall!
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/net/minecraft/server/NetServerHandler.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java
index 8a9ab5f6..6cee628b 100644
--- a/src/main/java/net/minecraft/server/NetServerHandler.java
+++ b/src/main/java/net/minecraft/server/NetServerHandler.java
@@ -798,6 +798,13 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
if (entity != null && this.player.e(entity) && this.player.f(entity) < 4.0F) {
if (packet7useentity.c == 0) {
+ // CraftBukkit start
+ PlayerInteractEntityEvent piee = new PlayerInteractEntityEvent((Player) getPlayer(), entity.getBukkitEntity());
+ server.getPluginManager().callEvent(piee);
+ if (piee.isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
this.player.c(entity);
} else if (packet7useentity.c == 1) {
this.player.d(entity);