testserver/patches/server/0667-Fix-anchor-respawn-act...

37 lines
2.0 KiB
Diff
Raw Normal View History

2021-06-11 12:02:28 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: HexedHero <6012891+HexedHero@users.noreply.github.com>
Date: Fri, 23 Apr 2021 22:42:42 +0100
Subject: [PATCH] Fix anchor respawn acting as a bed respawn from the end
portal
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 47217f2eb65f490b9755f151b446904107cb9211..e11bdb3ee9512898dde4575633617658ac4bd951 100644
2021-06-11 12:02:28 +00:00
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
2021-06-17 08:37:27 +00:00
@@ -841,6 +841,7 @@ public abstract class PlayerList {
2021-06-11 12:02:28 +00:00
// Paper start
boolean isBedSpawn = false;
+ boolean isAnchorSpawn = false;
boolean isRespawn = false;
boolean isLocAltered = false; // Paper - Fix SPIGOT-5989
// Paper end
2021-06-17 08:37:27 +00:00
@@ -861,6 +862,7 @@ public abstract class PlayerList {
2021-06-11 12:02:28 +00:00
if (optional.isPresent()) {
BlockState iblockdata = worldserver1.getBlockState(blockposition);
boolean flag3 = iblockdata.is(Blocks.RESPAWN_ANCHOR);
+ isAnchorSpawn = flag3; // Paper - Fix anchor respawn acting as a bed respawn from the end portal
Vec3 vec3d = (Vec3) optional.get();
float f1;
2021-06-17 08:37:27 +00:00
@@ -888,7 +890,7 @@ public abstract class PlayerList {
2021-06-11 12:02:28 +00:00
}
2021-06-15 02:59:31 +00:00
Player respawnPlayer = this.cserver.getPlayer(entityplayer1);
2021-06-11 12:02:28 +00:00
- PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn && !flag2, flag2);
+ PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn && !isAnchorSpawn, isAnchorSpawn); // Paper - Fix anchor respawn acting as a bed respawn from the end portal
2021-06-15 02:59:31 +00:00
this.cserver.getPluginManager().callEvent(respawnEvent);
2021-06-11 12:02:28 +00:00
// Spigot Start
if (entityplayer.connection.isDisconnected()) {