2018-12-06 10:00:00 +11:00
From c05a0fac903b6ef964ec5bb34583db3ba0738617 Mon Sep 17 00:00:00 2001
2013-05-14 21:14:43 +10:00
From: md_5 <md_5@live.com.au>
2013-06-02 15:22:22 +10:00
Date: Sun, 2 Jun 2013 15:20:49 +1000
2013-05-14 21:14:43 +10: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
2018-11-23 21:27:04 +11:00
index ca332102..27de9c94 100644
2013-05-14 21:14:43 +10:00
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
2018-11-23 21:27:04 +11:00
@@ -1482,6 +1482,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
2017-05-15 15:44:15 +10:00
public class Spigot extends Entity.Spigot
{
2013-06-02 15:22:22 +10: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." );
+ }
2017-05-15 15:44:15 +10:00
}
@Override
2013-05-21 20:45:44 +10:00
diff --git a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
2018-11-10 20:46:28 +11:00
index 6368c212..6532c24f 100644
2013-05-21 20:45:44 +10:00
--- a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
2018-11-10 20:46:28 +11:00
@@ -18,6 +18,7 @@ public class PlayerLoginEvent extends PlayerEvent {
2013-05-21 20:45:44 +10:00
private final String hostname;
private Result result = Result.ALLOWED;
private String message = "";
+ private final InetAddress realAddress; // Spigot
/**
2016-11-17 12:41:12 +11:00
* This constructor defaults message to an empty string, and result to
2018-11-10 20:46:28 +11:00
@@ -28,10 +29,17 @@ public class PlayerLoginEvent extends PlayerEvent {
2013-12-18 17:48:18 +11:00
* @param address The address the player used to connect, provided for
* timing issues
2013-05-21 20:45:44 +10: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
2014-03-27 11:53:41 +00:00
+ this.realAddress = realAddress;
2013-05-21 20:45:44 +10:00
+ }
+
+ public PlayerLoginEvent(final Player player, final String hostname, final InetAddress address) {
+ this(player, hostname, address, address);
+ // Spigot end
}
/**
2018-11-10 20:46:28 +11:00
@@ -44,12 +52,23 @@ public class PlayerLoginEvent extends PlayerEvent {
2013-05-21 20:45:44 +10: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 21:14:43 +10:00
--
2018-11-14 14:20:34 +11:00
2.19.1
2013-07-04 12:09:15 +10:00