Modify the painting spawn packet to match the changes

This commit is contained in:
libraryaddict 2013-11-24 08:43:36 +13:00
parent bfd2b1b329
commit 42cac092f6
2 changed files with 8 additions and 9 deletions

@ -143,6 +143,10 @@ public class FlagWatcher {
return armor; return armor;
} }
protected Disguise getDisguise() {
return disguise;
}
private boolean getFlag(int i) { private boolean getFlag(int i) {
return ((Byte) getValue(0, (byte) 0) & 1 << i) != 0; return ((Byte) getValue(0, (byte) 0) & 1 << i) != 0;
} }
@ -317,10 +321,6 @@ public class FlagWatcher {
sendData(0); sendData(0);
} }
protected Disguise getDisguise() {
return disguise;
}
protected void setValue(int no, Object value) { protected void setValue(int no, Object value) {
entityValues.put(no, value); entityValues.put(no, value);
} }

@ -178,9 +178,7 @@ public class PacketsManager {
mods.write(3, loc.getBlockZ()); mods.write(3, loc.getBlockZ());
mods.write(4, ((int) loc.getYaw()) % 4); mods.write(4, ((int) loc.getYaw()) % 4);
int id = ((MiscDisguise) disguise).getData(); int id = ((MiscDisguise) disguise).getData();
if (id == -1) mods.write(5, ReflectionManager.getEnumArt(Art.values()[id]));
id = new Random().nextInt(Art.values().length);
mods.write(5, ReflectionManager.getEnumArt(Art.values()[id % Art.values().length]));
// Make the teleport packet to make it visible.. // Make the teleport packet to make it visible..
spawnPackets[1] = new PacketContainer(Packets.Server.ENTITY_TELEPORT); spawnPackets[1] = new PacketContainer(Packets.Server.ENTITY_TELEPORT);
@ -257,10 +255,11 @@ public class PacketsManager {
int id = disguise.getType().getEntityId(); int id = disguise.getType().getEntityId();
int data = 0; int data = 0;
if (((MiscDisguise) disguise).getId() >= 0) { if (((MiscDisguise) disguise).getId() >= 0) {
if (((MiscDisguise) disguise).getData() >= 0) if (((MiscDisguise) disguise).getData() >= 0) {
data = (((MiscDisguise) disguise).getId() | ((MiscDisguise) disguise).getData() << 16); data = (((MiscDisguise) disguise).getId() | ((MiscDisguise) disguise).getData() << 16);
else } else {
data = ((MiscDisguise) disguise).getId(); data = ((MiscDisguise) disguise).getId();
}
} }
// This won't actually work. // This won't actually work.
// But if someone constructing the disguise uses it properly. It will work. // But if someone constructing the disguise uses it properly. It will work.