2021-06-11 14:02:28 +02: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
2023-11-04 22:11:55 +01:00
index 504bed9e3baa3bdd1c4d913d033ac8d0bd7cfc24..289e5609b74c254ca95680eaf592bdcdb253c9ce 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
2023-11-04 22:11:55 +01:00
@@ -826,6 +826,7 @@ public abstract class PlayerList {
2021-06-11 14:02:28 +02:00
// Paper start
boolean isBedSpawn = false;
+ boolean isAnchorSpawn = false;
boolean isRespawn = false;
boolean isLocAltered = false; // Paper - Fix SPIGOT-5989
// Paper end
2023-11-04 22:11:55 +01:00
@@ -846,6 +847,7 @@ public abstract class PlayerList {
2021-06-11 14:02:28 +02: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;
2023-11-04 22:11:55 +01:00
@@ -874,7 +876,7 @@ public abstract class PlayerList {
2021-06-11 14:02:28 +02:00
}
2021-06-20 21:25:59 +02:00
Player respawnPlayer = entityplayer1.getBukkitEntity();
2023-04-10 10:03:36 +02:00
- PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn && !flag2, flag2, reason);
+ PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn && !isAnchorSpawn, isAnchorSpawn, reason); // Paper - Fix anchor respawn acting as a bed respawn from the end portal
2021-06-15 04:59:31 +02:00
this.cserver.getPluginManager().callEvent(respawnEvent);
2021-06-11 14:02:28 +02:00
// Spigot Start
if (entityplayer.connection.isDisconnected()) {