use of org.dragonet.protocol.packets.SpawnExperienceOrb in project DragonProxy by DragonetMC.
the class PCSpawnExpOrbPacketTranslator method translate.
public PEPacket[] translate(UpstreamSession session, ServerSpawnExpOrbPacket packet) {
CachedEntity entity = session.getEntityCache().newEntity(packet);
if (entity == null)
return null;
if (session.isSpawned()) {
SpawnExperienceOrb spawnXpOrb = new SpawnExperienceOrb();
spawnXpOrb.position = new Vector3F((float) entity.x, (float) entity.y + entity.peType.getOffset(), (float) entity.z);
spawnXpOrb.count = packet.getExp();
entity.spawned = true;
session.sendPacket(spawnXpOrb);
}
return null;
}
Aggregations