[ci skip] Add more patch identifying comments, cleanup

This commit is contained in:
Nassim Jahnke
2024-01-21 17:39:05 +01:00
parent db4ed47134
commit bc99c40604
31 changed files with 129 additions and 244 deletions

View File

@@ -13,12 +13,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
if (this.shouldSpreadLiquid(world, pos, state)) {
- world.scheduleTick(pos, state.getFluidState().getType(), this.fluid.getTickDelay(world));
+ world.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(world, pos)); // Paper
+ world.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(world, pos)); // Paper - Configurable speed for water flowing over lava
}
}
+ // Paper start - Get flow speed. Throttle if its water and flowing adjacent to lava
+ // Paper start - Configurable speed for water flowing over lava
+ public int getFlowSpeed(Level world, BlockPos blockposition) {
+ if (net.minecraft.core.registries.BuiltInRegistries.FLUID.wrapAsHolder(this.fluid).is(FluidTags.WATER)) {
+ if (
@@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ final FluidState fluidState = world.getFluidIfLoaded(blockPos);
+ return fluidState != null && fluidState.is(FluidTags.LAVA);
+ }
+ // Paper end
+ // Paper end - Configurable speed for water flowing over lava
+
@Override
public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
@@ -46,7 +46,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) {
if (this.shouldSpreadLiquid(world, pos, state)) {
- world.scheduleTick(pos, state.getFluidState().getType(), this.fluid.getTickDelay(world));
+ world.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(world, pos)); // Paper
+ world.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(world, pos)); // Paper - Configurable speed for water flowing over lava
}
}