48 lines
1.1 KiB
Java
48 lines
1.1 KiB
Java
package xyz.etztech.orealert;
|
|
|
|
|
|
import org.bukkit.Bukkit;
|
|
import org.bukkit.configuration.file.FileConfiguration;
|
|
import org.bukkit.plugin.java.JavaPlugin;
|
|
import xyz.etztech.orealert.commands.MainCommand;
|
|
import xyz.etztech.orealert.listeners.BlockBreakListener;
|
|
|
|
import java.util.logging.Logger;
|
|
|
|
public class OreAlert extends JavaPlugin {
|
|
|
|
private static OreAlert instance;
|
|
public static FileConfiguration config;
|
|
private final Logger log = Logger.getLogger( "Minecraft" );
|
|
|
|
public void onEnable() {
|
|
instance = this;
|
|
saveDefaultConfig();
|
|
reloadConfig();
|
|
|
|
if (isEnabled()) {
|
|
new MainCommand(this);
|
|
new BlockBreakListener(this);
|
|
}
|
|
}
|
|
|
|
public void loadConfig() {
|
|
config = Bukkit.getPluginManager().getPlugin("OreAlert").getConfig();
|
|
}
|
|
|
|
@Override
|
|
public void reloadConfig() {
|
|
super.reloadConfig();
|
|
loadConfig();
|
|
}
|
|
|
|
public void log(String message) {
|
|
log.info( "[OreAlert]: " + message );
|
|
}
|
|
|
|
public static OreAlert getInstance() {
|
|
return instance;
|
|
}
|
|
}
|
|
|