@Override public void read(SpoutInputStream stream) { name = stream.readString(); shortName = stream.readString(); typeInt = stream.readInt(); try { type = GrenadeType.getByCode(typeInt); } catch (Exception e) { RushMe.getInstance().getLogger().log(e, "PacketGrenadeUpdate was sent wrongly!"); } amount = stream.readInt(); startAmount = stream.readInt(); explosionSize = stream.readInt(); timeBeforeExplosion = stream.readInt(); damage = stream.readInt(); stunTime = stream.readInt(); uuid = stream.readUUID(); RushMe.getInstance().getLogger().debugLog(Level.INFO, "Read PacketGrenadeUpdate. Atributes:"); RushMe.getInstance() .getLogger() .debugLog( Level.INFO, "Name = " + name + ";ShortName = " + shortName + ";TypeInt = " + typeInt + ";Type = " + type + ";Amount = " + amount + ";StartAmount = " + startAmount + ";ExplosionSize = " + explosionSize + ";TimeBeforeExplosion = " + timeBeforeExplosion + ";Damage = " + damage + ";StunTime = " + stunTime + ";UUID = " + uuid); }
public void setType(GrenadeType type) { this.type = type; typeInt = type.getCode(); }