mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 20:52:12 -07:00
[ci skip] Add more patch identifying comments
This commit is contained in:
@@ -25,10 +25,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
return this.source(DamageTypes.SONIC_BOOM, attacker);
|
||||
}
|
||||
|
||||
+ @Deprecated @io.papermc.paper.annotation.DoNotUse // Paper
|
||||
+ @Deprecated @io.papermc.paper.annotation.DoNotUse // Paper - add exploded state
|
||||
public DamageSource badRespawnPointExplosion(Vec3 position) {
|
||||
- return new DamageSource(this.damageTypes.getHolderOrThrow(DamageTypes.BAD_RESPAWN_POINT), position);
|
||||
+ // Paper start
|
||||
+ // Paper start - add exploded state
|
||||
+ return this.badRespawnPointExplosion(position, null);
|
||||
+ }
|
||||
+
|
||||
@@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ DamageSource source = new DamageSource(this.damageTypes.getHolderOrThrow(DamageTypes.BAD_RESPAWN_POINT), position);
|
||||
+ source.explodedBlockState = explodedBlockState;
|
||||
+ return source;
|
||||
+ // Paper end
|
||||
+ // Paper end - add exploded state
|
||||
}
|
||||
|
||||
public DamageSource outOfBorder() {
|
||||
@@ -49,7 +49,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.yield = event.getYield();
|
||||
} else {
|
||||
- BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, this.yield);
|
||||
+ BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, this.yield, this.damageSource.explodedBlockState); // Paper - exploded block state
|
||||
+ BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, this.yield, this.damageSource.explodedBlockState); // Paper - add exploded state
|
||||
this.level.getCraftServer().getPluginManager().callEvent(event);
|
||||
this.wasCanceled = event.isCancelled();
|
||||
bukkitBlocks = event.blockList();
|
||||
@@ -61,7 +61,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
// CraftBukkit - moved world and biome check into EntityHuman
|
||||
if (false && !BedBlock.canSetSpawn(world)) {
|
||||
+ final org.bukkit.block.BlockState explodedBlockState = org.bukkit.craftbukkit.block.CraftBlockStates.getUnplacedBlockState(world, pos, state); // Paper - exploded block state (this won't be called due to the false, but it's good for reference)
|
||||
+ final org.bukkit.block.BlockState explodedBlockState = org.bukkit.craftbukkit.block.CraftBlockStates.getUnplacedBlockState(world, pos, state); // Paper - add exploded state (this won't be called due to the false, but it's good for reference)
|
||||
world.removeBlock(pos, false);
|
||||
BlockPos blockposition1 = pos.relative(((Direction) state.getValue(BedBlock.FACING)).getOpposite());
|
||||
|
||||
@@ -70,7 +70,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
Vec3 vec3d = pos.getCenter();
|
||||
|
||||
- world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK);
|
||||
+ world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK);
|
||||
+ world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); // Paper - add exploded state
|
||||
return InteractionResult.SUCCESS;
|
||||
} else if ((Boolean) state.getValue(BedBlock.OCCUPIED)) {
|
||||
if (!this.kickVillagerOutOfBed(world, pos)) {
|
||||
@@ -78,7 +78,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
private InteractionResult explodeBed(BlockState iblockdata, Level world, BlockPos blockposition) {
|
||||
{
|
||||
{
|
||||
+ final org.bukkit.block.BlockState explodedBlockState = org.bukkit.craftbukkit.block.CraftBlockStates.getUnplacedBlockState(world, blockposition, iblockdata); // Paper - exploded block state
|
||||
+ final org.bukkit.block.BlockState explodedBlockState = org.bukkit.craftbukkit.block.CraftBlockStates.getUnplacedBlockState(world, blockposition, iblockdata); // Paper - add exploded state
|
||||
world.removeBlock(blockposition, false);
|
||||
BlockPos blockposition1 = blockposition.relative(((Direction) iblockdata.getValue(BedBlock.FACING)).getOpposite());
|
||||
|
||||
@@ -87,7 +87,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
Vec3 vec3d = blockposition.getCenter();
|
||||
|
||||
- world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK);
|
||||
+ world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK);
|
||||
+ world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); // Paper - add exploded state
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -99,7 +99,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
|
||||
private void explode(BlockState state, Level world, final BlockPos explodedPos) {
|
||||
+ final org.bukkit.block.BlockState explodedBlockState = org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(explodedPos, state, null); // Paper - exploded block state
|
||||
+ final org.bukkit.block.BlockState explodedBlockState = org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(explodedPos, state, null); // Paper - add exploded state
|
||||
world.removeBlock(explodedPos, false);
|
||||
Stream<Direction> stream = Direction.Plane.HORIZONTAL.stream(); // CraftBukkit - decompile error
|
||||
|
||||
@@ -108,7 +108,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
Vec3 vec3d = explodedPos.getCenter();
|
||||
|
||||
- world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d), explosiondamagecalculator, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK);
|
||||
+ world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, explodedBlockState), explosiondamagecalculator, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); // Paper
|
||||
+ world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, explodedBlockState), explosiondamagecalculator, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); // Paper - add exploded state
|
||||
}
|
||||
|
||||
public static boolean canSetSpawn(Level world) {
|
||||
@@ -120,12 +120,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
BlockEntity tileEntity = (blockEntityTag == null) ? null : BlockEntity.loadStatic(blockPosition, blockData, blockEntityTag);
|
||||
return CraftBlockStates.getBlockState(null, blockPosition, blockData, tileEntity);
|
||||
}
|
||||
+ // Paper start
|
||||
+ // Paper start - add exploded state
|
||||
+ public static BlockState getUnplacedBlockState(net.minecraft.world.level.BlockGetter levelAccessor, BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockData) {
|
||||
+ BlockEntity tileEntity = levelAccessor.getBlockEntity(blockPos);
|
||||
+ return CraftBlockStates.getBlockState(null, blockPos, blockData, tileEntity);
|
||||
+ }
|
||||
+ // Paper end
|
||||
+ // Paper end - add exploded state
|
||||
|
||||
// See BlockStateFactory#createBlockState(World, BlockPosition, IBlockData, TileEntity)
|
||||
private static CraftBlockState getBlockState(World world, BlockPos blockPosition, net.minecraft.world.level.block.state.BlockState blockData, BlockEntity tileEntity) {
|
||||
@@ -138,7 +138,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
EntityDamageEvent event;
|
||||
if (damager == null) {
|
||||
- event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.BLOCK_EXPLOSION, modifiers, modifierFunctions);
|
||||
+ event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.BLOCK_EXPLOSION, modifiers, modifierFunctions, source.explodedBlockState); // Paper - handle block state in damage
|
||||
+ event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.BLOCK_EXPLOSION, modifiers, modifierFunctions, source.explodedBlockState); // Paper - add exploded state
|
||||
} else if (entity instanceof EnderDragon && /*PAIL FIXME ((EntityEnderDragon) entity).target == damager*/ false) {
|
||||
event = new EntityDamageEvent(entity.getBukkitEntity(), DamageCause.ENTITY_EXPLOSION, modifiers, modifierFunctions);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user