Disable Bending per world w/ Config

This commit is contained in:
MistPhizzle 2014-09-05 18:35:52 -04:00
parent 1e2eee1035
commit 3ba8a6d273
3 changed files with 9 additions and 0 deletions

View file

@ -85,6 +85,11 @@ public class ConfigManager {
config.addDefault("Properties.Chi.CanBendWithWeapons", true);
ArrayList<String> disabledWorlds = new ArrayList<String>();
disabledWorlds.add("TestWorld");
disabledWorlds.add("TestWorld2");
config.addDefault("Properties.DisabledWorlds", disabledWorlds);
config.addDefault("Abilities.AvatarState.Enabled", true);
config.addDefault("Abilities.AvatarState.Description", "The signature ability of the Avatar, this is a toggle. Click to activate to become "
+ "nearly unstoppable. While in the Avatar State, the user takes severely reduced damage from "

View file

@ -261,6 +261,7 @@ public class Methods {
BendingPlayer bPlayer = getBendingPlayer(player);
Player p = Bukkit.getPlayer(player);
if (bPlayer == null) return false;
if (plugin.getConfig().getStringList("Properties.DisabledWorlds") != null && plugin.getConfig().getStringList("Properties.DisabledWorlds").contains(p.getWorld().getName())) return false;
if (Commands.isToggledForAll) return false;
if (!bPlayer.isToggled) return false;
if (p == null) return false;

View file

@ -65,6 +65,9 @@ Properties:
DayFactor: 1.5
Chi:
CanBendWithWeapons: false
DisabledWorlds:
- TestWorld
- TestWorld2
Abilities:
AvatarState:
Enabled: true