Updated for slightly cleaner event handler syntax

Dieser Commit ist enthalten in:
zml2008 2012-01-19 15:21:18 -08:00
Ursprung 6d8be92e45
Commit 6134d2b868
4 geänderte Dateien mit 12 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -34,7 +34,7 @@ public class FallbackRegistrationListener implements Listener {
this.commandRegistration = commandRegistration; this.commandRegistration = commandRegistration;
} }
@EventHandler(event = PlayerCommandPreprocessEvent.class) @EventHandler
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) { public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
if (event.isCancelled()) { if (event.isCancelled()) {
return; return;

Datei anzeigen

@ -72,7 +72,10 @@ public class YAMLProcessor extends YAMLNode {
protected String header = null; protected String header = null;
protected YAMLFormat format; protected YAMLFormat format;
// Map from property key to comment. Comment may have multiple lines that are newline-separated. /*
* Map from property key to comment. Comment may have multiple lines that are newline-separated.
* Comments support based on ZerothAngel's AnnotatedYAMLConfiguration
*/
private final Map<String, String> comments = new HashMap<String, String>(); private final Map<String, String> comments = new HashMap<String, String>();
public YAMLProcessor(File file, boolean writeDefaults, YAMLFormat format) { public YAMLProcessor(File file, boolean writeDefaults, YAMLFormat format) {

Datei anzeigen

@ -261,7 +261,7 @@ public class PermissionsResolverManager implements PermissionsResolver {
} }
class ServerListener implements org.bukkit.event.Listener { class ServerListener implements org.bukkit.event.Listener {
@EventHandler(event = PluginEnableEvent.class) @EventHandler
public void onPluginEnable(PluginEnableEvent event) { public void onPluginEnable(PluginEnableEvent event) {
Plugin plugin = event.getPlugin(); Plugin plugin = event.getPlugin();
String name = plugin.getDescription().getName(); String name = plugin.getDescription().getName();
@ -272,7 +272,7 @@ public class PermissionsResolverManager implements PermissionsResolver {
} }
} }
@EventHandler(event = PluginDisableEvent.class) @EventHandler
public void onPluginDisable(PluginDisableEvent event) { public void onPluginDisable(PluginDisableEvent event) {
String name = event.getPlugin().getDescription().getName(); String name = event.getPlugin().getDescription().getName();

Datei anzeigen

@ -62,7 +62,7 @@ public class WorldEditListener implements Listener {
this.plugin = plugin; this.plugin = plugin;
} }
@EventHandler(event = PlayerJoinEvent.class, priority = EventPriority.LOWEST) @EventHandler(priority = EventPriority.LOWEST)
public void onPlayerJoin(PlayerJoinEvent event) { public void onPlayerJoin(PlayerJoinEvent event) {
plugin.wrapPlayer(event.getPlayer()).dispatchCUIHandshake(); plugin.wrapPlayer(event.getPlayer()).dispatchCUIHandshake();
} }
@ -72,7 +72,7 @@ public class WorldEditListener implements Listener {
* *
* @param event Relevant event details * @param event Relevant event details
*/ */
@EventHandler(event = PlayerQuitEvent.class) @EventHandler
public void onPlayerQuit(PlayerQuitEvent event) { public void onPlayerQuit(PlayerQuitEvent event) {
plugin.getWorldEdit().markExpire(plugin.wrapPlayer(event.getPlayer())); plugin.getWorldEdit().markExpire(plugin.wrapPlayer(event.getPlayer()));
} }
@ -82,7 +82,7 @@ public class WorldEditListener implements Listener {
* *
* @param event Relevant event details * @param event Relevant event details
*/ */
@EventHandler(event = PlayerCommandPreprocessEvent.class, priority = EventPriority.LOW) @EventHandler(priority = EventPriority.LOW)
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) { public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
if (event.isCancelled()) { if (event.isCancelled()) {
return; return;
@ -103,7 +103,7 @@ public class WorldEditListener implements Listener {
* *
* @param event Relevant event details * @param event Relevant event details
*/ */
@EventHandler(event = PlayerInteractEvent.class) @EventHandler
public void onPlayerInteract(PlayerInteractEvent event) { public void onPlayerInteract(PlayerInteractEvent event) {
if (event.useItemInHand() == Result.DENY) { if (event.useItemInHand() == Result.DENY) {
return; return;
@ -167,7 +167,7 @@ public class WorldEditListener implements Listener {
} }
} }
@EventHandler(event = PlayerChatEvent.class) @EventHandler
public void onPlayerChat(PlayerChatEvent event) { public void onPlayerChat(PlayerChatEvent event) {
if (event.isCancelled()) { if (event.isCancelled()) {
return; return;