SPIGOT-1608: Add a way to get the hand used in PlayerInteract*Events

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2016-03-04 15:24:51 +11:00
parent f668c8bc0e
commit a15545299d
10 changed files with 60 additions and 58 deletions

View File

@@ -35,7 +35,7 @@
+ // CraftBukkit start - Interact soil
+ org.bukkit.event.Cancellable cancellable;
+ if (entity instanceof EntityHuman) {
+ cancellable = CraftEventFactory.callPlayerInteractEvent((EntityHuman) entity, org.bukkit.event.block.Action.PHYSICAL, blockposition, null, null);
+ cancellable = CraftEventFactory.callPlayerInteractEvent((EntityHuman) entity, org.bukkit.event.block.Action.PHYSICAL, blockposition, null, null, null);
+ } else {
+ cancellable = new EntityInteractEvent(entity.getBukkitEntity(), world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()));
+ world.getServer().getPluginManager().callEvent((EntityInteractEvent) cancellable);