mirror of
https://github.com/NEZNAMY/TAB.git
synced 2026-11-26 10:29:49 -05:00
fixed #56
This commit is contained in:
1 parent
9b209776b2
commit
e013b4ddeb
1 file changed
+20
-2
+20
-2
@@ -75,7 +75,7 @@ public class ArmorStand{
|
||||
if (ProtocolVersion.SERVER_VERSION.getMinorVersion() >= 15) {
|
||||
return new PacketPlayOut[] {
|
||||
new PacketPlayOutSpawnEntityLiving(entityId, uuid, EntityType.ARMOR_STAND, getArmorStandLocationFor(viewer)),
|
||||
new PacketPlayOutEntityMetadata(getEntityId(), dataWatcher)
|
||||
new PacketPlayOutEntityMetadata(entityId, dataWatcher)
|
||||
};
|
||||
} else {
|
||||
return new PacketPlayOut[] {
|
||||
@@ -152,7 +152,7 @@ public class ArmorStand{
|
||||
}
|
||||
public Location getLocation() {
|
||||
double x = player.getLocation().getX();
|
||||
double y = player.getLocation().getY() + yOffset + 2;
|
||||
double y = getY() + yOffset + 2;
|
||||
double z = player.getLocation().getZ();
|
||||
if (player.isSleeping()) {
|
||||
y -= 1.76;
|
||||
@@ -165,6 +165,24 @@ public class ArmorStand{
|
||||
}
|
||||
return new Location(null,x,y,z);
|
||||
}
|
||||
private double getY() {
|
||||
//1.14+ bukkit api bug
|
||||
if (player.getVehicle() != null) {
|
||||
if (player.getVehicle().getType() == EntityType.HORSE) {
|
||||
return player.getVehicle().getLocation().getY() + 0.85;
|
||||
}
|
||||
if (player.getVehicle().getType() == EntityType.DONKEY) {
|
||||
return player.getVehicle().getLocation().getY() + 0.525;
|
||||
}
|
||||
if (player.getVehicle().getType() == EntityType.PIG) {
|
||||
return player.getVehicle().getLocation().getY() + 0.325;
|
||||
}
|
||||
if (player.getVehicle().getType().toString().equals("STRIDER")) { //preventing errors on <1.16
|
||||
return player.getVehicle().getLocation().getY() + 1.15;
|
||||
}
|
||||
}
|
||||
return player.getLocation().getY();
|
||||
}
|
||||
public int getEntityId() {
|
||||
return entityId;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user