public void b(int i, Object object) { WatchableObject watchableobject = (WatchableObject) this.b.get(Integer.valueOf(i)); if (!object.equals(watchableobject.b())) { watchableobject.a(object); watchableobject.a(true); this.c = true; } }
private static void a(DataOutputStream dataoutputstream, WatchableObject watchableobject) { int i = (watchableobject.c() << 5 | watchableobject.a() & 31) & 255; dataoutputstream.writeByte(i); switch (watchableobject.c()) { case 0: dataoutputstream.writeByte(((Byte) watchableobject.b()).byteValue()); break; case 1: dataoutputstream.writeShort(((Short) watchableobject.b()).shortValue()); break; case 2: dataoutputstream.writeInt(((Integer) watchableobject.b()).intValue()); break; case 3: dataoutputstream.writeFloat(((Float) watchableobject.b()).floatValue()); break; case 4: Packet.a((String) watchableobject.b(), dataoutputstream); break; case 5: ItemStack itemstack = (ItemStack) watchableobject.b(); dataoutputstream.writeShort(itemstack.getItem().id); dataoutputstream.writeByte(itemstack.count); dataoutputstream.writeShort(itemstack.getData()); break; case 6: ChunkCoordinates chunkcoordinates = (ChunkCoordinates) watchableobject.b(); dataoutputstream.writeInt(chunkcoordinates.x); dataoutputstream.writeInt(chunkcoordinates.y); dataoutputstream.writeInt(chunkcoordinates.z); } }
public ArrayList b() { ArrayList arraylist = null; if (this.c) { Iterator iterator = this.b.values().iterator(); while (iterator.hasNext()) { WatchableObject watchableobject = (WatchableObject) iterator.next(); if (watchableobject.d()) { watchableobject.a(false); if (arraylist == null) { arraylist = new ArrayList(); } arraylist.add(watchableobject); } } } this.c = false; return arraylist; }