mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-06 07:02:18 -07:00
Remove redundant getRemoteAddress that can cause an NPE (#7331)
This commit is contained in:
@@ -85,20 +85,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||
String s1 = "local";
|
||||
final String s1;
|
||||
|
||||
if (connection.getRemoteAddress() != null) {
|
||||
- s1 = connection.getRemoteAddress().toString();
|
||||
+ s1 = com.destroystokyo.paper.PaperConfig.logPlayerIpAddresses ? connection.getRemoteAddress().toString() : "<ip address withheld>"; // Paper
|
||||
} else {
|
||||
s1 = "local";
|
||||
}
|
||||
|
||||
// Spigot start - spawn location event
|
||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||
playerconnection.playerJoinReady = () -> {
|
||||
postChunkLoadJoin(
|
||||
player, finalWorldserver, connection, playerconnection,
|
||||
- nbttagcompound, connection.getRemoteAddress().toString(), lastKnownName
|
||||
+ nbttagcompound, com.destroystokyo.paper.PaperConfig.logPlayerIpAddresses ? connection.getRemoteAddress().toString() : "<ip address withheld>", lastKnownName // Paper
|
||||
);
|
||||
};
|
||||
});
|
||||
|
Reference in New Issue
Block a user