Fix more null pointer issues around deleted worlds - Fixes #3660

This commit is contained in:
Aikar
2020-06-28 18:44:34 -04:00
parent 8736217b0f
commit 58d7a7ae1d
5 changed files with 18 additions and 85 deletions

View File

@@ -61,9 +61,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - correctly register player BEFORE PlayerJoinEvent, so the entity is valid and doesn't require tick delay hacks
+ entityplayer.supressTrackerForLogin = true;
+ worldserver.addPlayerJoin(entityplayer);
+ worldserver1.addPlayerJoin(entityplayer);
+ this.server.getBossBattleCustomData().a(entityplayer); // see commented out section below worldserver.addPlayerJoin(entityplayer);
+ mountSavedVehicle(entityplayer, worldserver, nbttagcompound);
+ mountSavedVehicle(entityplayer, worldserver1, nbttagcompound);
+ // Paper end
// CraftBukkit start
PlayerJoinEvent playerJoinEvent = new PlayerJoinEvent(cserver.getPlayer(entityplayer), joinMessage);
@@ -82,9 +82,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
+ // Paper start - move vehicle into method so it can be called above - short circuit around that code
+ onPlayerJoinFinish(entityplayer, worldserver, s1);
+ onPlayerJoinFinish(entityplayer, worldserver1, s1);
+ }
+ private void mountSavedVehicle(EntityPlayer entityplayer, WorldServer worldserver, NBTTagCompound nbttagcompound) {
+ private void mountSavedVehicle(EntityPlayer entityplayer, WorldServer worldserver1, NBTTagCompound nbttagcompound) {
+ // Paper end
if (nbttagcompound != null && nbttagcompound.hasKeyOfType("RootVehicle", 10)) {
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("RootVehicle");