diff options
author | Nassim Jahnke <[email protected]> | 2024-10-27 09:43:00 +0100 |
---|---|---|
committer | Nassim Jahnke <[email protected]> | 2024-10-27 10:03:59 +0100 |
commit | 348c8550967380d9843e365e769f67eee8a8e474 (patch) | |
tree | 185991293a5343239e1107ebc98df37de3d020a5 /patches/server/0868-Configure-sniffer-egg-hatch-time.patch | |
parent | bcf52fe5fd7b178e3c72f53762c8e32ca7910dc4 (diff) | |
download | Paper-348c8550967380d9843e365e769f67eee8a8e474.tar.gz Paper-348c8550967380d9843e365e769f67eee8a8e474.zip |
Readd last API patch (with TODO)
Diffstat (limited to 'patches/server/0868-Configure-sniffer-egg-hatch-time.patch')
-rw-r--r-- | patches/server/0868-Configure-sniffer-egg-hatch-time.patch | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/patches/server/0868-Configure-sniffer-egg-hatch-time.patch b/patches/server/0868-Configure-sniffer-egg-hatch-time.patch new file mode 100644 index 0000000000..e39971b614 --- /dev/null +++ b/patches/server/0868-Configure-sniffer-egg-hatch-time.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lulu13022002 <[email protected]> +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 +index c6b7cfd78bc0c4cb64eada507876c293541890f4..ec04fcc23c86d34a6dc1eaadda7f9d876f3d8ffe 100644 +--- a/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java ++++ b/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java +@@ -63,7 +63,7 @@ public class SnifferEggBlock extends Block { + + // Paper start - Call BlockFadeEvent + 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); // Paper - Configure sniffer egg hatch time + 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) + } +@@ -105,7 +105,7 @@ public class SnifferEggBlock extends Block { + 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)); |