mcMMO/vStopFire/com/bukkit/nossr50/vStopFire/vStopFire.java

51 lines
1.7 KiB
Java

package com.bukkit.nossr50.vStopFire;
import java.io.File;
import java.util.HashMap;
import org.bukkit.Player;
import org.bukkit.Server;
import org.bukkit.event.Event.Priority;
import org.bukkit.event.Event;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.PluginLoader;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.PluginManager;
/**
* vStopFire for Bukkit
*
* @author nossr50
*/
public class vStopFire extends JavaPlugin {
private final vPlayerListener playerListener = new vPlayerListener(this);
private final vBlockListener blockListener = new vBlockListener(this);
private final HashMap<Player, Boolean> debugees = new HashMap<Player, Boolean>();
private final String name = "vStopFire";
public vStopFire(PluginLoader pluginLoader, Server instance, PluginDescriptionFile desc, File folder, File plugin, ClassLoader cLoader) {
super(pluginLoader, instance, desc, folder, plugin, cLoader);
}
public void onEnable() {
getServer().getPluginManager().registerEvent(Event.Type.BLOCK_IGNITE, blockListener, Priority.Normal, this);
PluginDescriptionFile pdfFile = this.getDescription();
System.out.println( pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!" );
}
public void onDisable() {
System.out.println("vStopFire disabled!");
}
public boolean isDebugging(final Player player) {
if (debugees.containsKey(player)) {
return debugees.get(player);
} else {
return false;
}
}
public void setDebugging(final Player player, final boolean value) {
debugees.put(player, value);
}
}