From 8c11cd85e3c585a5a9677d20ee851b088c7c671e Mon Sep 17 00:00:00 2001 From: VytskaLT Date: Wed, 22 Jun 2022 14:34:28 +0300 Subject: [PATCH] Add fire-tick-delay option --- .../world/level/block/FireBlock.java.patch | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/FireBlock.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/FireBlock.java.patch index 3698bcbc34..5d840efc2e 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/block/FireBlock.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/block/FireBlock.java.patch @@ -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