From 8f8f4aef90e1bc33e2a63e2aa6668186e44cb7d1 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sun, 26 Dec 2010 23:21:21 +0000 Subject: [PATCH] Moved PlayerQuit to use normal PlayerEvent, dropped Reason param By: Dinnerbone --- .../bukkit/sample/SamplePlayerListener.java | 3 +- .../bukkit/event/player/PlayerListener.java | 2 +- .../bukkit/event/player/PlayerQuitEvent.java | 45 ------------------- .../bukkit/plugin/java/JavaPluginLoader.java | 2 +- 4 files changed, 3 insertions(+), 49 deletions(-) delete mode 100644 paper-api/src/org/bukkit/event/player/PlayerQuitEvent.java diff --git a/paper-api/sample/src/com/dinnerbone/bukkit/sample/SamplePlayerListener.java b/paper-api/sample/src/com/dinnerbone/bukkit/sample/SamplePlayerListener.java index 1fb5d7a473..0e28a95569 100644 --- a/paper-api/sample/src/com/dinnerbone/bukkit/sample/SamplePlayerListener.java +++ b/paper-api/sample/src/com/dinnerbone/bukkit/sample/SamplePlayerListener.java @@ -3,7 +3,6 @@ package com.dinnerbone.bukkit.sample; import org.bukkit.event.player.PlayerEvent; import org.bukkit.event.player.PlayerListener; -import org.bukkit.event.player.PlayerQuitEvent; /** * Handle events for all Player related events @@ -22,7 +21,7 @@ public class SamplePlayerListener extends PlayerListener { } @Override - public void onPlayerQuit(PlayerQuitEvent event) { + public void onPlayerQuit(PlayerEvent event) { System.out.println(event.getPlayer().getName() + " left the server! :'("); } } diff --git a/paper-api/src/org/bukkit/event/player/PlayerListener.java b/paper-api/src/org/bukkit/event/player/PlayerListener.java index 99ffbedaf0..fb90ab85d2 100644 --- a/paper-api/src/org/bukkit/event/player/PlayerListener.java +++ b/paper-api/src/org/bukkit/event/player/PlayerListener.java @@ -21,6 +21,6 @@ public class PlayerListener implements Listener { * Called when a player leaves a server * @param event Relevant event details */ - public void onPlayerQuit(PlayerQuitEvent event) { + public void onPlayerQuit(PlayerEvent event) { } } diff --git a/paper-api/src/org/bukkit/event/player/PlayerQuitEvent.java b/paper-api/src/org/bukkit/event/player/PlayerQuitEvent.java deleted file mode 100644 index 101fe736f2..0000000000 --- a/paper-api/src/org/bukkit/event/player/PlayerQuitEvent.java +++ /dev/null @@ -1,45 +0,0 @@ - -package org.bukkit.event.player; - -import org.bukkit.Player; -import org.bukkit.Server; - -/** - * Handles all event arguments in relation to a player joining a server - */ -public class PlayerQuitEvent extends PlayerEvent { - private final PlayerQuitReason reason; - - public PlayerQuitEvent(final Server server, final Player player, final PlayerQuitReason because) { - super(server, player); - reason = because; - } - - /** - * Return the reason for a player quitting the game - * @return PlayerQuitReason with the relevant reason - */ - public PlayerQuitReason getReason() { - return reason; - } - - /** - * The reason a player quit the game - */ - public enum PlayerQuitReason { - /** - * A player willingly quit the game - */ - Quit, - - /** - * A player disconnected due to a technical fault - */ - Disconnected, - - /** - * A player was kicked by another player - */ - Kicked - } -} diff --git a/paper-api/src/org/bukkit/plugin/java/JavaPluginLoader.java b/paper-api/src/org/bukkit/plugin/java/JavaPluginLoader.java index 0e273167db..a297e1b93c 100644 --- a/paper-api/src/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/paper-api/src/org/bukkit/plugin/java/JavaPluginLoader.java @@ -85,7 +85,7 @@ public final class JavaPluginLoader implements PluginLoader { trueListener.onPlayerJoin((PlayerEvent)event); break; case Quit: - trueListener.onPlayerQuit((PlayerQuitEvent)event); + trueListener.onPlayerQuit((PlayerEvent)event); break; } }