aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0641-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch
blob: 576aa63f5a491564917c784a0a5d4b8b6a88d4fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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 2c011416ee3b1c57a1ee95ba0a120c784b8f87b2..1f1d5a1fe4fc567a383e60bd9b0dc69d8da673cb 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -851,6 +851,7 @@ public abstract class PlayerList {
 
         // Paper start
         boolean isBedSpawn = false;
+        boolean isAnchorSpawn = false;
         boolean isRespawn = false;
         boolean isLocAltered = false; // Paper - Fix SPIGOT-5989
         // Paper end
@@ -871,6 +872,7 @@ public abstract class PlayerList {
                 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;
 
@@ -899,7 +901,7 @@ public abstract class PlayerList {
             }
 
             Player respawnPlayer = entityplayer1.getBukkitEntity();
-            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
             this.cserver.getPluginManager().callEvent(respawnEvent);
             // Spigot Start
             if (entityplayer.connection.isDisconnected()) {