Only get spawn block if it's relevant, fixes #3934 (#3942)

This commit is contained in:
Mariell 2020-07-19 14:58:29 +02:00 committed by GitHub
parent 19b58a9f77
commit dc80610ff3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@ This fixes that by checking if the modified spawn location is
still at a respawn anchor.
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 3c2f1f140c3991195bb8147bd65d9cd16a8fd3da..b8ec7941784885ace0c33fdf768ddcba284a12f9 100644
index 9e438590113b2c7a318c812637c8aa14341df3e6..9382e8f79e8edec8885c629a36e230fbec50e1fb 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -766,6 +766,7 @@ public abstract class PlayerList {
@ -51,8 +51,8 @@ index 3c2f1f140c3991195bb8147bd65d9cd16a8fd3da..b8ec7941784885ace0c33fdf768ddcba
- if (flag2) {
- entityplayer1.playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect(SoundEffects.BLOCK_RESPAWN_ANCHOR_DEPLETE, SoundCategory.BLOCKS, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), 1.0F, 1.0F));
+ // Paper start - Fix SPIGOT-5989
+ IBlockData data = worldserver1.getType(blockposition);
+ if (flag2 && !isLocAltered) {
+ IBlockData data = worldserver1.getType(blockposition);
+ worldserver1.setTypeAndData(blockposition, data.set(BlockRespawnAnchor.a, data.get(BlockRespawnAnchor.a) - 1), 3);
+ entityplayer1.playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect(SoundEffects.BLOCK_RESPAWN_ANCHOR_DEPLETE, SoundCategory.BLOCKS, (double) location.getX(), (double) location.getY(), (double) location.getZ(), 1.0F, 1.0F));
+ // Paper end