Fix getAddress connection check

This commit is contained in:
Nassim Jahnke 2024-06-16 21:31:39 +02:00
parent 167961e744
commit 106dbae220
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
3 changed files with 12 additions and 3 deletions

View File

@ -35,9 +35,18 @@ index 96355e1da8feb6687ea0069dda4a82fcd7e25e8a..1f696644b958538e9f5d568a2e4bba69
} else { } else {
super.channelRead(ctx, msg); super.channelRead(ctx, msg);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 8d697782fae536377ac29acf967c764ee8a7951a..e41b7191d0cebeb77b8d07a1b5bddc1b695cb922 100644 index 8d697782fae536377ac29acf967c764ee8a7951a..33541edc8bb2d673342448046fa29767f171bbf3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -265,7 +265,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public InetSocketAddress getAddress() {
- if (this.getHandle().connection.protocol() == null) return null;
+ if (this.getHandle().connection == null) return null;
SocketAddress addr = this.getHandle().connection.getRemoteAddress();
if (addr instanceof InetSocketAddress) {
@@ -275,6 +275,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -275,6 +275,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
} }

View File

@ -28629,7 +28629,7 @@ index 8f88ccec6b8947ca2738dc07c23aebe258145c83..cdc704364cf339084537d089e654f607
// Paper start - implement pointers // Paper start - implement pointers
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index e41b7191d0cebeb77b8d07a1b5bddc1b695cb922..ecd975855d92ae5948ee926f42396cb004843aed 100644 index 33541edc8bb2d673342448046fa29767f171bbf3..1bc343df0e7b8e6e3fadc970a4a4c8d787d93828 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3491,12 +3491,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3491,12 +3491,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -20,7 +20,7 @@ index dba09cb32844533c383635e7623f5180a468f636..a88c7113652b268c0fdc355710b00f45
} }
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index ecd975855d92ae5948ee926f42396cb004843aed..c868abef790aa80863721490f69087343aba13e7 100644 index 1bc343df0e7b8e6e3fadc970a4a4c8d787d93828..7eea190ce8a62960ecc42ff56a4ef71b754184fb 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3483,6 +3483,35 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3483,6 +3483,35 @@ public class CraftPlayer extends CraftHumanEntity implements Player {