output.writeBoolean(compressed);
}
@Override
public void run(int playerId) {
SpoutPlayer player = SpoutManager.getPlayerFromId(playerId);
if (player != null) {
ByteBuffer rawData = ByteBuffer.allocate(data.length);
rawData.put(data);
ArrayList<LivingEntity> entities = new ArrayList<LivingEntity>(data.length / 4 + 1);
for (int i = 0; i < data.length / 4; i++) {
int index = i * 4;
int id = rawData.getInt(index);
Entity entity = SpoutManager.getEntityFromId(id);
if (entity != null && entity instanceof LivingEntity) {
entities.add((LivingEntity) entity);
}
}
if (entities.size() > 0) {
player.sendPacket(new PacketEntityInformation(entities));
player.updateEntitySkins(entities);
}
}
}