Fixed NPE, Config.defaulthud was used instead of SpoutConfig.defaulthud

This commit is contained in:
bm01 2012-05-24 06:58:11 +02:00
parent 2a977557c2
commit 257df25a67
2 changed files with 4 additions and 6 deletions

View File

@ -6,7 +6,6 @@ import java.util.Set;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.HUDType;
public class Config extends ConfigLoader { public class Config extends ConfigLoader {
public int xpGainMultiplier = 1; public int xpGainMultiplier = 1;
@ -376,8 +375,6 @@ public class Config extends ConfigLoader {
* CONFIG LOADING * CONFIG LOADING
*/ */
public HUDType defaulthud;
private Config(mcMMO plugin) { private Config(mcMMO plugin) {
super(plugin, "config.yml"); super(plugin, "config.yml");
saveIfNotExist(); saveIfNotExist();

View File

@ -12,6 +12,7 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.SpoutConfig;
import com.gmail.nossr50.datatypes.mods.CustomTool; import com.gmail.nossr50.datatypes.mods.CustomTool;
import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent; import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent;
import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.Party;
@ -63,7 +64,7 @@ public class PlayerProfile {
private final String location = mcMMO.p.usersFile; private final String location = mcMMO.p.usersFile;
public PlayerProfile(String name, boolean addNew) { public PlayerProfile(String name, boolean addNew) {
hud = Config.getInstance().defaulthud; hud = SpoutConfig.getInstance().defaulthud;
playerName = name; playerName = name;
for (AbilityType abilityType : AbilityType.values()) { for (AbilityType abilityType : AbilityType.values()) {
@ -120,7 +121,7 @@ public class PlayerProfile {
} }
} }
} else { } else {
hud = Config.getInstance().defaulthud; hud = SpoutConfig.getInstance().defaulthud;
} }
} }
HashMap<Integer, ArrayList<String>> users = mcMMO.database.read("SELECT lastlogin, party FROM "+Config.getInstance().getMySQLTablePrefix()+"users WHERE id = " + id); HashMap<Integer, ArrayList<String>> 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(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+":"); //Fishing
out.append(0+":"); //FishingXP out.append(0+":"); //FishingXP
out.append(0+":"); //Blast Mining out.append(0+":"); //Blast Mining