From 017665b79348900dcb86082649d08e5d39023e01 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Sun, 26 Feb 2023 09:38:42 -0800 Subject: [PATCH] Fix forced respawn with respawn anchor (#8845) --- patches/server/Fix-SPIGOT-5989.patch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/patches/server/Fix-SPIGOT-5989.patch b/patches/server/Fix-SPIGOT-5989.patch index 6385f09221..43a6fe4515 100644 --- a/patches/server/Fix-SPIGOT-5989.patch +++ b/patches/server/Fix-SPIGOT-5989.patch @@ -52,8 +52,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - entityplayer1.connection.send(new ClientboundSoundPacket(SoundEvents.RESPAWN_ANCHOR_DEPLETE, SoundSource.BLOCKS, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), 1.0F, 1.0F, worldserver1.getRandom().nextLong())); + // Paper start - Fix SPIGOT-5989 + if (flag2 && !isLocAltered) { -+ BlockState data = worldserver1.getBlockState(blockposition); -+ worldserver1.setBlock(blockposition, data.setValue(net.minecraft.world.level.block.RespawnAnchorBlock.CHARGE, data.getValue(net.minecraft.world.level.block.RespawnAnchorBlock.CHARGE) - 1), 3); ++ if (!flag1) { ++ BlockState data = worldserver1.getBlockState(blockposition); ++ worldserver1.setBlock(blockposition, data.setValue(net.minecraft.world.level.block.RespawnAnchorBlock.CHARGE, data.getValue(net.minecraft.world.level.block.RespawnAnchorBlock.CHARGE) - 1), 3); ++ } + entityplayer1.connection.send(new ClientboundSoundPacket(SoundEvents.RESPAWN_ANCHOR_DEPLETE, SoundSource.BLOCKS, (double) location.getX(), (double) location.getY(), (double) location.getZ(), 1.0F, 1.0F, worldserver1.getRandom().nextLong())); + // Paper end }