diff options
author | Jake Potrebic <[email protected]> | 2021-06-29 16:10:23 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2021-06-30 00:10:23 +0100 |
commit | 06b0b573d325ef480983b5ab254cc3b32c108a2b (patch) | |
tree | f0139c5ee31da37885c3ff73d67f21ed8751003f | |
parent | 903fa9a33fcaab03e67343d010558c738bcea84e (diff) | |
download | Paper-06b0b573d325ef480983b5ab254cc3b32c108a2b.tar.gz Paper-06b0b573d325ef480983b5ab254cc3b32c108a2b.zip |
Fix NPE for msg send on player join (#6041)
9 files changed, 21 insertions, 20 deletions
diff --git a/Spigot-Server-Patches/0010-Adventure.patch b/Spigot-Server-Patches/0010-Adventure.patch index d871f43df4..e140b9383c 100644 --- a/Spigot-Server-Patches/0010-Adventure.patch +++ b/Spigot-Server-Patches/0010-Adventure.patch @@ -1828,7 +1828,7 @@ index 0c1e12b0b43f949d4ace600b2ccdffe52faab1e6..2ad09749f3005c3eff143d83580e2591 // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 3b48799d084f14722f815cb35cbd48b618380fca..cf6d350e6afc46bb58678192fe0b24b7d923412e 100644 +index 05aedca561919a12ced1925c5cc9af585bb04523..ce9f10f890a5866ab6208c7253b15b09fe323a81 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -19,6 +19,12 @@ public class Main { @@ -2126,7 +2126,7 @@ index 816f2cbebe849a9d9533f985298bcd5d36f660eb..24e856473a0050c0b097c17977635037 player.activeContainer.addSlotListener(player); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index b51a874e4665f977a154792e6216e03e04525f39..6ab14bccb1fcd108931bf7ec331e60f652e0b42d 100644 +index b51a874e4665f977a154792e6216e03e04525f39..eb666f85ea74172e7beee7911e0ed383cd73548f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -240,14 +240,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2309,7 +2309,7 @@ index b51a874e4665f977a154792e6216e03e04525f39..6ab14bccb1fcd108931bf7ec331e60f6 @Override public int getPing() { return getHandle().ping; -@@ -1716,6 +1790,138 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1716,6 +1790,139 @@ public class CraftPlayer extends CraftHumanEntity implements Player { getInventory().setItemInMainHand(hand); } @@ -2327,6 +2327,7 @@ index b51a874e4665f977a154792e6216e03e04525f39..6ab14bccb1fcd108931bf7ec331e60f6 + + @Override + public void sendMessage(final net.kyori.adventure.identity.Identity identity, final net.kyori.adventure.text.Component message, final net.kyori.adventure.audience.MessageType type) { ++ if (this.getHandle().playerConnection == null) return; + final PacketPlayOutChat packet = new PacketPlayOutChat(null, type == net.kyori.adventure.audience.MessageType.CHAT ? net.minecraft.network.chat.ChatMessageType.CHAT : net.minecraft.network.chat.ChatMessageType.SYSTEM, identity.uuid()); + packet.adventure$message = message; + this.getHandle().playerConnection.sendPacket(packet); diff --git a/Spigot-Server-Patches/0278-Expose-attack-cooldown-methods-for-Player.patch b/Spigot-Server-Patches/0278-Expose-attack-cooldown-methods-for-Player.patch index 74caa5c1f1..387c92b284 100644 --- a/Spigot-Server-Patches/0278-Expose-attack-cooldown-methods-for-Player.patch +++ b/Spigot-Server-Patches/0278-Expose-attack-cooldown-methods-for-Player.patch @@ -17,10 +17,10 @@ index b6effe1037f3ae59e6faa5f5d039b6ad54bca5d4..87374174dcbf9e7ee448a1cdd9a35285 return (float) (1.0D / this.b(GenericAttributes.ATTACK_SPEED) * 20.0D); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index ee3fbf0789b4841a113727397ba6809b2600ff83..a13867ff6d188e7633a91f1e1600116286ac0cd4 100644 +index 7bb674147117e00fd5de55c9e8c524b389bb3104..70163b3c755e63285b11bb22dab3e4b537b8ef23 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2189,6 +2189,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2190,6 +2190,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { connection.sendPacket(new net.minecraft.network.protocol.game.PacketPlayOutOpenBook(net.minecraft.world.EnumHand.MAIN_HAND)); connection.sendPacket(new net.minecraft.network.protocol.game.PacketPlayOutSetSlot(0, slot, inventory.getItemInHand())); } diff --git a/Spigot-Server-Patches/0322-Block-Entity-remove-from-being-called-on-Players.patch b/Spigot-Server-Patches/0322-Block-Entity-remove-from-being-called-on-Players.patch index 64d8d081f7..147c302fe0 100644 --- a/Spigot-Server-Patches/0322-Block-Entity-remove-from-being-called-on-Players.patch +++ b/Spigot-Server-Patches/0322-Block-Entity-remove-from-being-called-on-Players.patch @@ -12,10 +12,10 @@ Player we will look at limiting the scope of this change. It appears to be unintentional in the few cases we've seen so far. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 25e0d0dd7b114560896679f0314cea288d7a768c..f57ad014fb3d2ce2405bdd63db4c730458aac17a 100644 +index 840edab739dada3f1459328a90e0e92e7cf2375e..abfbf942521d5abe14ab6cdeedc29591d3f54e6e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2234,6 +2234,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2235,6 +2235,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void resetCooldown() { getHandle().resetAttackCooldown(); } diff --git a/Spigot-Server-Patches/0345-Per-Player-View-Distance-API-placeholders.patch b/Spigot-Server-Patches/0345-Per-Player-View-Distance-API-placeholders.patch index 5fca2ee643..88a532a44e 100644 --- a/Spigot-Server-Patches/0345-Per-Player-View-Distance-API-placeholders.patch +++ b/Spigot-Server-Patches/0345-Per-Player-View-Distance-API-placeholders.patch @@ -40,10 +40,10 @@ index 145767e8b0fc4105a0afa47af17dcdbb75e952bc..174eb12722872182b2d9b54841e5bb57 double deltaZ = this.locZ() - player.locZ(); double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index f57ad014fb3d2ce2405bdd63db4c730458aac17a..dc8545241ed62f6b654b2559e025c3b34c00575f 100644 +index abfbf942521d5abe14ab6cdeedc29591d3f54e6e..b6f558eb6e76a50aa8a0012a879f88376086e44e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2243,6 +2243,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2244,6 +2244,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { super.remove(); } } diff --git a/Spigot-Server-Patches/0446-Implement-Player-Client-Options-API.patch b/Spigot-Server-Patches/0446-Implement-Player-Client-Options-API.patch index 92a17b9c3a..0b0b3841b3 100644 --- a/Spigot-Server-Patches/0446-Implement-Player-Client-Options-API.patch +++ b/Spigot-Server-Patches/0446-Implement-Player-Client-Options-API.patch @@ -149,7 +149,7 @@ index 8981dfacd10cae9de052e1b36ce5181cd0e6752d..202fa94d5dc55b549475ae0309bbcfca protected static final DataWatcherObject<NBTTagCompound> bk = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p); protected static final DataWatcherObject<NBTTagCompound> bl = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index dc8545241ed62f6b654b2559e025c3b34c00575f..935b5668a81db4d19a08b09c61519114532a23d9 100644 +index b6f558eb6e76a50aa8a0012a879f88376086e44e..c218a2c02f5aefc9105fea371119abb2b3118368 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1,5 +1,8 @@ @@ -161,7 +161,7 @@ index dc8545241ed62f6b654b2559e025c3b34c00575f..935b5668a81db4d19a08b09c61519114 import com.destroystokyo.paper.Title; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableSet; -@@ -2253,6 +2256,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2254,6 +2257,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void setViewDistance(int viewDistance) { throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO } diff --git a/Spigot-Server-Patches/0545-Brand-support.patch b/Spigot-Server-Patches/0545-Brand-support.patch index eb075ada53..7b0584d69b 100644 --- a/Spigot-Server-Patches/0545-Brand-support.patch +++ b/Spigot-Server-Patches/0545-Brand-support.patch @@ -73,10 +73,10 @@ index 8f3dd1493f3a8121376f79632b3941cf642219a7..d3449dc9eeba0d8022c3a7b0280eaffc return (!this.player.joining && !this.networkManager.isConnected()) || this.processedDisconnect; // Paper } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 0f8d10c2bc7728b58528096fc0686c3aeee623a7..18d7cf6e783843d44715210b7c8db7bf0a5c89ae 100644 +index e2f5d2b5e237be3f0ff5fa72a3bef2bf3b6dfd5f..30f21b0d6017fcf8801543296be69a0b717c8fac 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2388,6 +2388,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2389,6 +2389,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Paper end }; diff --git a/Spigot-Server-Patches/0586-Player-elytra-boost-API.patch b/Spigot-Server-Patches/0586-Player-elytra-boost-API.patch index aed9bb2247..28bdd3f587 100644 --- a/Spigot-Server-Patches/0586-Player-elytra-boost-API.patch +++ b/Spigot-Server-Patches/0586-Player-elytra-boost-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Player elytra boost API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 18d7cf6e783843d44715210b7c8db7bf0a5c89ae..8337ed8bb20b8d887bcd71ddc5f29bce346c7cff 100644 +index 30f21b0d6017fcf8801543296be69a0b717c8fac..b4eee7f78f8950432af69e232b96062af97ed51f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -69,12 +69,14 @@ import net.minecraft.world.entity.ai.attributes.AttributeMapBase; @@ -23,7 +23,7 @@ index 18d7cf6e783843d44715210b7c8db7bf0a5c89ae..8337ed8bb20b8d887bcd71ddc5f29bce import net.minecraft.world.level.biome.BiomeManager; import net.minecraft.world.level.block.entity.TileEntitySign; import net.minecraft.world.level.saveddata.maps.MapIcon; -@@ -2284,6 +2286,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2285,6 +2287,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } throw new RuntimeException("Unknown settings type"); } diff --git a/Spigot-Server-Patches/0646-Add-sendOpLevel-API.patch b/Spigot-Server-Patches/0646-Add-sendOpLevel-API.patch index 382d088024..d15d708345 100644 --- a/Spigot-Server-Patches/0646-Add-sendOpLevel-API.patch +++ b/Spigot-Server-Patches/0646-Add-sendOpLevel-API.patch @@ -32,10 +32,10 @@ index cf457f6b6ee2968f68f4eede30bb703a6a4f990b..1358993217e601e3bab6e0a4e8c55d55 // Paper start diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 41987716afa8ec34214868373df97d0e8f8b27c1..e81de526a847c730abf86016354c1dc57780ec8b 100644 +index af1f76692207bb3b5fa895be77c00501f08b2969..dc64a22e6b232909902d738c3587fcfa7b9d99cb 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2300,6 +2300,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2301,6 +2301,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { ? (org.bukkit.entity.Firework) entity.getBukkitEntity() : null; } diff --git a/Spigot-Server-Patches/0675-Expose-Tracked-Players.patch b/Spigot-Server-Patches/0675-Expose-Tracked-Players.patch index 5bb7b3c9ef..ffa091cba1 100644 --- a/Spigot-Server-Patches/0675-Expose-Tracked-Players.patch +++ b/Spigot-Server-Patches/0675-Expose-Tracked-Players.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Expose Tracked Players diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index f7223f214f911dd25abcf3a52745588ec630241d..7abeeefeb579a43bc9ee85fd4150afacfb11c802 100644 +index bcb4ac7a3ca009b68498534eddc98d40bffeaf12..04127554c330aaa4e1685fb77058ed92def4ba80 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -172,7 +172,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne @@ -18,7 +18,7 @@ index f7223f214f911dd25abcf3a52745588ec630241d..7abeeefeb579a43bc9ee85fd4150afac public Throwable addedToWorldStack; // Paper - entity debug public CraftEntity getBukkitEntity() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index e81de526a847c730abf86016354c1dc57780ec8b..05248f560d643080a3eac581c01aa89fb3709e6c 100644 +index dc64a22e6b232909902d738c3587fcfa7b9d99cb..5d4bcca1689efa0c94801faa48eb63315b884108 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -16,6 +16,7 @@ import java.net.InetSocketAddress; @@ -29,7 +29,7 @@ index e81de526a847c730abf86016354c1dc57780ec8b..05248f560d643080a3eac581c01aa89f import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; -@@ -2309,6 +2310,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2310,6 +2311,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end |