Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package musaddict.snowgrow;
- import java.io.File;
- import java.util.logging.Level;
- import java.util.logging.Logger;
- import org.bukkit.plugin.PluginDescriptionFile;
- import org.bukkit.plugin.java.JavaPlugin;
- public class SnowGrow extends JavaPlugin {
- public static PluginDescriptionFile info;
- private static Logger log;
- public static WorldData worldData;
- private SnowGrowCommands commands;
- @Override
- public void onEnable() {
- info = getDescription();
- log = Logger.getLogger("Minecraft");
- getConfig().options().copyDefaults(true);
- saveConfig();
- worldData = new WorldData("plugins" + File.separator + info.getName());
- commands = new SnowGrowCommands(this);
- Log("is enabled, version: " + info.getVersion());
- Log("written by [Musaddict, Feed_Dante]");
- if (!worldData.loadWorldData())
- SnowGrow.Log(Level.SEVERE, "Error loading world data");
- getCommand("snow").setExecutor(new SnowGrowCommands(this));
- getServer().getPluginManager().registerEvents(new AutoGrowListeners(this), this);
- }
- public static void Log(String message) {
- log.log(Level.INFO, "[" + info.getName() + "] " + message);
- }
- public static void Log(Level logLevel, String message) {
- log.log(logLevel, "[" + info.getName() + "] " + message);
- }
- @Override
- public void onDisable() {
- for (String playerName : commands.playerSnow.keySet())
- commands.new StopTasks(getServer().getPlayer(playerName), commands.playerSnow.get(playerName)).run();
- if (!worldData.saveWorldData())
- SnowGrow.Log(Level.SEVERE, "Error saving world data");
- Log("was successfully disabled.");
- info = null;
- log = null;
- worldData = null;
- commands = null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement