fixed issue with relational placeholders

This commit is contained in:
NEZNAMY committed 2019-12-25 23:04:38 +01:00
1 parent ea34c71201
commit e67a46dfcd
1 file changed
+4 -2
@@ -108,6 +108,8 @@ public class ArmorStand{
synchronized (registeredTo) {
for (ITabPlayer all : registeredTo) {
if (all == owner) continue; //should never be anyway
String displayName = property.get();
if (property.hasRelationalPlaceholders()) displayName = PluginHooks.PlaceholderAPI_setRelationalPlaceholders(owner, all, displayName);
if (all.getVersion().getMinorVersion() >= 14 && !Configs.SECRET_armorstands_always_visible) {
//sneaking feature was removed in 1.14, so despawning completely now
if (sneaking) {
@@ -115,7 +117,7 @@ public class ArmorStand{
} else {
all.sendCustomPacket(getSpawnPacket(all, false));
if (ProtocolVersion.SERVER_VERSION.getMinorVersion() >= 15) {
all.sendPacket(MethodAPI.getInstance().newPacketPlayOutEntityMetadata(getEntityId(), createDataWatcher(property.get(), all).toNMS(), true));
all.sendPacket(MethodAPI.getInstance().newPacketPlayOutEntityMetadata(getEntityId(), createDataWatcher(displayName, all).toNMS(), true));
}
}
} else {
@@ -123,7 +125,7 @@ public class ArmorStand{
all.sendPacket(MethodAPI.getInstance().newPacketPlayOutEntityDestroy(entityId));
all.sendCustomPacket(getSpawnPacket(all, false));
if (ProtocolVersion.SERVER_VERSION.getMinorVersion() >= 15) {
all.sendPacket(MethodAPI.getInstance().newPacketPlayOutEntityMetadata(getEntityId(), createDataWatcher(property.get(), all).toNMS(), true));
all.sendPacket(MethodAPI.getInstance().newPacketPlayOutEntityMetadata(getEntityId(), createDataWatcher(displayName, all).toNMS(), true));
}
}
}