Commits

Doc authored 12e3260cb9d
SPIGOT-8021: Fix exception when respawn of player is set
No tags

nms-patches/net/minecraft/server/level/EntityPlayer.patch

Modified
1078 1078 + // CraftBukkit start
1079 1079 + this.setRespawnPosition(entityplayer_respawnconfig, flag, PlayerSpawnChangeEvent.Cause.UNKNOWN);
1080 1080 + }
1081 1081 +
1082 1082 + public void setRespawnPosition(@Nullable EntityPlayer.RespawnConfig entityplayer_respawnconfig, boolean flag, PlayerSpawnChangeEvent.Cause cause) {
1083 1083 + Location newSpawn = null;
1084 1084 + boolean forced = false;
1085 1085 + if (entityplayer_respawnconfig != null) {
1086 1086 + WorldServer newWorld = this.server.getLevel(entityplayer_respawnconfig.dimension());
1087 1087 + newSpawn = CraftLocation.toBukkit(entityplayer_respawnconfig.pos(), newWorld.getWorld(), entityplayer_respawnconfig.angle(), 0);
1088 -+ forced = respawnConfig.forced();
1088 ++ forced = entityplayer_respawnconfig.forced();
1089 1089 + }
1090 1090 +
1091 1091 + PlayerSpawnChangeEvent event = new PlayerSpawnChangeEvent(this.getBukkitEntity(), newSpawn, forced, cause);
1092 1092 + Bukkit.getServer().getPluginManager().callEvent(event);
1093 1093 + if (event.isCancelled()) {
1094 1094 + return;
1095 1095 + }
1096 1096 + newSpawn = event.getNewSpawn();
1097 1097 +
1098 1098 + if (newSpawn != null) {

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut