mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 19:24:44 +02:00
Finished tidying up our Spout checking.
This commit is contained in:
@ -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()) {
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
@ -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());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user