mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Fixed various NPE errors when loading up mcMMO
This commit is contained in:
parent
063d982750
commit
37d146e8fa
@ -440,7 +440,7 @@ public class Config extends ConfigLoader {
|
||||
|
||||
public HUDType defaulthud;
|
||||
|
||||
private Config(mcMMO plugin) {
|
||||
public Config(mcMMO plugin) {
|
||||
super(plugin, "config.yml");
|
||||
config = plugin.getConfig();
|
||||
xpGainMultiplier = getExperienceGainsGlobalMultiplier();
|
||||
|
@ -316,8 +316,7 @@ public class PlayerListener implements Listener {
|
||||
|
||||
event.setFormat(bracketColor + "(" + ChatColor.WHITE + "%1$s" + bracketColor + ") %2$s");
|
||||
event.getRecipients().retainAll(intendedRecipients);
|
||||
}
|
||||
else if (PP.getAdminChatMode()) {
|
||||
} else if (PP.getAdminChatMode()) {
|
||||
McMMOAdminChatEvent chatEvent = new McMMOAdminChatEvent(player.getName(), event.getMessage());
|
||||
plugin.getServer().getPluginManager().callEvent(chatEvent);
|
||||
|
||||
|
@ -51,24 +51,23 @@ public class mcMMO extends JavaPlugin {
|
||||
public static mcMMO p;
|
||||
|
||||
/* Jar Stuff */
|
||||
public final File mcmmo = getFile();
|
||||
public File mcmmo;
|
||||
|
||||
//File Paths
|
||||
public final String mainDirectory = getDataFolder().getPath() + File.separator;
|
||||
public final String flatFileDirectory = mainDirectory + "FlatFileStuff" + File.separator;
|
||||
public final String usersFile = flatFileDirectory + "mcmmo.users";
|
||||
public final String leaderboardDirectory = flatFileDirectory + "Leaderboards" + File.separator;
|
||||
public final String modDirectory = mainDirectory + "ModConfigs" + File.separator;
|
||||
public String mainDirectory, flatFileDirectory, usersFile, leaderboardDirectory, modDirectory;
|
||||
|
||||
private static Config configInstance = Config.getInstance();
|
||||
private static Config configInstance = null;
|
||||
|
||||
/**
|
||||
* Things to be run when the plugin is enabled.
|
||||
*/
|
||||
public void onEnable() {
|
||||
p = this;
|
||||
|
||||
setupFilePaths();
|
||||
|
||||
configInstance = new Config(this);
|
||||
configInstance.load();
|
||||
|
||||
LoadTreasures.getInstance().load();
|
||||
|
||||
if (configInstance.getToolModsEnabled()) {
|
||||
@ -130,6 +129,15 @@ public class mcMMO extends JavaPlugin {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setupFilePaths() {
|
||||
mcmmo = getFile();
|
||||
mainDirectory = getDataFolder().getPath() + File.separator;
|
||||
flatFileDirectory = mainDirectory + "FlatFileStuff" + File.separator;
|
||||
usersFile = flatFileDirectory + "mcmmo.users";
|
||||
leaderboardDirectory = flatFileDirectory + "Leaderboards" + File.separator;
|
||||
modDirectory = mainDirectory + "ModConfigs" + File.separator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get profile of the player.
|
||||
|
Loading…
Reference in New Issue
Block a user