Deprecation cleanup.

By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
Bukkit/Spigot
2012-01-30 21:32:48 +01:00
parent fe4de0bb01
commit 75fd934339
165 changed files with 409 additions and 4280 deletions

View File

@@ -1,6 +1,5 @@
package org.bukkit.event.server;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.bukkit.map.MapView;
@@ -12,8 +11,7 @@ public class MapInitializeEvent extends ServerEvent {
private static final HandlerList handlers = new HandlerList();
private final MapView mapView;
public MapInitializeEvent(MapView mapView) {
super(Event.Type.MAP_INITIALIZE);
public MapInitializeEvent(final MapView mapView) {
this.mapView = mapView;
}

View File

@@ -9,8 +9,9 @@ import org.bukkit.plugin.Plugin;
@SuppressWarnings("serial")
public class PluginDisableEvent extends PluginEvent {
private static final HandlerList handlers = new HandlerList();
public PluginDisableEvent(Plugin plugin) {
super(Type.PLUGIN_DISABLE, plugin);
public PluginDisableEvent(final Plugin plugin) {
super(plugin);
}
@Override

View File

@@ -9,8 +9,9 @@ import org.bukkit.plugin.Plugin;
@SuppressWarnings("serial")
public class PluginEnableEvent extends PluginEvent {
private static final HandlerList handlers = new HandlerList();
public PluginEnableEvent(Plugin plugin) {
super(Type.PLUGIN_ENABLE, plugin);
public PluginEnableEvent(final Plugin plugin) {
super(plugin);
}
@Override

View File

@@ -9,9 +9,7 @@ import org.bukkit.plugin.Plugin;
public abstract class PluginEvent extends ServerEvent {
private final Plugin plugin;
public PluginEvent(final Type type, final Plugin plugin) {
super(type);
public PluginEvent(final Plugin plugin) {
this.plugin = plugin;
}

View File

@@ -1,7 +1,6 @@
package org.bukkit.event.server;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.event.HandlerList;
/**
@@ -11,15 +10,9 @@ import org.bukkit.event.HandlerList;
public class ServerCommandEvent extends ServerEvent {
private static final HandlerList handlers = new HandlerList();
private String command;
private CommandSender sender;
private final CommandSender sender;
@Deprecated
public ServerCommandEvent(ConsoleCommandSender console, String message) {
this(Type.SERVER_COMMAND, console, message);
}
public ServerCommandEvent(Type type, CommandSender sender, String command) {
super(type);
public ServerCommandEvent(final CommandSender sender, final String command) {
this.command = command;
this.sender = sender;
}

View File

@@ -7,7 +7,4 @@ import org.bukkit.event.Event;
*/
@SuppressWarnings("serial")
public abstract class ServerEvent extends Event {
public ServerEvent(final Type type) {
super(type);
}
}

View File

@@ -2,7 +2,6 @@ package org.bukkit.event.server;
import java.net.InetAddress;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
@@ -12,13 +11,12 @@ import org.bukkit.event.HandlerList;
public class ServerListPingEvent extends ServerEvent {
private static final HandlerList handlers = new HandlerList();
private InetAddress address;
private final InetAddress address;
private String motd;
private int numPlayers;
private final int numPlayers;
private int maxPlayers;
public ServerListPingEvent(InetAddress address, String motd, int numPlayers, int maxPlayers) {
super(Event.Type.SERVER_LIST_PING);
public ServerListPingEvent(final InetAddress address, final String motd, final int numPlayers, final int maxPlayers) {
this.address = address;
this.motd = motd;
this.numPlayers = numPlayers;

View File

@@ -1,45 +0,0 @@
package org.bukkit.event.server;
import org.bukkit.event.Listener;
/**
* Handles all miscellaneous server events
*/
@Deprecated
public class ServerListener implements Listener {
/**
* Called when a plugin is enabled
*
* @param event Relevant event details
*/
public void onPluginEnable(PluginEnableEvent event) {}
/**
* Called when a plugin is disabled
*
* @param event Relevant event details
*/
public void onPluginDisable(PluginDisableEvent event) {}
/**
* Called when a server command is used
*
* @param event Relevant event details
*/
public void onServerCommand(ServerCommandEvent event) {}
/**
* Called when a map item is initialized (created or loaded into memory)
*
* @param event Relevant event details
*/
public void onMapInitialize(MapInitializeEvent event) {}
/**
* Called when a server list ping has come in.
*
* @param event Relevant event details
*/
public void onServerListPing(ServerListPingEvent event) {}
}