mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06: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;
|
public HUDType defaulthud;
|
||||||
|
|
||||||
private Config(mcMMO plugin) {
|
public Config(mcMMO plugin) {
|
||||||
super(plugin, "config.yml");
|
super(plugin, "config.yml");
|
||||||
config = plugin.getConfig();
|
config = plugin.getConfig();
|
||||||
xpGainMultiplier = getExperienceGainsGlobalMultiplier();
|
xpGainMultiplier = getExperienceGainsGlobalMultiplier();
|
||||||
|
@ -316,8 +316,7 @@ public class PlayerListener implements Listener {
|
|||||||
|
|
||||||
event.setFormat(bracketColor + "(" + ChatColor.WHITE + "%1$s" + bracketColor + ") %2$s");
|
event.setFormat(bracketColor + "(" + ChatColor.WHITE + "%1$s" + bracketColor + ") %2$s");
|
||||||
event.getRecipients().retainAll(intendedRecipients);
|
event.getRecipients().retainAll(intendedRecipients);
|
||||||
}
|
} else if (PP.getAdminChatMode()) {
|
||||||
else if (PP.getAdminChatMode()) {
|
|
||||||
McMMOAdminChatEvent chatEvent = new McMMOAdminChatEvent(player.getName(), event.getMessage());
|
McMMOAdminChatEvent chatEvent = new McMMOAdminChatEvent(player.getName(), event.getMessage());
|
||||||
plugin.getServer().getPluginManager().callEvent(chatEvent);
|
plugin.getServer().getPluginManager().callEvent(chatEvent);
|
||||||
|
|
||||||
|
@ -51,24 +51,23 @@ public class mcMMO extends JavaPlugin {
|
|||||||
public static mcMMO p;
|
public static mcMMO p;
|
||||||
|
|
||||||
/* Jar Stuff */
|
/* Jar Stuff */
|
||||||
public final File mcmmo = getFile();
|
public File mcmmo;
|
||||||
|
|
||||||
//File Paths
|
//File Paths
|
||||||
public final String mainDirectory = getDataFolder().getPath() + File.separator;
|
public String mainDirectory, flatFileDirectory, usersFile, leaderboardDirectory, modDirectory;
|
||||||
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;
|
|
||||||
|
|
||||||
private static Config configInstance = Config.getInstance();
|
private static Config configInstance = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Things to be run when the plugin is enabled.
|
* Things to be run when the plugin is enabled.
|
||||||
*/
|
*/
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
p = this;
|
p = this;
|
||||||
|
setupFilePaths();
|
||||||
|
|
||||||
|
configInstance = new Config(this);
|
||||||
configInstance.load();
|
configInstance.load();
|
||||||
|
|
||||||
LoadTreasures.getInstance().load();
|
LoadTreasures.getInstance().load();
|
||||||
|
|
||||||
if (configInstance.getToolModsEnabled()) {
|
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.
|
* Get profile of the player.
|
||||||
|
Loading…
Reference in New Issue
Block a user