This commit is contained in:
Sobki 2017-01-17 13:56:21 +10:00 committed by Christopher Martin
parent 1c282ca550
commit 7e4ef6d5a2
4 changed files with 14 additions and 4 deletions

View file

@ -247,12 +247,21 @@ public class BendingPlayer {
return false;
} else if (!player.hasPermission("bending." + element.getName() + ".passive")) {
return false;
} else if (!isToggled() || !hasElement(element) || !isElementToggled(element)) {
} else if (!hasElement(element)) {
return false;
} else if (isChiBlocked() || isParalyzed() || isBloodbent()) {
return false;
} else if (disabledWorlds != null && disabledWorlds.contains(player.getWorld().getName())) {
return false;
}
return true;
}
public boolean canUsePassive(Element element) {
if (!isToggled() || !isElementToggled(element)) {
return false;
} else if (isChiBlocked() || isParalyzed() || isBloodbent()) {
return false;
} else if (GeneralMethods.isRegionProtectedFromBuild(player, player.getLocation())) {
return false;
}

View file

@ -1030,7 +1030,7 @@ public class PKListener implements Listener {
Bukkit.getScheduler().runTaskLater(ProjectKorra.plugin, new Runnable() {
public void run() {
player.sendMessage(ChatColor.GREEN + "This server is running ProjectKorra version " + ProjectKorra.plugin.getDescription().getVersion() + " for bending! Find out more at http://www.projectkorra.com!");
player.sendMessage(ChatColor.GOLD + "This server is running ProjectKorra version " + ProjectKorra.plugin.getDescription().getVersion() + " for bending! Find out more at http://www.projectkorra.com!");
}
}, 20 * 5);
}

View file

@ -214,9 +214,11 @@ public abstract class CoreAbility implements Ability {
if (bPlayer == null || !abil.getPlayer().isOnline()) {
abil.remove();
return;
} else if (!bPlayer.canBendPassive(abil.getElement())) {
} else if (!bPlayer.canBendPassive(abil.getElement())) { // Check for if the passive should be removed
abil.remove();
return;
} else if (!bPlayer.canUsePassive(abil.getElement())) { // Check for if the passive should be prevented from happening, but not remove it
return;
}
}
abil.progress();

View file

@ -6,7 +6,6 @@ import java.util.HashSet;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;