Archiviert
13
0

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

Dieser Commit ist enthalten in:
Mariell 2020-07-19 14:58:29 +02:00 committet von GitHub
Ursprung 19b58a9f77
Commit dc80610ff3
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -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