use of org.dragonet.net.packet.minecraft.RespawnPacket in project Dragonet-Legacy by DragonetMC.
the class HealthMessageTranslator method handleSpecific.
@Override
public PEPacket[] handleSpecific(HealthMessage packet) {
int h = (int) packet.health;
if (h <= 0) {
//DEAD
SetHealthPacket pk1 = new SetHealthPacket(h);
RespawnPacket pk2 = new RespawnPacket();
pk2.x = (float) getTranslator().getSession().getServer().getWorlds().get(0).getSpawnLocation().getX();
pk2.y = (float) getTranslator().getSession().getServer().getWorlds().get(0).getSpawnLocation().getY();
pk2.z = (float) getTranslator().getSession().getServer().getWorlds().get(0).getSpawnLocation().getZ();
return new PEPacket[] { pk1, pk2 };
} else {
SetHealthPacket pk = new SetHealthPacket(h);
return new PEPacket[] { pk };
}
}
Aggregations