public boolean start() { if (TYPE.equals(TeleportRequestType.TELEPORT_HERE)) { if ((PLAYER != null) && (PLAYER2 != null)) { Teleport teleport = new Teleport(PLAYER2.getEntity().getLocation(), PLAYER.getEntity().getLocation()); teleport.animatedTeleport(); return true; } } else { if ((PLAYER != null) && (PLAYER2 != null)) { Teleport teleport = new Teleport(PLAYER.getEntity().getLocation(), PLAYER2.getEntity().getLocation()); teleport.animatedTeleport(); return true; } } return false; }
public TeleportRequest( MoseLivingPlayer player, TeleportRequestType type, MoseLivingPlayer player2) { PLAYER = player; TYPE = type; PLAYER2 = player2; if (type.equals(TeleportRequestType.TELEPORT_HERE)) { player2 .getEntity() .sendMessage( TeleportMessages.REQUEST_TO_TELEPORT_YOU_TO_THEM.getText( player.getEntityType().getName())); } else { player2 .getEntity() .sendMessage( TeleportMessages.REQUEST_TO_TELEPORT_TO_YOU.getText( player.getEntityType().getName())); } player2 .getEntity() .sendMessage(TeleportMessages.TYPE_TO_ACCEPT.getText(player.getEntityType().getName())); }