mirror of
https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git
synced 2024-11-22 10:06:16 +00:00
40 lines
3.0 KiB
Diff
40 lines
3.0 KiB
Diff
--- a/net/minecraft/world/level/block/BlockRespawnAnchor.java
|
|
+++ b/net/minecraft/world/level/block/BlockRespawnAnchor.java
|
|
@@ -88,7 +88,7 @@
|
|
EntityPlayer entityplayer = (EntityPlayer) entityhuman;
|
|
|
|
if (entityplayer.getRespawnDimension() != world.dimension() || !blockposition.equals(entityplayer.getRespawnPosition())) {
|
|
- entityplayer.setRespawnPosition(world.dimension(), blockposition, 0.0F, false, true);
|
|
+ entityplayer.setRespawnPosition(world.dimension(), blockposition, 0.0F, false, true, org.bukkit.event.player.PlayerSpawnChangeEvent.Cause.RESPAWN_ANCHOR); // CraftBukkit
|
|
world.playSound((EntityHuman) null, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, SoundEffects.RESPAWN_ANCHOR_SET_SPAWN, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
|
return EnumInteractionResult.SUCCESS_SERVER;
|
|
}
|
|
@@ -127,15 +127,16 @@
|
|
}
|
|
|
|
private void explode(IBlockData iblockdata, World world, final BlockPosition blockposition) {
|
|
+ org.bukkit.block.BlockState blockState = org.bukkit.craftbukkit.block.CraftBlock.at(world, blockposition).getState(); // CraftBukkit - capture BlockState before remove block
|
|
world.removeBlock(blockposition, false);
|
|
- Stream stream = EnumDirection.EnumDirectionLimit.HORIZONTAL.stream();
|
|
+ Stream<EnumDirection> stream = EnumDirection.EnumDirectionLimit.HORIZONTAL.stream(); // CraftBukkit - decompile error
|
|
|
|
Objects.requireNonNull(blockposition);
|
|
boolean flag = stream.map(blockposition::relative).anyMatch((blockposition1) -> {
|
|
return isWaterThatWouldFlow(blockposition1, world);
|
|
});
|
|
final boolean flag1 = flag || world.getFluidState(blockposition.above()).is(TagsFluid.WATER);
|
|
- ExplosionDamageCalculator explosiondamagecalculator = new ExplosionDamageCalculator(this) {
|
|
+ ExplosionDamageCalculator explosiondamagecalculator = new ExplosionDamageCalculator() { // CraftBukkit - decompile error
|
|
@Override
|
|
public Optional<Float> getBlockExplosionResistance(Explosion explosion, IBlockAccess iblockaccess, BlockPosition blockposition1, IBlockData iblockdata1, Fluid fluid) {
|
|
return blockposition1.equals(blockposition) && flag1 ? Optional.of(Blocks.WATER.getExplosionResistance()) : super.getBlockExplosionResistance(explosion, iblockaccess, blockposition1, iblockdata1, fluid);
|
|
@@ -143,7 +144,7 @@
|
|
};
|
|
Vec3D vec3d = blockposition.getCenter();
|
|
|
|
- world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d), explosiondamagecalculator, vec3d, 5.0F, true, World.a.BLOCK);
|
|
+ world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, blockState), explosiondamagecalculator, vec3d, 5.0F, true, World.a.BLOCK); // CraftBukkit - add state
|
|
}
|
|
|
|
public static boolean canSetSpawn(World world) {
|