From e95ba8a3dc8737cfaf34d0576753adaa48eb1f7f Mon Sep 17 00:00:00 2001 From: Robert Skalko Date: Fri, 14 Feb 2020 21:34:41 +0100 Subject: [PATCH] Fix NPE when players rejoin the server in a dimension that was deleted (#6511) --- .../net/minecraft/server/management/PlayerList.java.patch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/patches/minecraft/net/minecraft/server/management/PlayerList.java.patch b/patches/minecraft/net/minecraft/server/management/PlayerList.java.patch index 3a62040f9..993a5fb4f 100644 --- a/patches/minecraft/net/minecraft/server/management/PlayerList.java.patch +++ b/patches/minecraft/net/minecraft/server/management/PlayerList.java.patch @@ -8,12 +8,14 @@ public PlayerList(MinecraftServer p_i50688_1_, int p_i50688_2_) { this.field_72400_f = p_i50688_1_; -@@ -110,6 +111,14 @@ +@@ -109,7 +110,15 @@ + String s = gameprofile1 == null ? gameprofile.getName() : gameprofile1.getName(); playerprofilecache.func_152649_a(gameprofile); CompoundNBT compoundnbt = this.func_72380_a(p_72355_2_); - ServerWorld serverworld = this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK); +- ServerWorld serverworld = this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK); + + //Forge: Make sure the dimension hasn't been deleted, if so stick them in the overworld. ++ ServerWorld serverworld = p_72355_2_.field_71093_bK != null ? this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK) : null ; + if (serverworld == null) { + p_72355_2_.field_71093_bK = DimensionType.field_223227_a_; + serverworld = this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK);