com.sucy.skill.dynamic.trigger.ClickRightTrigger Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proskillapi Show documentation
Show all versions of proskillapi Show documentation
A Minecraft Bukkit plugin aiming to provide an easy code API and skill editor for all server owners to
create unique and fully custom classes and skills.
package com.sucy.skill.dynamic.trigger;
import com.sucy.skill.api.Settings;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.EquipmentSlot;
public class ClickRightTrigger extends ClickTrigger {
/**
* {@inheritDoc}
*/
@Override
public String getKey() {
return "RIGHT_CLICK";
}
/**
* {@inheritDoc}
*/
@Override
public boolean shouldTrigger(PlayerInteractEvent event, int level, Settings settings) {
if ((event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK)
&& event.getHand() == EquipmentSlot.HAND) {
return settings.getString("crouch").equalsIgnoreCase("both") ||
event.getPlayer().isSneaking() != settings.getString("crouch").equalsIgnoreCase("Dont crouch");
}
return false;
}
}