mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Fixed a few issues from the merge, added the mod directory to the zip
backup.
This commit is contained in:
parent
b529219a0e
commit
1b37ba8daa
@ -17,11 +17,12 @@ import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.Users;
|
||||
|
||||
public class McremoveCommand implements CommandExecutor {
|
||||
private final String location = mcMMO.p.usersFile;
|
||||
private final String location;
|
||||
private final mcMMO plugin;
|
||||
|
||||
public McremoveCommand (mcMMO plugin) {
|
||||
this.plugin = plugin;
|
||||
this.location = plugin.usersFile;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -57,7 +57,7 @@ public class PlayerProfile {
|
||||
HashMap<ToolType, Integer> toolATS = new HashMap<ToolType, Integer>();
|
||||
|
||||
private String playerName;
|
||||
private String location = mcMMO.p.usersFile;
|
||||
private final String location = mcMMO.p.usersFile;
|
||||
|
||||
public PlayerProfile(String name, boolean addNew) {
|
||||
hud = Config.getInstance().defaulthud;
|
||||
|
@ -6,7 +6,8 @@ import com.gmail.nossr50.commands.spout.*;
|
||||
import com.gmail.nossr50.commands.mc.*;
|
||||
import com.gmail.nossr50.commands.party.*;
|
||||
import com.gmail.nossr50.commands.general.*;
|
||||
import com.gmail.nossr50.config.*;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.LoadTreasures;
|
||||
import com.gmail.nossr50.config.mods.LoadCustomTools;
|
||||
import com.gmail.nossr50.runnables.*;
|
||||
import com.gmail.nossr50.util.Database;
|
||||
@ -50,7 +51,7 @@ public class mcMMO extends JavaPlugin {
|
||||
public static mcMMO p;
|
||||
|
||||
/* Jar Stuff */
|
||||
public static File mcmmo;
|
||||
public final File mcmmo = getFile();
|
||||
|
||||
//File Paths
|
||||
public final String mainDirectory = getDataFolder().getPath() + File.separator;
|
||||
@ -66,9 +67,6 @@ public class mcMMO extends JavaPlugin {
|
||||
*/
|
||||
public void onEnable() {
|
||||
p = this;
|
||||
mcmmo = getFile();
|
||||
|
||||
if (!configInstance.getUseMySQL()) {
|
||||
|
||||
configInstance.load();
|
||||
LoadTreasures.getInstance().load();
|
||||
@ -76,7 +74,8 @@ public class mcMMO extends JavaPlugin {
|
||||
if (configInstance.getToolModsEnabled()) {
|
||||
LoadCustomTools.getInstance().load();
|
||||
}
|
||||
|
||||
|
||||
if (!configInstance.getUseMySQL()) {
|
||||
Users.loadUsers();
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ public class Party {
|
||||
* @return the list of parties.
|
||||
*/
|
||||
public ArrayList<String> getParties() {
|
||||
String location = mcMMO.p.usersFile;
|
||||
String location = plugin.usersFile;
|
||||
ArrayList<String> parties = new ArrayList<String>();
|
||||
|
||||
try {
|
||||
@ -194,7 +194,7 @@ public class Party {
|
||||
in.close();
|
||||
}
|
||||
catch (Exception e) {
|
||||
mcMMO.p.getLogger().severe("Exception while reading " + location + " (Are you sure you formatted it correctly?)" + e.toString());
|
||||
plugin.getLogger().severe("Exception while reading " + location + " (Are you sure you formatted it correctly?)" + e.toString());
|
||||
}
|
||||
return parties;
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ public class SQLConversionTask implements Runnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
String location = mcMMO.p.usersFile;
|
||||
String location = plugin.usersFile;
|
||||
|
||||
try {
|
||||
FileReader file = new FileReader(location);
|
||||
|
@ -34,7 +34,7 @@ import com.gmail.nossr50.util.Users;
|
||||
public class SpoutStuff {
|
||||
private static mcMMO plugin = mcMMO.p;
|
||||
|
||||
public final static String spoutDirectory = mcMMO.p.mainDirectory + "Resources" + File.separator;
|
||||
public final static String spoutDirectory = plugin.mainDirectory + "Resources" + File.separator;
|
||||
public final static String hudDirectory = spoutDirectory + "HUD" + File.separator;
|
||||
public final static String hudStandardDirectory = hudDirectory + "Standard" + File.separator;
|
||||
public final static String hudRetroDirectory = hudDirectory + "Retro" + File.separator;
|
||||
@ -59,7 +59,7 @@ public class SpoutStuff {
|
||||
try {
|
||||
File currentFile = new File(theFilePath + theFileName);
|
||||
|
||||
JarFile jar = new JarFile(mcMMO.mcmmo);
|
||||
JarFile jar = new JarFile(plugin.mcmmo);
|
||||
JarEntry entry = jar.getJarEntry("resources/" + theFileName);
|
||||
InputStream is = jar.getInputStream(entry);
|
||||
|
||||
|
@ -14,9 +14,9 @@ import com.gmail.nossr50.datatypes.SkillType;
|
||||
import com.gmail.nossr50.datatypes.Tree;
|
||||
|
||||
public class Leaderboard {
|
||||
private static String leaderboardsDirectory = mcMMO.p.leaderboardDirectory;
|
||||
private static String location = mcMMO.p.usersFile;
|
||||
private static mcMMO plugin = mcMMO.p;
|
||||
private static String leaderboardsDirectory = plugin.leaderboardDirectory;
|
||||
private static String location = plugin.usersFile;
|
||||
|
||||
/**
|
||||
* Create the leaderboards.
|
||||
|
@ -12,16 +12,19 @@ import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
|
||||
public class Users {
|
||||
|
||||
private final static mcMMO plugin = mcMMO.p;
|
||||
public static HashMap<String, PlayerProfile> players = new HashMap<String, PlayerProfile>();
|
||||
|
||||
|
||||
/**
|
||||
* Load users.
|
||||
*/
|
||||
public static void loadUsers() {
|
||||
new File(mcMMO.p.flatFileDirectory).mkdir();
|
||||
new File(mcMMO.p.leaderboardDirectory).mkdir();
|
||||
File theDir = new File(mcMMO.p.usersFile);
|
||||
|
||||
|
||||
new File(plugin.flatFileDirectory).mkdir();
|
||||
new File(plugin.leaderboardDirectory).mkdir();
|
||||
File theDir = new File(plugin.usersFile);
|
||||
|
||||
if (!theDir.exists()) {
|
||||
try {
|
||||
@ -101,7 +104,7 @@ public class Users {
|
||||
* @return the player's profile
|
||||
*/
|
||||
public static PlayerProfile getProfileByName(String playerName) {
|
||||
if (mcMMO.p.getServer().getOfflinePlayer(playerName).isOnline() || players.containsKey(playerName.toLowerCase())) {
|
||||
if (plugin.getServer().getOfflinePlayer(playerName).isOnline() || players.containsKey(playerName.toLowerCase())) {
|
||||
if (players.containsKey(playerName.toLowerCase())) {
|
||||
return players.get(playerName.toLowerCase());
|
||||
}
|
||||
|
@ -16,14 +16,15 @@ import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
|
||||
public class ZipLibrary {
|
||||
|
||||
private static String BackupDirectory = mcMMO.p.mainDirectory + "backup";
|
||||
private final static mcMMO plugin = mcMMO.p;
|
||||
private static String BackupDirectory = plugin.mainDirectory + "backup" + File.separator;
|
||||
private static File BackupDir = new File(BackupDirectory);
|
||||
private static File FlatFileDirectory = new File(mcMMO.p.flatFileDirectory);
|
||||
private static File UsersFile = new File(mcMMO.p.usersFile);
|
||||
private static File ConfigFile = new File(mcMMO.p.mainDirectory + "config.yml");
|
||||
private static File TreasuresFile = new File(mcMMO.p.mainDirectory + "treasures.yml");
|
||||
private static File Leaderboards = new File(mcMMO.p.leaderboardDirectory);
|
||||
private static File FlatFileDirectory = new File(plugin.flatFileDirectory);
|
||||
private static File ModFileDirectory = new File(plugin.modDirectory);
|
||||
private static File UsersFile = new File(plugin.usersFile);
|
||||
private static File ConfigFile = new File(plugin.mainDirectory + "config.yml");
|
||||
private static File TreasuresFile = new File(plugin.mainDirectory + "treasures.yml");
|
||||
private static File Leaderboards = new File(plugin.leaderboardDirectory);
|
||||
|
||||
public static void mcMMObackup() throws IOException {
|
||||
if (Config.getInstance().getUseMySQL()) {
|
||||
@ -47,6 +48,7 @@ public class ZipLibrary {
|
||||
//Create the Source List, and add directories/etc to the file.
|
||||
List<File> sources = new ArrayList<File>();
|
||||
sources.add(FlatFileDirectory);
|
||||
sources.add(ModFileDirectory);
|
||||
sources.add(UsersFile);
|
||||
sources.add(ConfigFile);
|
||||
sources.add(TreasuresFile);
|
||||
|
Loading…
Reference in New Issue
Block a user