@@ -12,18 +12,18 @@
|
||||
@@ -55,9 +57,25 @@
|
||||
if (entityinsentient.getLeashHolder() == entityhuman) {
|
||||
if (entityleash == null) {
|
||||
entityleash = EntityLeash.b(world, blockposition);
|
||||
entityleash = EntityLeash.getOrCreateKnot(world, blockposition);
|
||||
+
|
||||
+ // CraftBukkit start - fire HangingPlaceEvent
|
||||
+ HangingPlaceEvent event = new HangingPlaceEvent((org.bukkit.entity.Hanging) entityleash.getBukkitEntity(), entityhuman != null ? (org.bukkit.entity.Player) entityhuman.getBukkitEntity() : null, world.getWorld().getBlockAt(i, j, k), org.bukkit.block.BlockFace.SELF);
|
||||
+ world.getCraftServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (event.isCancelled()) {
|
||||
+ entityleash.die();
|
||||
+ entityleash.discard();
|
||||
+ return EnumInteractionResult.PASS;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
entityleash.playPlaceSound();
|
||||
entityleash.playPlacementSound();
|
||||
}
|
||||
|
||||
+ // CraftBukkit start
|
||||
@@ -32,6 +32,6 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
entityinsentient.setLeashHolder(entityleash, true);
|
||||
entityinsentient.setLeashedTo(entityleash, true);
|
||||
flag = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user