1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-02-17 18:47:40 +01: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:
galacticwarrior9 2023-07-13 21:32:13 +01:00
parent 5b7b25844e
commit 6f37c3e39b
2 changed files with 18 additions and 0 deletions
paper-server/patches/sources/net/minecraft/world/level/material

View file

@ -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

View file

@ -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