mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 04:32:11 -07:00
Determine lava and water fluid explosion resistance by their block explosion resistance
When selecting which explosion resistance to use for lava and water, vanilla selects the highest value between their block explosion resistance and fluid explosion resistance. Problems emerge when we want to reduce the explosion resistance of water or lava, since the fluid explosion resistance is hardcoded to return 100.0F and can't be changed by a plugin. This simply makes the fluid explosion resistance the same as the block explosion resistance, which allows plugin to change the value. Since both are the same in vanilla, this has no side effects on servers that do not need to do this.
This commit is contained in:
@@ -42,3 +42,12 @@
|
||||
}
|
||||
|
||||
this.fizz(world, pos);
|
||||
@@ -214,7 +233,7 @@
|
||||
|
||||
@Override
|
||||
protected float getExplosionResistance() {
|
||||
- return 100.0F;
|
||||
+ return Blocks.LAVA.getExplosionResistance(); // Paper - Get explosion resistance from actual block
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -15,3 +15,12 @@
|
||||
protected void beforeDestroyingBlock(LevelAccessor world, BlockPos pos, BlockState state) {
|
||||
BlockEntity blockEntity = state.hasBlockEntity() ? world.getBlockEntity(pos) : null;
|
||||
Block.dropResources(state, world, pos, blockEntity);
|
||||
@@ -119,7 +126,7 @@
|
||||
|
||||
@Override
|
||||
protected float getExplosionResistance() {
|
||||
- return 100.0F;
|
||||
+ return Blocks.WATER.getExplosionResistance(); // Paper - Get explosion resistance from actual block
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user