Update to Minecraft 1.18-pre5

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-11-22 09:00:00 +11:00
parent a852b81a69
commit 43702a9e10
700 changed files with 10286 additions and 10098 deletions

View File

@@ -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;
}