3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-08 17:20:24 +01:00

Only apply the 'Hologram patch' to small entities since it only happens to them.

Only apply the 'Hologram patch' to small entities (Doesn't fix issue but hey)
Dieser Commit ist enthalten in:
Mats 2016-04-04 16:55:48 +02:00 committet von Myles
Ursprung c7c6ee9fbc
Commit 5032e7d07e

Datei anzeigen

@ -143,9 +143,10 @@ public class EntityTracker extends StoredObject {
} }
} }
if (type == EntityType.ARMOR_STAND && ((ViaVersionPlugin) ViaVersion.getInstance()).isHologramPatch()) { if (type == EntityType.ARMOR_STAND && ((ViaVersionPlugin) ViaVersion.getInstance()).isHologramPatch()) {
if (metadata.getId() == 0) { if (metadata.getId() == 0 && getMetaByIndex(metadataList, 10) != null) {
Metadata meta = getMetaByIndex(metadataList, 10); //Only happens if the armorstand is small
byte data = (byte) metadata.getValue(); byte data = (byte) metadata.getValue();
if ((data & 0x20) == 0x20) { if ((data & 0x20) == 0x20 && ((byte) meta.getValue() & 0x01) == 0x01) {
if (!knownHolograms.contains(entityID)) { if (!knownHolograms.contains(entityID)) {
knownHolograms.add(entityID); knownHolograms.add(entityID);
try { try {
@ -200,6 +201,13 @@ public class EntityTracker extends StoredObject {
} }
} }
public Metadata getMetaByIndex(List<Metadata> list, int index) {
for (Metadata meta : list)
if (index == meta.getId())
return meta;
return null;
}
public void sendTeamPacket(boolean b) { public void sendTeamPacket(boolean b) {
PacketWrapper wrapper = new PacketWrapper(0x41, null, getUser()); PacketWrapper wrapper = new PacketWrapper(0x41, null, getUser());
wrapper.write(Type.STRING, "viaversion"); // Use viaversion as name wrapper.write(Type.STRING, "viaversion"); // Use viaversion as name