mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 12:27:59 +01:00
Remove redundant getRemoteAddress that can cause an NPE (#7331)
This commit is contained in:
parent
4627ffe255
commit
2c7a063234
@ -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
|
||||
);
|
||||
};
|
||||
});
|
||||
|
@ -136,6 +136,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
// CraftBukkit end
|
||||
|
||||
if (nbttagcompound != null) {
|
||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||
if (nbttagcompound == null) player.fudgeSpawnLocation(worldserver1); // Paper - only move to spawn on first login, otherwise, stay where you are....
|
||||
|
||||
player.setLevel(worldserver1);
|
||||
- String s1 = "local";
|
||||
+ // Paper start - make s1 final
|
||||
+ final String s1;
|
||||
|
||||
if (connection.getRemoteAddress() != null) {
|
||||
s1 = connection.getRemoteAddress().toString();
|
||||
+ } else {
|
||||
+ s1 = "local";
|
||||
}
|
||||
+ // Paper end
|
||||
|
||||
// Spigot start - spawn location event
|
||||
Player spawnPlayer = player.getBukkitEntity();
|
||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||
player.getRecipeBook().sendInitialRecipeBook(player);
|
||||
this.updateEntireScoreboard(worldserver1.getScoreboard(), player);
|
||||
@ -160,7 +177,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ playerconnection.playerJoinReady = () -> {
|
||||
+ postChunkLoadJoin(
|
||||
+ player, finalWorldserver, connection, playerconnection,
|
||||
+ nbttagcompound, connection.getRemoteAddress().toString(), lastKnownName
|
||||
+ nbttagcompound, s1, lastKnownName
|
||||
+ );
|
||||
+ };
|
||||
+ });
|
||||
|
Loading…
Reference in New Issue
Block a user