Skip to content

Commit

Permalink
Removing 14 deprecated methods per http://bit.ly/mO2f4d
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinnerbone committed Jun 16, 2011
1 parent d920779 commit a329cf1
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 90 deletions.
27 changes: 4 additions & 23 deletions src/main/java/org/bukkit/event/player/PlayerListener.java
@@ -1,7 +1,6 @@
package org.bukkit.event.player;

import org.bukkit.event.Listener;
import org.bukkit.plugin.AuthorNagException;

/**
* Handles all events thrown in relation to a Player
Expand All @@ -14,20 +13,14 @@ public PlayerListener() {}
*
* @param event Relevant event details
*/
public void onPlayerJoin(PlayerJoinEvent event) {
onPlayerJoin((PlayerEvent) event);
throw new AuthorNagException("onPlayerJoin has been replaced with a new signature, (PlayerJoinEvent)");
}
public void onPlayerJoin(PlayerJoinEvent event) {}

/**
* Called when a player leaves a server
*
* @param event Relevant event details
*/
public void onPlayerQuit(PlayerQuitEvent event) {
onPlayerQuit((PlayerEvent) event);
throw new AuthorNagException("onPlayerQuit has been replaced with a new signature, (PlayerQuitEvent)");
}
public void onPlayerQuit(PlayerQuitEvent event) {}

/**
* Called when a player gets kicked from the server
Expand All @@ -49,10 +42,7 @@ public void onPlayerChat(PlayerChatEvent event) {}
*
* @param event Relevant event details
*/
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
onPlayerCommandPreprocess((PlayerChatEvent) event);
throw new AuthorNagException("onPlayerCommandPreprocess has been replaced with a new signature, (PlayerCommandPreprocessEvent)");
}
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {}

/**
* Called when a player attempts to move location in a world
Expand All @@ -66,10 +56,7 @@ public void onPlayerMove(PlayerMoveEvent event) {}
*
* @param event Relevant event details
*/
public void onPlayerTeleport(PlayerTeleportEvent event) {
onPlayerTeleport((PlayerMoveEvent) event);
throw new AuthorNagException("onPlayerTeleport has been replaced with a new signature, (PlayerTeleportEvent)");
}
public void onPlayerTeleport(PlayerTeleportEvent event) {}

/**
* Called when a player respawns
Expand Down Expand Up @@ -189,10 +176,4 @@ public void onPlayerBedLeave(PlayerBedLeaveEvent event) {}
* @param event Relevant event details
*/
public void onPlayerPortal(PlayerPortalEvent event) {}

// TODO: Remove after RB
@Deprecated public void onPlayerQuit(PlayerEvent event) {}
@Deprecated public void onPlayerCommandPreprocess(PlayerChatEvent event) {}
@Deprecated public void onPlayerTeleport(PlayerMoveEvent event) {}
@Deprecated public void onPlayerJoin(PlayerEvent event) {}
}
15 changes: 2 additions & 13 deletions src/main/java/org/bukkit/event/server/ServerListener.java
@@ -1,7 +1,6 @@
package org.bukkit.event.server;

import org.bukkit.event.Listener;
import org.bukkit.plugin.AuthorNagException;

/**
* Handles all miscellaneous server events
Expand All @@ -13,29 +12,19 @@ public class ServerListener implements Listener {
*
* @param event Relevant event details
*/
public void onPluginEnable(PluginEnableEvent event) {
onPluginEnable((PluginEvent) event);
throw new AuthorNagException("onPluginEnable has been replaced with a new signature, (PluginEnableEvent)");
}
public void onPluginEnable(PluginEnableEvent event) {}

/**
* Called when a plugin is disabled
*
* @param event Relevant event details
*/
public void onPluginDisable(PluginDisableEvent event) {
onPluginDisable((PluginEvent) event);
throw new AuthorNagException("onPluginDisable has been replaced with a new signature, (PluginDisableEvent)");
}
public void onPluginDisable(PluginDisableEvent event) {}

