Fix crashes as reported by andrewkm

This commit is contained in:
libraryaddict
2014-01-31 22:56:05 +13:00
parent 6c6d6c6fe2
commit a3297c918b
2 changed files with 41 additions and 23 deletions

View File

@@ -1118,7 +1118,7 @@ public class PacketsManager {
/**
* Transform the packet magically into the one I have always dreamed off. My true luv!!!
*/
private static PacketContainer[] transformPacket(PacketContainer sentPacket, Player observer) {
public static PacketContainer[] transformPacket(PacketContainer sentPacket, Player observer) {
PacketContainer[] packets = new PacketContainer[] { sentPacket };
try {
// First get the entity, the one sending this packet
@@ -1229,7 +1229,8 @@ public class PacketsManager {
for (WrappedWatchableObject watcher : packetUnblock.getWatchableCollectionModifier().read(0)) {
watcher.setValue((byte) ((Byte) watcher.getValue() & ~(1 << 4)));
}
// Send the unblock before the itemstack change so that the 2nd metadata packet works. Why? Scheduler delay.
// Send the unblock before the itemstack change so that the 2nd metadata packet works. Why? Scheduler
// delay.
packets = new PacketContainer[] { packetUnblock, packets[0], packetBlock };
// Silly mojang made the right clicking datawatcher value only valid for one use. So I have to reset
// it.