Search in sources :

Example 1 with DestinationSimple

use of com.massivecraft.massivecore.teleport.DestinationSimple in project MassiveCore by MassiveCraft.

the class EngineMassiveCoreDestination method destinationPs.

// -------------------------------------------- //
// DESTINATION ARG
// -------------------------------------------- //
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void destinationPs(EventMassiveCoreDestination event) {
    try {
        PS ps = TypePS.get().read(event.getArg(), event.getSender());
        Destination destination = new DestinationSimple(ps);
        event.setDestination(destination);
    } catch (MassiveException exception) {
        event.setException(exception);
        event.setCancelled(true);
    }
}
Also used : EventMassiveCoreDestination(com.massivecraft.massivecore.event.EventMassiveCoreDestination) Destination(com.massivecraft.massivecore.teleport.Destination) TypePS(com.massivecraft.massivecore.command.type.TypePS) PS(com.massivecraft.massivecore.ps.PS) MassiveException(com.massivecraft.massivecore.MassiveException) DestinationSimple(com.massivecraft.massivecore.teleport.DestinationSimple) EventHandler(org.bukkit.event.EventHandler)

Aggregations

MassiveException (com.massivecraft.massivecore.MassiveException)1 TypePS (com.massivecraft.massivecore.command.type.TypePS)1 EventMassiveCoreDestination (com.massivecraft.massivecore.event.EventMassiveCoreDestination)1 PS (com.massivecraft.massivecore.ps.PS)1 Destination (com.massivecraft.massivecore.teleport.Destination)1 DestinationSimple (com.massivecraft.massivecore.teleport.DestinationSimple)1 EventHandler (org.bukkit.event.EventHandler)1