Search in sources :

Example 1 with ExcPlayer

use of net.dzikoysk.funnyguilds.command.ExcPlayer in project FunnyGuilds by FunnyGuilds.

the class EntityInteract method onInteract.

@EventHandler
public void onInteract(PlayerInteractEntityEvent event) {
    PluginConfig config = Settings.getConfig();
    Player eventCaller = event.getPlayer();
    Entity clickedEntity = event.getRightClicked();
    if (clickedEntity instanceof Player) {
        Player clickedPlayer = (Player) clickedEntity;
        if (!config.infoPlayerEnabled || (config.infoPlayerSneaking && !eventCaller.isSneaking()) || informationMessageCooldowns.cooldown(eventCaller, TimeUnit.SECONDS, config.infoPlayerCooldown)) {
            return;
        }
        new ExcPlayer().execute(eventCaller, new String[] { clickedPlayer.getName() });
    }
}
Also used : PluginConfig(net.dzikoysk.funnyguilds.data.configs.PluginConfig) Entity(org.bukkit.entity.Entity) ExcPlayer(net.dzikoysk.funnyguilds.command.ExcPlayer) Player(org.bukkit.entity.Player) ExcPlayer(net.dzikoysk.funnyguilds.command.ExcPlayer) EventHandler(org.bukkit.event.EventHandler)

Aggregations

ExcPlayer (net.dzikoysk.funnyguilds.command.ExcPlayer)1 PluginConfig (net.dzikoysk.funnyguilds.data.configs.PluginConfig)1 Entity (org.bukkit.entity.Entity)1 Player (org.bukkit.entity.Player)1 EventHandler (org.bukkit.event.EventHandler)1