mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-09-11 04:39:32 +00:00
Right Click Block no longer activates Bending
This commit is contained in:
parent
d117adb44d
commit
673bb841e7
|
@ -118,6 +118,7 @@ public class Methods {
|
|||
|
||||
public static ConcurrentHashMap<Block, Information> movedearth = new ConcurrentHashMap<Block, Information>();
|
||||
public static ConcurrentHashMap<Integer, Information> tempair = new ConcurrentHashMap<Integer, Information>();
|
||||
public static ConcurrentHashMap<String, Long> cooldowns = new ConcurrentHashMap<String, Long>();
|
||||
public static ArrayList<Block> tempnophysics = new ArrayList<Block>();
|
||||
private static Integer[] plantIds = { 6, 18, 31, 32, 37, 38, 39, 40, 59, 81, 83, 86, 99, 100, 103, 104, 105, 106, 111, 161, 175};
|
||||
|
||||
|
@ -252,6 +253,12 @@ public class Methods {
|
|||
if (Commands.isToggledForAll) return false;
|
||||
if (!bPlayer.isToggled) return false;
|
||||
if (p == null) return false;
|
||||
if (cooldowns.containsKey(p.getName())) {
|
||||
if (cooldowns.get(p.getName()) + ProjectKorra.plugin.getConfig().getLong("Properties.GlobalCooldown") >= System.currentTimeMillis()) {
|
||||
return false;
|
||||
}
|
||||
cooldowns.remove(p.getName());
|
||||
}
|
||||
if (!p.hasPermission("bending.ability." + ability)) return false;
|
||||
if (isAirAbility(ability) && !isBender(player, Element.Air)) return false;
|
||||
if (isWaterAbility(ability) && !isBender(player, Element.Water)) return false;
|
||||
|
|
|
@ -16,6 +16,7 @@ import org.bukkit.entity.Player;
|
|||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.block.BlockFadeEvent;
|
||||
import org.bukkit.event.block.BlockFormEvent;
|
||||
|
@ -208,6 +209,10 @@ public class PKListener implements Listener {
|
|||
public void onPlayerInteraction(PlayerInteractEvent event) {
|
||||
if (event.isCancelled()) return;
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||
Methods.cooldowns.put(player.getName(), System.currentTimeMillis());
|
||||
}
|
||||
if (Paralyze.isParalyzed(player) || Bloodbending.isBloodbended(player)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue