Changed Bukkit listeners to cancel the event.

Dieser Commit ist enthalten in:
sk89q 2011-01-08 13:11:03 -08:00
Ursprung a36ceecaab
Commit 98afdd7df6
2 geänderte Dateien mit 7 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -65,7 +65,9 @@ public class WorldEditBlockListener extends BlockListener {
event.getBlock().getY(), event.getBlock().getZ()); event.getBlock().getY(), event.getBlock().getZ());
LocalPlayer player = wrapPlayer(event.getPlayer()); LocalPlayer player = wrapPlayer(event.getPlayer());
plugin.controller.handleBlockRightClick(player, pos); if (plugin.controller.handleBlockRightClick(player, pos)) {
event.setCancelled(true);
}
} }
private BukkitPlayer wrapPlayer(Player player) { private BukkitPlayer wrapPlayer(Player player) {

Datei anzeigen

@ -57,8 +57,10 @@ public class WorldEditPlayerListener extends PlayerListener {
* @param event Relevant event details * @param event Relevant event details
*/ */
public void onPlayerCommand(PlayerChatEvent event) { public void onPlayerCommand(PlayerChatEvent event) {
plugin.controller.handleCommand(wrapPlayer(event.getPlayer()), if (plugin.controller.handleCommand(wrapPlayer(event.getPlayer()),
event.getMessage().split(" ")); event.getMessage().split(" "))) {
event.setCancelled(true);
}
} }
private BukkitPlayer wrapPlayer(Player player) { private BukkitPlayer wrapPlayer(Player player) {