mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-03 21:52:05 -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
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
+++ b/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 {
|
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||||
String s1 = "local";
|
final String s1;
|
||||||
|
|
||||||
if (connection.getRemoteAddress() != null) {
|
if (connection.getRemoteAddress() != null) {
|
||||||
- s1 = connection.getRemoteAddress().toString();
|
- s1 = connection.getRemoteAddress().toString();
|
||||||
+ s1 = com.destroystokyo.paper.PaperConfig.logPlayerIpAddresses ? connection.getRemoteAddress().toString() : "<ip address withheld>"; // Paper
|
+ 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
|
// CraftBukkit end
|
||||||
|
|
||||||
if (nbttagcompound != null) {
|
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 {
|
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||||
player.getRecipeBook().sendInitialRecipeBook(player);
|
player.getRecipeBook().sendInitialRecipeBook(player);
|
||||||
this.updateEntireScoreboard(worldserver1.getScoreboard(), player);
|
this.updateEntireScoreboard(worldserver1.getScoreboard(), player);
|
||||||
@@ -160,7 +177,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ playerconnection.playerJoinReady = () -> {
|
+ playerconnection.playerJoinReady = () -> {
|
||||||
+ postChunkLoadJoin(
|
+ postChunkLoadJoin(
|
||||||
+ player, finalWorldserver, connection, playerconnection,
|
+ player, finalWorldserver, connection, playerconnection,
|
||||||
+ nbttagcompound, connection.getRemoteAddress().toString(), lastKnownName
|
+ nbttagcompound, s1, lastKnownName
|
||||||
+ );
|
+ );
|
||||||
+ };
|
+ };
|
||||||
+ });
|
+ });
|
||||||
|
Reference in New Issue
Block a user