Search in sources :

Example 1 with ProfileWand

use of me.botsko.prism.wands.ProfileWand in project Prism-Bukkit by prism.

the class PrismPlayerEvents method onPlayerEntityInteract.

/**
     * 
     * @param event
     */
@EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerEntityInteract(final PlayerInteractEntityEvent event) {
    final Player player = event.getPlayer();
    final Entity entity = event.getRightClicked();
    // Are they using a wand?
    if (Prism.playersWithActiveTools.containsKey(player.getName())) {
        // Pull the wand in use
        final Wand wand = Prism.playersWithActiveTools.get(player.getName());
        if (wand != null && wand instanceof ProfileWand) {
            wand.playerRightClick(player, entity);
            // Always cancel
            event.setCancelled(true);
        }
    }
}
Also used : Entity(org.bukkit.entity.Entity) Player(org.bukkit.entity.Player) ProfileWand(me.botsko.prism.wands.ProfileWand) Wand(me.botsko.prism.wands.Wand) ProfileWand(me.botsko.prism.wands.ProfileWand) EventHandler(org.bukkit.event.EventHandler)

Aggregations

ProfileWand (me.botsko.prism.wands.ProfileWand)1 Wand (me.botsko.prism.wands.Wand)1 Entity (org.bukkit.entity.Entity)1 Player (org.bukkit.entity.Player)1 EventHandler (org.bukkit.event.EventHandler)1