Fix some runtime errors

Fixed an error in plugin, made the config load before the Methods
This commit is contained in:
MistPhizzle 2014-06-28 17:40:30 -04:00
parent 797e19a820
commit 3d4fe77ee9
4 changed files with 18 additions and 17 deletions

Binary file not shown.

View file

@ -72,13 +72,6 @@ public class Methods {
Methods.plugin = plugin; Methods.plugin = plugin;
} }
private static boolean allowharmless = plugin.getConfig().getBoolean("Properties.RegionProtection.AllowHarmlessAbilities");
private static boolean respectWorldGuard = plugin.getConfig().getBoolean("Properties.RegionProtection.RespectWorldGuard");
private static boolean respectPreciousStones = plugin.getConfig().getBoolean("Properties.RegionProtection.RespectPreciousStones");
private static boolean respectFactions = plugin.getConfig().getBoolean("Properties.RegionProtection.RespectFactions");
private static boolean respectTowny = plugin.getConfig().getBoolean("Properties.RegionProtection.RespectTowny");
private static boolean respectGriefPrevention = plugin.getConfig().getBoolean("Properties.RegionProtection.RespectGriefPrevention");
private static final ItemStack pickaxe = new ItemStack( private static final ItemStack pickaxe = new ItemStack(
Material.DIAMOND_PICKAXE); Material.DIAMOND_PICKAXE);
public static ConcurrentHashMap<Block, Information> movedearth = new ConcurrentHashMap<Block, Information>(); public static ConcurrentHashMap<Block, Information> movedearth = new ConcurrentHashMap<Block, Information>();
@ -566,9 +559,9 @@ public class Methods {
for (double i = 0; i <= range; i++) { for (double i = 0; i <= range; i++) {
Block block = location.clone().add(vector.clone().multiply(i)) Block block = location.clone().add(vector.clone().multiply(i))
.getBlock(); .getBlock();
if (isRegionProtectedFromBuild(player, "RaiseEarth", if (isRegionProtectedFromBuild(player, "RaiseEarth",
location)) location))
continue; continue;
if (isEarthbendable(player, block)) { if (isEarthbendable(player, block)) {
return block; return block;
} }
@ -606,9 +599,9 @@ public class Methods {
for (double i = 0; i <= range; i++) { for (double i = 0; i <= range; i++) {
Block block = location.clone().add(vector.clone().multiply(i)) Block block = location.clone().add(vector.clone().multiply(i))
.getBlock(); .getBlock();
if (isRegionProtectedFromBuild(player, "WaterManipulation", if (isRegionProtectedFromBuild(player, "WaterManipulation",
location)) location))
continue; continue;
if (isWaterbendable(block, player) if (isWaterbendable(block, player)
&& (!isPlant(block) || plantbending)) { && (!isPlant(block) || plantbending)) {
if (TempBlock.isTempBlock(block)) { if (TempBlock.isTempBlock(block)) {
@ -1240,6 +1233,13 @@ public class Methods {
public static boolean isRegionProtectedFromBuild(Player player, public static boolean isRegionProtectedFromBuild(Player player,
String ability, Location loc) { String ability, Location loc) {
boolean allowharmless = plugin.getConfig().getBoolean("Properties.RegionProtection.AllowHarmlessAbilities");
boolean respectWorldGuard = plugin.getConfig().getBoolean("Properties.RegionProtection.RespectWorldGuard");
boolean respectPreciousStones = plugin.getConfig().getBoolean("Properties.RegionProtection.RespectPreciousStones");
boolean respectFactions = plugin.getConfig().getBoolean("Properties.RegionProtection.RespectFactions");
boolean respectTowny = plugin.getConfig().getBoolean("Properties.RegionProtection.RespectTowny");
boolean respectGriefPrevention = plugin.getConfig().getBoolean("Properties.RegionProtection.RespectGriefPrevention");
Set<String> ignite = AbilityModuleManager.igniteabilities; Set<String> ignite = AbilityModuleManager.igniteabilities;
Set<String> explode = AbilityModuleManager.explodeabilities; Set<String> explode = AbilityModuleManager.explodeabilities;
// List<Abilities> ignite = new ArrayList<Abilities>(); // List<Abilities> ignite = new ArrayList<Abilities>();

View file

@ -20,11 +20,12 @@ public class ProjectKorra extends JavaPlugin {
ProjectKorra.log = this.getLogger(); ProjectKorra.log = this.getLogger();
plugin = this; plugin = this;
new AbilityModuleManager(this);
new ConfigManager(this);
new Methods(this); new Methods(this);
new Commands(this); new Commands(this);
new AbilityModuleManager(this);
new ConfigManager(this);
DBConnection.host = getConfig().getString("Storage.MySQL.host"); DBConnection.host = getConfig().getString("Storage.MySQL.host");
DBConnection.port = getConfig().getInt("Storage.MySQL.port"); DBConnection.port = getConfig().getInt("Storage.MySQL.port");

View file

@ -1,6 +1,6 @@
name: ProjectKorra name: ProjectKorra
author: ProjectKorra author: ProjectKorra
version: 1.1.0 BETA 2 version: 1.1.0 BETA 3
main: com.projectkorra.ProjectKorra.ProjectKorra main: com.projectkorra.ProjectKorra.ProjectKorra
commands: commands:
projectkorra: projectkorra:
@ -62,7 +62,7 @@ permissions:
bending.ability.WaterManipulation: true bending.ability.WaterManipulation: true
bending.ability.WaterSpout: true bending.ability.WaterSpout: true
bending.ability.Plantbending: true bending.ability.Plantbending: true
bending.message.nightmessage bending.message.nightmessage: true
bending.earth: bending.earth:
default: true default: true
description: Grants access to all Earthbending abilities. description: Grants access to all Earthbending abilities.