mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-07 15:38:14 +08:00
SPIGOT-1129: Fix spawning leash hitch without adjacent block
This commit is contained in:
parent
4c43856621
commit
1fe19a83f9
@ -1092,14 +1092,16 @@ public class CraftWorld implements World {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EnumDirection dir = CraftBlock.blockFaceToNotch(face).opposite();
|
if (LeashHitch.class.isAssignableFrom(clazz)) {
|
||||||
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)) {
|
|
||||||
entity = new EntityLeash(world, new BlockPosition((int) x, (int) y, (int) z));
|
entity = new EntityLeash(world, new BlockPosition((int) x, (int) y, (int) z));
|
||||||
entity.attachedToPlayer = true;
|
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()) {
|
if (entity != null && !((EntityHanging) entity).survives()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user