mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Fix forced respawn with respawn anchor (#8845)
This commit is contained in:
parent
903747cc3a
commit
017665b793
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue