Force compile-time failures for the subtle changes done in the API

By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
Bukkit/Spigot 2011-03-30 00:25:59 +02:00
parent 2e99a0f17d
commit db5dfb3f10
5 changed files with 24 additions and 0 deletions

View file

@ -1,6 +1,7 @@
package org.bukkit.event.block;
import org.bukkit.event.Listener;
import org.bukkit.plugin.AuthorNagException;
/**
* Handles all events thrown in relation to Blocks
@ -32,10 +33,16 @@ public class BlockListener implements Listener {
* Called when a block flows (water/lava)
*
* @param event Relevant event details
* @throws BukkitAuthorNagException
*/
public void onBlockFromTo(BlockFromToEvent event) {
onBlockFlow(event);
throw new AuthorNagException("onBlockFlow has been deprecated, use onBlockFromTo");
}
// Prevent compilation of old signatures TODO: Remove after 1.4
@Deprecated public final void onBlockFlow(BlockFromToEvent event) {}
/**
* Called when a block gets ignited
*

View file

@ -162,4 +162,10 @@ public class PlayerListener implements Listener {
*/
public void onPlayerBucketEmpty(PlayerBucketEmptyEvent event) {
}
// Prevent compilation of old signatures TODO: Remove after 1.4
@Deprecated public final void onPlayerQuit(PlayerEvent event) {}
@Deprecated public final void onPlayerCommandPreprocess(PlayerChatEvent event) {}
@Deprecated public final void onPlayerTeleport(PlayerMoveEvent event) {}
@Deprecated public final void onPlayerJoin(PlayerEvent event) {}
}

View file

@ -30,4 +30,8 @@ public class ServerListener implements Listener {
*/
public void onServerCommand(ServerCommandEvent event) {
}
// Prevent compilation of old signatures TODO: Remove after 1.4
@Deprecated public final void onPluginDisable(PluginEvent event) {}
@Deprecated public final void onPluginEnable(PluginEvent event) {}
}

View file

@ -75,4 +75,7 @@ public class VehicleListener implements Listener {
*/
public void onVehicleUpdate(VehicleUpdateEvent event) {
}
// Prevent compilation of old signatures TODO: Remove after 1.4
@Deprecated public final void onVehicleUpdate(VehicleEvent event) {}
}

View file

@ -38,4 +38,8 @@ public class WorldListener implements Listener {
*/
public void onWorldLoad(WorldLoadEvent event) {
}
// Prevent compilation of old signatures TODO: Remove after 1.4
@Deprecated public final void onWorldLoad(WorldEvent event) {}
@Deprecated public final void onWorldSave(WorldEvent event) {}
}