mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 12:27:59 +01:00
Add fire-tick-delay option
This commit is contained in:
parent
d9db4d694b
commit
8c11cd85e3
@ -48,8 +48,12 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -149,7 +174,7 @@
|
||||
world.scheduleTick(pos, (Block) this, FireBlock.getFireTickDelay(world.random));
|
||||
@@ -146,10 +171,10 @@
|
||||
|
||||
@Override
|
||||
protected void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||
- world.scheduleTick(pos, (Block) this, FireBlock.getFireTickDelay(world.random));
|
||||
+ world.scheduleTick(pos, (Block) this, FireBlock.getFireTickDelay(world)); // Paper - Add fire-tick-delay option
|
||||
if (world.getGameRules().getBoolean(GameRules.RULE_DOFIRETICK)) {
|
||||
if (!state.canSurvive(world, pos)) {
|
||||
- world.removeBlock(pos, false);
|
||||
@ -178,7 +182,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,9 +368,11 @@
|
||||
@@ -310,13 +368,15 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -189,7 +193,13 @@
|
||||
+ protected void onPlace(BlockState iblockdata, Level world, BlockPos blockposition, BlockState iblockdata1, boolean flag, UseOnContext context) {
|
||||
+ super.onPlace(iblockdata, world, blockposition, iblockdata1, flag, context);
|
||||
+ // CraftBukkit end
|
||||
+ world.scheduleTick(blockposition, (Block) this, FireBlock.getFireTickDelay(world.random));
|
||||
+ world.scheduleTick(blockposition, (Block) this, FireBlock.getFireTickDelay(world)); // Paper - Add fire-tick-delay option
|
||||
}
|
||||
|
||||
private static int getFireTickDelay(RandomSource random) {
|
||||
- private static int getFireTickDelay(RandomSource random) {
|
||||
- return 30 + random.nextInt(10);
|
||||
+ private static int getFireTickDelay(Level world) { // Paper - Add fire-tick-delay option
|
||||
+ return world.paperConfig().environment.fireTickDelay + world.random.nextInt(10); // Paper - Add fire-tick-delay option
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user