/**
* Called when a server command is used
*
* @param event Relevant event details
*/
public void onServerCommand(ServerCommandEvent event) {}

// TODO: Remove after RB
@Deprecated public void onPluginDisable(PluginEvent event) {}
@Deprecated public void onPluginEnable(PluginEvent event) {}
}
9 changes: 1 addition & 8 deletions src/main/java/org/bukkit/event/vehicle/VehicleListener.java
@@ -1,7 +1,6 @@
package org.bukkit.event.vehicle;

import org.bukkit.event.Listener;
import org.bukkit.plugin.AuthorNagException;

/**
* Listener for vehicle events.
Expand Down Expand Up @@ -73,11 +72,5 @@ public void onVehicleDestroy(VehicleDestroyEvent event) {}
*
* @param event
*/
public void onVehicleUpdate(VehicleUpdateEvent event) {
onVehicleUpdate((VehicleEvent) event);
throw new AuthorNagException("onVehicleUpdate has been replaced with a new signature, (VehicleUpdateEvent)");
}

// TODO: Remove after RB
@Deprecated public void onVehicleUpdate(VehicleEvent event) {}
public void onVehicleUpdate(VehicleUpdateEvent event) {}
}
15 changes: 2 additions & 13 deletions src/main/java/org/bukkit/event/world/WorldListener.java
@@ -1,7 +1,6 @@
package org.bukkit.event.world;

import org.bukkit.event.Listener;
import org.bukkit.plugin.AuthorNagException;

/**
* Handles all World related events
Expand Down Expand Up @@ -50,10 +49,7 @@ public void onPortalCreate(PortalCreateEvent event) {}
*
* @param event Relevant event details
*/
public void onWorldSave(WorldSaveEvent event) {
onWorldSave((WorldEvent) event);
throw new AuthorNagException("onWorldSave has been replaced with a new signature, (WorldSaveEvent)");
}
public void onWorldSave(WorldSaveEvent event) {}

/**
* Called when a World is initializing
Expand All @@ -68,19 +64,12 @@ public void onWorldInit(WorldInitEvent event) {
*
* @param event Relevant event details
*/
public void onWorldLoad(WorldLoadEvent event) {
onWorldLoad((WorldEvent) event);
throw new AuthorNagException("onWorldLoad has been replaced with a new signature, (WorldLoadEvent)");
}
public void onWorldLoad(WorldLoadEvent event) {}

/**
* Called when a World is unloaded
*
* @param event Relevant event details
*/
public void onWorldUnload(WorldUnloadEvent event) { }

// TODO: Remove after RB
@Deprecated public void onWorldLoad(WorldEvent event) {}
@Deprecated public void onWorldSave(WorldEvent event) {}
}
11 changes: 0 additions & 11 deletions src/main/java/org/bukkit/material/Coal.java
Expand Up @@ -42,17 +42,6 @@ public CoalType getType() {
return CoalType.getByData(getData());
}

/**
* Sets the type of this coal
*
* @param type New type of this coal
* @deprecated use {@link #setType(CoalType)} instead
*/
@Deprecated
public void setSpecies(CoalType type) {
setType(type);
}

/**
* Sets the type of this coal
*
Expand Down
22 changes: 0 additions & 22 deletions src/main/java/org/bukkit/material/Crops.java
Expand Up @@ -33,17 +33,6 @@ public Crops(final Material type, final byte data) {
super(type, data);
}

/**
* Gets the current growth state of this crop
*
* @return CropState of this leave
* @deprecated use {@link #getState()} instead
*/
@Deprecated
public CropState getSpecies() {
return getState();
}

/**
* Gets the current growth state of this crop
*
Expand All @@ -53,17 +42,6 @@ public CropState getState() {
return CropState.getByData(getData());
}

/**
* Sets the growth state of this crop
*
* @param state New growth state of this crop
* @deprecated use {@link #setState(CropState)} instead
*/
@Deprecated
public void setSpecies(CropState state) {
setState(state);
}

/**
* Sets the growth state of this crop
*
Expand Down

0 comments on commit a329cf1

Please sign in to comment.