From 1fe19a83f9c0cf8a4fb4b51bdd85b583dda7df8c Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 30 Jun 2016 13:21:22 +1000 Subject: [PATCH] SPIGOT-1129: Fix spawning leash hitch without adjacent block --- .../java/org/bukkit/craftbukkit/CraftWorld.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 2fe3eae868..47a050e572 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1092,14 +1092,16 @@ public class CraftWorld implements World { } } - EnumDirection dir = CraftBlock.blockFaceToNotch(face).opposite(); - if (Painting.class.isAssignableFrom(clazz)) { - entity = new EntityPainting(world, new BlockPosition((int) x, (int) y, (int) z), dir); - } else if (ItemFrame.class.isAssignableFrom(clazz)) { - entity = new EntityItemFrame(world, new BlockPosition((int) x, (int) y, (int) z), dir); - } else if (LeashHitch.class.isAssignableFrom(clazz)) { + if (LeashHitch.class.isAssignableFrom(clazz)) { entity = new EntityLeash(world, new BlockPosition((int) x, (int) y, (int) z)); entity.attachedToPlayer = true; + } else { + EnumDirection dir = CraftBlock.blockFaceToNotch(face).opposite(); + if (Painting.class.isAssignableFrom(clazz)) { + entity = new EntityPainting(world, new BlockPosition((int) x, (int) y, (int) z), dir); + } else if (ItemFrame.class.isAssignableFrom(clazz)) { + entity = new EntityItemFrame(world, new BlockPosition((int) x, (int) y, (int) z), dir); + } } if (entity != null && !((EntityHanging) entity).survives()) {