mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 11:40:40 +00:00
Fixed MetalBending passive.
MetalBending's passive Iron Door toggling will no longer happen every tick (200 tick cooldown).
This commit is contained in:
parent
de931f44f9
commit
7cc958cdf4
1 changed files with 4 additions and 1 deletions
|
@ -75,7 +75,7 @@ public class EarthPassive {
|
|||
public static void handleMetalPassives() {
|
||||
for (Player player: Bukkit.getOnlinePlayers()) {
|
||||
if (Methods.canBendPassive(player.getName(), Element.Earth) && Methods.canMetalbend(player)) {
|
||||
if (player.isSneaking()) {
|
||||
if (player.isSneaking() && !Methods.getBendingPlayer(player.getName()).isOnCooldown("MetalPassive")) {
|
||||
Block block = player.getTargetBlock(null, 5);
|
||||
if (block == null) continue;
|
||||
if (block.getType() == Material.IRON_DOOR_BLOCK && !Methods.isRegionProtectedFromBuild(player, null, block.getLocation())) {
|
||||
|
@ -90,6 +90,9 @@ public class EarthPassive {
|
|||
block.setData((byte) (block.getData() - 4));
|
||||
block.getWorld().playSound(block.getLocation(), Sound.DOOR_OPEN, 10, 1);
|
||||
}
|
||||
|
||||
Methods.getBendingPlayer(player.getName()).addCooldown("MetalPassive", 200);
|
||||
|
||||
// Door door = (Door) block.getState().getData();
|
||||
// if (door.isTopHalf()) {
|
||||
// block = block.getRelative(BlockFace.DOWN);
|
||||
|
|
Loading…
Reference in a new issue