mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Add ability to configure frosted_ice properties
This commit is contained in:
parent
3532e55dab
commit
217a52eaa8
1 changed files with 24 additions and 0 deletions
|
@ -0,0 +1,24 @@
|
|||
--- a/net/minecraft/world/level/block/FrostedIceBlock.java
|
||||
+++ b/net/minecraft/world/level/block/FrostedIceBlock.java
|
||||
@@ -42,6 +42,7 @@
|
||||
|
||||
@Override
|
||||
protected void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||
+ if (!world.paperConfig().environment.frostedIce.enabled) return; // Paper - Frosted ice options
|
||||
if ((random.nextInt(3) == 0 || this.fewerNeigboursThan(world, pos, 4))
|
||||
&& world.getMaxLocalRawBrightness(pos) > 11 - state.getValue(AGE) - state.getLightBlock()
|
||||
&& this.slightlyMelt(state, world, pos)) {
|
||||
@@ -51,11 +52,11 @@
|
||||
mutableBlockPos.setWithOffset(pos, direction);
|
||||
BlockState blockState = world.getBlockState(mutableBlockPos);
|
||||
if (blockState.is(this) && !this.slightlyMelt(blockState, world, mutableBlockPos)) {
|
||||
- world.scheduleTick(mutableBlockPos, this, Mth.nextInt(random, 20, 40));
|
||||
+ world.scheduleTick(mutableBlockPos, this, Mth.nextInt(random, world.paperConfig().environment.frostedIce.delay.min, world.paperConfig().environment.frostedIce.delay.max)); // Paper - Frosted ice options
|
||||
}
|
||||
}
|
||||
} else {
|
||||
- world.scheduleTick(pos, this, Mth.nextInt(random, 20, 40));
|
||||
+ world.scheduleTick(pos, this, Mth.nextInt(random, world.paperConfig().environment.frostedIce.delay.min, world.paperConfig().environment.frostedIce.delay.max)); // Paper - Frosted ice options
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in a new issue