use of icbm.classic.lib.network.packet.PacketTile in project ICBM-Classic by BuiltBrokenModding.
the class TileRadarStation method getGUIPacket.
@Override
protected PacketTile getGUIPacket() {
PacketTile packet = new PacketTile("gui", GUI_PACKET_ID, this);
packet.write(alarmRange);
packet.write(safetyRange);
packet.write(getFrequency());
packet.write(detectedEntities.size());
if (detectedEntities.size() > 0) {
for (Entity entity : detectedEntities) {
if (entity != null && entity.isEntityAlive()) {
packet.write(entity.getEntityId());
int type = RadarObjectType.OTHER.ordinal();
if (entity instanceof EntityMissile) {
type = isMissileGoingToHit((EntityMissile) entity) ? RadarObjectType.MISSILE_IMPACT.ordinal() : RadarObjectType.MISSILE.ordinal();
}
packet.write(type);
} else {
packet.write(-1);
packet.write(0);
}
}
}
return packet;
}
Aggregations