Finished tidying up our Spout checking.

This commit is contained in:
GJ
2013-01-30 08:08:29 -05:00
parent d09cd49f01
commit d3b0da4186
6 changed files with 26 additions and 39 deletions

View File

@ -33,7 +33,7 @@ public class SpoutListener implements Listener {
PlayerProfile profile = mcMMOPlayer.getProfile();
//TODO: Add custom titles based on skills
if (SpoutStuff.showPowerLevel) {
if (SpoutTools.showPowerLevel) {
spoutPlayer.setTitle(LocaleLoader.getString("Spout.Title", new Object[] {spoutPlayer.getName(), mcMMOPlayer.getPowerLevel()}));
}
@ -82,7 +82,7 @@ public class SpoutListener implements Listener {
return;
}
if (event.getKey() == SpoutStuff.menuKey) {
if (event.getKey() == SpoutTools.menuKey) {
SpoutHud spoutHud = Users.getProfile(spoutPlayer).getSpoutHud();
if (!spoutHud.isMenuOpened()) {

View File

@ -1,19 +0,0 @@
package com.gmail.nossr50.spout;
import com.gmail.nossr50.mcMMO;
public class SpoutStart implements Runnable{
@Override
public void run() {
//Spout Stuff
if (mcMMO.spoutEnabled) {
SpoutConfig.getInstance();
SpoutStuff.setupSpoutConfigs();
SpoutStuff.registerCustomEvent();
//Handle spout players after a /reload
SpoutStuff.reloadSpoutPlayers();
}
}
}

View File

@ -28,7 +28,7 @@ import com.gmail.nossr50.skills.SkillTools;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Users;
public class SpoutStuff {
public class SpoutTools {
private static mcMMO plugin = mcMMO.p;
static AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
@ -57,6 +57,11 @@ public class SpoutStuff {
try {
File currentFile = new File(theFilePath + theFileName);
// No point in writing the file again if it already exists.
if (currentFile.exists()) {
return;
}
jar = new JarFile(mcMMO.mcmmo);
JarEntry entry = jar.getJarEntry("resources/" + theFileName);
is = jar.getInputStream(entry);
@ -595,11 +600,9 @@ public class SpoutStuff {
}
public static void preCacheFiles() {
if (mcMMO.spoutEnabled) {
extractFiles(); //Extract source materials
FileManager FM = SpoutManager.getFileManager();
FM.addToPreLoginCache(plugin, getFiles());
}
extractFiles(); //Extract source materials
FileManager FM = SpoutManager.getFileManager();
FM.addToPreLoginCache(plugin, getFiles());
}
}