2016-03-01 01:23:45 +01:00
From 0b286d348e11792e7da9b19a7fd02e623ed52aca Mon Sep 17 00:00:00 2001
2014-07-21 22:46:54 +02:00
From: md_5 <md_5@live.com.au>
Date: Sun, 2 Jun 2013 15:20:49 +1000
Subject: [PATCH] BungeeCord Support
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
2016-02-29 22:33:06 +01:00
index 723464b..6444fdf 100644
2014-07-21 22:46:54 +02:00
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
2016-02-29 22:33:06 +01:00
@@ -1272,4 +1272,22 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
2014-07-21 22:46:54 +02:00
*/
2016-02-29 22:33:06 +01:00
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data);
2014-07-21 22:46:54 +02:00
+ // Spigot start
+ public class Spigot extends Entity.Spigot
+ {
+
+ /**
+ * 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();
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
2014-11-30 23:16:48 +01:00
index 68834dd..4bc024f 100644
2014-07-21 22:46:54 +02: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
2014-11-30 23:16:48 +01:00
@@ -43,10 +44,17 @@ public class PlayerLoginEvent extends PlayerEvent {
2014-07-21 22:46:54 +02:00
* @param address The address the player used to connect, provided for
* timing issues
*/
- 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 = realAddress;
+ }
+
+ public PlayerLoginEvent(final Player player, final String hostname, final InetAddress address) {
+ this(player, hostname, address, address);
+ // Spigot end
}
/**
2014-11-30 23:16:48 +01:00
@@ -58,7 +66,7 @@ public class PlayerLoginEvent extends PlayerEvent {
2014-07-21 22:46:54 +02: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
}
/**
2014-11-30 23:16:48 +01:00
@@ -71,12 +79,23 @@ public class PlayerLoginEvent extends PlayerEvent {
2014-07-21 22:46:54 +02: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
*
--
2016-02-29 22:33:06 +01:00
2.5.0
2014-07-21 22:46:54 +02:00