From 257df25a67cc02173f054898811bd115d4697abd Mon Sep 17 00:00:00 2001 From: bm01 Date: Thu, 24 May 2012 06:58:11 +0200 Subject: [PATCH] Fixed NPE, Config.defaulthud was used instead of SpoutConfig.defaulthud --- src/main/java/com/gmail/nossr50/config/Config.java | 3 --- .../java/com/gmail/nossr50/datatypes/PlayerProfile.java | 7 ++++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/config/Config.java b/src/main/java/com/gmail/nossr50/config/Config.java index 0d6eb523e..6dd9f04e7 100644 --- a/src/main/java/com/gmail/nossr50/config/Config.java +++ b/src/main/java/com/gmail/nossr50/config/Config.java @@ -6,7 +6,6 @@ import java.util.Set; import org.bukkit.configuration.ConfigurationSection; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.datatypes.HUDType; public class Config extends ConfigLoader { public int xpGainMultiplier = 1; @@ -376,8 +375,6 @@ public class Config extends ConfigLoader { * CONFIG LOADING */ - public HUDType defaulthud; - private Config(mcMMO plugin) { super(plugin, "config.yml"); saveIfNotExist(); diff --git a/src/main/java/com/gmail/nossr50/datatypes/PlayerProfile.java b/src/main/java/com/gmail/nossr50/datatypes/PlayerProfile.java index 03ed587f0..5b4cd20d0 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/PlayerProfile.java +++ b/src/main/java/com/gmail/nossr50/datatypes/PlayerProfile.java @@ -12,6 +12,7 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.config.SpoutConfig; import com.gmail.nossr50.datatypes.mods.CustomTool; import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent; import com.gmail.nossr50.party.Party; @@ -63,7 +64,7 @@ public class PlayerProfile { private final String location = mcMMO.p.usersFile; public PlayerProfile(String name, boolean addNew) { - hud = Config.getInstance().defaulthud; + hud = SpoutConfig.getInstance().defaulthud; playerName = name; for (AbilityType abilityType : AbilityType.values()) { @@ -120,7 +121,7 @@ public class PlayerProfile { } } } else { - hud = Config.getInstance().defaulthud; + hud = SpoutConfig.getInstance().defaulthud; } } HashMap> users = mcMMO.database.read("SELECT lastlogin, party FROM "+Config.getInstance().getMySQLTablePrefix()+"users WHERE id = " + id); @@ -474,7 +475,7 @@ public class PlayerProfile { out.append(0+":"); //DATS out.append(0+":"); //DATS out.append(0+":"); //DATS - out.append(Config.getInstance().defaulthud.toString()+":");//HUD + out.append(SpoutConfig.getInstance().defaulthud.toString()+":");//HUD out.append(0+":"); //Fishing out.append(0+":"); //FishingXP out.append(0+":"); //Blast Mining