From 774ee57048be1cc561dccbca5b1bac7ce6e6d270 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 14 Jan 2011 15:49:43 -0800 Subject: [PATCH] Forgot the .yml file --- .../vPlayersOnline/POBlockListener.java | 18 ----- .../vPlayersOnline/POPlayerListener.java | 29 -------- .../vPlayersOnline/vPlayersOnline.java | 66 ------------------- vPlayersOnline/plugin.yml | 2 + 4 files changed, 2 insertions(+), 113 deletions(-) delete mode 100644 src/com/bukkit/nossr50/vPlayersOnline/POBlockListener.java delete mode 100644 src/com/bukkit/nossr50/vPlayersOnline/POPlayerListener.java delete mode 100644 src/com/bukkit/nossr50/vPlayersOnline/vPlayersOnline.java create mode 100644 vPlayersOnline/plugin.yml diff --git a/src/com/bukkit/nossr50/vPlayersOnline/POBlockListener.java b/src/com/bukkit/nossr50/vPlayersOnline/POBlockListener.java deleted file mode 100644 index 1e6ef1fa6..000000000 --- a/src/com/bukkit/nossr50/vPlayersOnline/POBlockListener.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.bukkit.nossr50.vPlayersOnline; - -import org.bukkit.event.block.BlockListener; - - -/** - * vPlayersOnline block listener - * @author nossr50 - */ -public class POBlockListener extends BlockListener { - private final vPlayersOnline plugin; - - public POBlockListener(final vPlayersOnline plugin) { - this.plugin = plugin; - } - - //put all Block related code here -} diff --git a/src/com/bukkit/nossr50/vPlayersOnline/POPlayerListener.java b/src/com/bukkit/nossr50/vPlayersOnline/POPlayerListener.java deleted file mode 100644 index 15bed9851..000000000 --- a/src/com/bukkit/nossr50/vPlayersOnline/POPlayerListener.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.bukkit.nossr50.vPlayersOnline; - -import org.bukkit.Player; -import org.bukkit.Color; -import org.bukkit.event.player.PlayerEvent; -import org.bukkit.event.player.PlayerListener; - -/** - * Handle events for all Player related events - * @author nossr50 - */ -public class POPlayerListener extends PlayerListener { - private final vPlayersOnline plugin; - - public POPlayerListener(vPlayersOnline instance) { - this.plugin = instance; - } - - //Insert Player related code here - public void onPlayerJoin(PlayerEvent event) { - Player player = event.getPlayer(); - Player players[] = plugin.getServer().getOnlinePlayers(); - int x = 0; - for(Player herp: players){ - x++; - } - player.sendMessage("There are " + x + " players online"); - } - } \ No newline at end of file diff --git a/src/com/bukkit/nossr50/vPlayersOnline/vPlayersOnline.java b/src/com/bukkit/nossr50/vPlayersOnline/vPlayersOnline.java deleted file mode 100644 index 44861b655..000000000 --- a/src/com/bukkit/nossr50/vPlayersOnline/vPlayersOnline.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.bukkit.nossr50.vPlayersOnline; -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; - -/** - * PlayersOnline for Bukkit - * - * @author nossr50 - */ -public class vPlayersOnline extends JavaPlugin { - private final POPlayerListener playerListener = new POPlayerListener(this); - private final POBlockListener blockListener = new POBlockListener(this); - private final HashMap debugees = new HashMap(); - public final static String name = "vPlayersOnline"; - public final static String version = "1.0"; - - - public vPlayersOnline(PluginLoader pluginLoader, Server instance, PluginDescriptionFile desc, File plugin, ClassLoader cLoader) { - super(pluginLoader, instance, desc, plugin, cLoader); - - // TODO: Place any custom initialization code here - - // NOTE: Event registration should be done in onEnable not here as all events are unregistered when a plugin is disabled - } - - - - public void onEnable() { - // TODO: Place any custom enable code here including the registration of any events - // Register our events - getServer().getPluginManager().registerEvent(Event.Type.PLAYER_JOIN, playerListener, Priority.Normal, this); - getServer().getPluginManager().registerEvent(Event.Type.PLAYER_QUIT, playerListener, Priority.Normal, this); - PluginManager pm = getServer().getPluginManager(); - // EXAMPLE: Custom code, here we just output some info so we can check all is well - PluginDescriptionFile pdfFile = this.getDescription(); - System.out.println( pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!" ); - } - public void onDisable() { - // TODO: Place any custom disable code here - - // NOTE: All registered events are automatically unregistered when a plugin is disabled - - // EXAMPLE: Custom code, here we just output some info so we can check all is well - System.out.println("Goodbye world!"); - } - 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); - } -} - diff --git a/vPlayersOnline/plugin.yml b/vPlayersOnline/plugin.yml new file mode 100644 index 000000000..4958c25d2 --- /dev/null +++ b/vPlayersOnline/plugin.yml @@ -0,0 +1,2 @@ +name: vPlayersOnline +main: com.bukkit.nossr50.vPlayersOnline.vPlayersOnline \ No newline at end of file