mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-02 11:22:01 +01:00
SPIGOT-1129: Fix spawning leash hitch without adjacent block
By: md_5 <git@md-5.net>
This commit is contained in:
parent
a44a8f29d0
commit
acd31bf4fb
@ -1092,14 +1092,16 @@ public class CraftWorld implements World {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
EnumDirection dir = CraftBlock.blockFaceToNotch(face).opposite();
|
||||||
if (Painting.class.isAssignableFrom(clazz)) {
|
if (Painting.class.isAssignableFrom(clazz)) {
|
||||||
entity = new EntityPainting(world, new BlockPosition((int) x, (int) y, (int) z), dir);
|
entity = new EntityPainting(world, new BlockPosition((int) x, (int) y, (int) z), dir);
|
||||||
} else if (ItemFrame.class.isAssignableFrom(clazz)) {
|
} else if (ItemFrame.class.isAssignableFrom(clazz)) {
|
||||||
entity = new EntityItemFrame(world, new BlockPosition((int) x, (int) y, (int) z), dir);
|
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.attachedToPlayer = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entity != null && !((EntityHanging) entity).survives()) {
|
if (entity != null && !((EntityHanging) entity).survives()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user