2014-03-09 22:14:45 +00:00
From 13bf0b8e141d290ef4be6a0b75e8aa82e5d5fd1a Mon Sep 17 00:00:00 2001
2013-05-14 11:14:43 +00:00
From: md_5 <md_5@live.com.au>
2013-06-02 05:22:22 +00:00
Date: Sun, 2 Jun 2013 15:20:49 +1000
2013-05-14 11:14:43 +00:00
Subject: [PATCH] BungeeCord Support
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
2014-03-09 22:14:45 +00:00
index 44c9b5a..21f348b 100644
2013-05-14 11:14:43 +00:00
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
2014-01-21 04:32:54 +00:00
@@ -1018,4 +1018,23 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
2013-07-24 09:29:30 +00:00
* @see Player#setHealthScaled(boolean)
2013-05-14 11:14:43 +00:00
*/
2013-07-24 09:29:30 +00:00
public double getHealthScale();
2013-05-14 11:14:43 +00:00
+
+ // Spigot start
2013-08-03 09:54:36 +00:00
+ public class Spigot extends Entity.Spigot
2013-06-02 05:22:22 +00:00
+ {
+
+ /**
+ * Gets the connection address of this player, regardless of whether it
+ * has been spoofed or not.
+ *
+ * @return the player's connection address
+ */
+ public InetSocketAddress getRawAddress()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+ }
+
+ Spigot spigot();
2013-05-14 11:14:43 +00:00
+ // Spigot end
}
2013-05-21 10:45:44 +00:00
diff --git a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
2013-12-18 06:48:18 +00:00
index b74b7b8..8fb1c98 100644
2013-05-21 10:45:44 +00:00
--- a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
@@ -14,6 +14,7 @@ public class PlayerLoginEvent extends PlayerEvent {
private final String hostname;
private Result result = Result.ALLOWED;
private String message = "";
+ private final InetAddress realAddress; // Spigot
/**
* @deprecated Address should be provided in other constructor
2013-12-18 06:48:18 +00:00
@@ -40,10 +41,17 @@ public class PlayerLoginEvent extends PlayerEvent {
* @param address The address the player used to connect, provided for
* timing issues
2013-05-21 10:45:44 +00:00
*/
- public PlayerLoginEvent(final Player player, final String hostname, final InetAddress address) {
+ public PlayerLoginEvent(final Player player, final String hostname, final InetAddress address, final InetAddress realAddress) { // Spigot
super(player);
this.hostname = hostname;
this.address = address;
+ // Spigot start
+ this.realAddress = address;
+ }
+
+ public PlayerLoginEvent(final Player player, final String hostname, final InetAddress address) {
+ this(player, hostname, address, address);
+ // Spigot end
}
/**
2013-12-18 06:48:18 +00:00
@@ -52,7 +60,7 @@ public class PlayerLoginEvent extends PlayerEvent {
2013-05-21 10:45:44 +00:00
*/
@Deprecated
public PlayerLoginEvent(final Player player, final Result result, final String message) {
- this(player, "", null, result, message);
+ this(player, "", null, result, message, null); // Spigot
}
/**
2013-12-18 06:48:18 +00:00
@@ -65,12 +73,23 @@ public class PlayerLoginEvent extends PlayerEvent {
2013-05-21 10:45:44 +00:00
* @param result The result status for this event
* @param message The message to be displayed if result denies login
*/
- public PlayerLoginEvent(final Player player, String hostname, final InetAddress address, final Result result, final String message) {
- this(player, hostname, address);
+ public PlayerLoginEvent(final Player player, String hostname, final InetAddress address, final Result result, final String message, final InetAddress realAddress) { // Spigot
+ this(player, hostname, address, realAddress); // Spigot
this.result = result;
this.message = message;
}
+ // Spigot start
+ /**
+ * Gets the connection address of this player, regardless of whether it has been spoofed or not.
+ *
+ * @return the player's connection address
+ */
+ public InetAddress getRealAddress() {
+ return realAddress;
+ }
+ // Spigot end
+
/**
* Gets the current result of the login, as an enum
*
2013-05-14 11:14:43 +00:00
--
2013-12-18 06:48:18 +00:00
1.8.3.2
2013-07-04 02:09:15 +00:00