Files
src
Code
4 198
src/main/java/com/cleanwipe/CleanWipePlugin.java
package com.cleanwipe;
import com.cleanwipe.commands.CleanWipeCommand;
import com.cleanwipe.listeners.WipeListener;
import org.bukkit.plugin.java.JavaPlugin;
public class CleanWipePlugin extends JavaPlugin {
private static CleanWipePlugin instance;
private WipeListener wipeListener;
@Override
public void onEnable() {
instance = this;
saveDefaultConfig();
this.wipeListener = new WipeListener();
getServer().getPluginManager().registerEvents(wipeListener, this);
CleanWipeCommand cmd = new CleanWipeCommand(wipeListener);
getCommand("cleanwipe").setExecutor(cmd);
getCommand("cleanwipe").setTabCompleter(cmd);
getLogger().info("CleanWipe enabled.");
}
@Override
public void onDisable() {
if (wipeListener != null) {
wipeListener.saveData();
}
instance = null;
}
public static CleanWipePlugin getInstance() {
return instance;
}
}