@Override
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_SHARED_POSITION_TELEPORT_UI.writeId(packet);
SharedPosition sharedPosition = PositionShareManager.getInstance().getSharedPosition(_id);
if (sharedPosition == null)
{
packet.writeD(0x00);
return true;
}
packet.writeString(sharedPosition.getPlayer().getName());
packet.writeD(sharedPosition.getId());
packet.writeD(sharedPosition.getTeleportsLeft());
packet.writeH(0x0E); // Short size
final Location loc = sharedPosition.getLocation();
packet.writeD(loc.getX());
packet.writeD(loc.getY());
packet.writeD(loc.getZ());
packet.writeQ(Config.SERVER_IS_GAMMA ? Config.GAMMA_TELE_TO_SHARE_POS_ITEM_COUNT : Config.SHARE_POSITION_TELEPORT_PRICE);
return true;
}