Paper/patches/server/1008-Configure-sniffer-egg-hatch-time.patch

29 lines
1.8 KiB
Diff
Raw Normal View History

2023-08-26 22:12:46 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Date: Tue, 27 Jun 2023 13:26:06 +0200
Subject: [PATCH] Configure sniffer egg hatch time
diff --git a/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java b/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java
2023-12-06 17:34:54 +01:00
index 02939518ead6463e677ecf5b045ec89aae154e8c..cb431b6027019ca95879129e88967ee6ae03c313 100644
2023-08-26 22:12:46 +02:00
--- a/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java
2023-12-06 17:34:54 +01:00
@@ -63,7 +63,7 @@ public class SnifferEggBlock extends Block {
2023-08-26 22:12:46 +02:00
// Paper start
private void rescheduleTick(ServerLevel world, BlockPos pos) {
- int baseDelay = hatchBoost(world, pos) ? BOOSTED_HATCH_TIME_TICKS : REGULAR_HATCH_TIME_TICKS;
+ int baseDelay = hatchBoost(world, pos) ? world.paperConfig().entities.sniffer.boostedHatchTime.or(BOOSTED_HATCH_TIME_TICKS) : world.paperConfig().entities.sniffer.hatchTime.or(REGULAR_HATCH_TIME_TICKS);
world.scheduleTick(pos, this, (baseDelay / 3) + world.random.nextInt(RANDOM_HATCH_OFFSET_TICKS));
// reschedule to avoid being stuck here and behave like the other calls (see #onPlace)
}
2023-12-06 17:34:54 +01:00
@@ -106,7 +106,7 @@ public class SnifferEggBlock extends Block {
2023-08-26 22:12:46 +02:00
world.levelEvent(3009, pos, 0);
}
- int i = bl ? 12000 : 24000;
+ int i = bl ? world.paperConfig().entities.sniffer.boostedHatchTime.or(BOOSTED_HATCH_TIME_TICKS) : world.paperConfig().entities.sniffer.hatchTime.or(REGULAR_HATCH_TIME_TICKS); // Paper
int j = i / 3;
world.gameEvent(GameEvent.BLOCK_PLACE, pos, GameEvent.Context.of(state));
world.scheduleTick(pos, this, j + world.random.nextInt(300));