disabled charge skills being usable in hub

This commit is contained in:
Chiss 2014-11-23 11:46:47 +11:00
parent f0c87e439a
commit 0e4b21e6b1

View File

@ -5,7 +5,9 @@ import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
@ -58,6 +60,13 @@ public abstract class SkillChargeSword extends SkillCharge implements Listener
if (!_canChargeInWater && cur.getLocation().getBlock().isLiquid())
continue;
//Check Allowed
SkillTriggerEvent triggerEvent = new SkillTriggerEvent(cur, GetName(), GetClassType());
Bukkit.getServer().getPluginManager().callEvent(triggerEvent);
if (triggerEvent.IsCancelled())
continue;
//Recharged Check (uses recharge upon activation)
if (!_charge.containsKey(cur))
if (!Recharge.Instance.usable(cur, GetName()))