Clean up a few more things.

This commit is contained in:
GJ 2013-04-25 09:27:48 -04:00
parent 612308eb9a
commit b2dd820507
3 changed files with 25 additions and 13 deletions

View File

@ -276,7 +276,7 @@ public class PlayerListener implements Listener {
player.sendMessage(LocaleLoader.getString("XPRate.Event", Config.getInstance().getExperienceGainsGlobalMultiplier()));
}
if (Permissions.updateNotifications(player) && mcMMO.p.updateAvailable) {
if (Permissions.updateNotifications(player) && plugin.isUpdateAvailable()) {
player.sendMessage(LocaleLoader.getString("UpdateChecker.outdated"));
player.sendMessage(LocaleLoader.getString("UpdateChecker.newavailable"));
}

View File

@ -21,6 +21,12 @@ import com.gmail.nossr50.util.blockmeta.conversion.BlockStoreConversionMain;
public class WorldListener implements Listener {
private ArrayList<BlockStoreConversionMain> converters = new ArrayList<BlockStoreConversionMain>();
private final mcMMO plugin;
public WorldListener(final mcMMO plugin) {
this.plugin = plugin;
}
/**
* Monitor StructureGrow events.
*
@ -47,11 +53,11 @@ public class WorldListener implements Listener {
World world = event.getWorld();
File dataDir = new File(world.getWorldFolder(), "mcmmo_data");
if (!dataDir.exists() || mcMMO.p == null) {
if (!dataDir.exists() || plugin == null) {
return;
}
mcMMO.p.getLogger().info("Converting block storage for " + world.getName() + " to a new format.");
plugin.getLogger().info("Converting block storage for " + world.getName() + " to a new format.");
BlockStoreConversionMain converter = new BlockStoreConversionMain(world);
converter.run();

View File

@ -55,36 +55,38 @@ import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.spout.SpoutUtils;
public class mcMMO extends JavaPlugin {
/* Listeners */
private final PlayerListener playerListener = new PlayerListener(this);
private final BlockListener blockListener = new BlockListener(this);
private final EntityListener entityListener = new EntityListener(this);
private final InventoryListener inventoryListener = new InventoryListener(this);
private final WorldListener worldListener = new WorldListener(this);
private final SelfListener selfListener = new SelfListener();
private final WorldListener worldListener = new WorldListener();
public static mcMMO p;
/* Managers */
private static ChunkManager placeStore;
private static RepairableManager repairableManager;
private static DatabaseManager databaseManager;
// Jar Stuff
public static File mcmmo;
// File Paths
/* File Paths */
private static String mainDirectory;
private static String flatFileDirectory;
private static String usersFile;
private static String modDirectory;
public static mcMMO p;
// Jar Stuff
public static File mcmmo;
// Update Check
public boolean updateAvailable;
private boolean updateAvailable;
// Spout Check
public static boolean spoutEnabled = false;
public static boolean spoutEnabled;
// XP Event Check
private boolean xpEventEnabled = false;
private boolean xpEventEnabled;
// Metadata Values
public final static String entityMetadataKey = "mcMMO: Spawned Entity";
@ -206,6 +208,10 @@ public class mcMMO extends JavaPlugin {
return modDirectory;
}
public boolean isUpdateAvailable() {
return updateAvailable;
}
public boolean isXPEventEnabled() {
return xpEventEnabled;
}