aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0929-Configure-sniffer-egg-hatch-time.patch
diff options
context:
space:
mode:
authormaxcom1 <[email protected]>2024-03-23 22:26:17 +0100
committerGitHub <[email protected]>2024-03-23 17:26:17 -0400
commitb6001403e9703cadaa6e8c8558e732b91c3c6d6e (patch)
treea8c57bbc334a8ad48d4ad2b43db335667b142bee /patches/server/0929-Configure-sniffer-egg-hatch-time.patch
parent9ec7dfcbc41c6e625de0050b6997160a75df9f44 (diff)
downloadPaper-b6001403e9703cadaa6e8c8558e732b91c3c6d6e.tar.gz
Paper-b6001403e9703cadaa6e8c8558e732b91c3c6d6e.zip
Add methods to change entity physics (#10334)
Diffstat (limited to 'patches/server/0929-Configure-sniffer-egg-hatch-time.patch')
-rw-r--r--patches/server/0929-Configure-sniffer-egg-hatch-time.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/patches/server/0929-Configure-sniffer-egg-hatch-time.patch b/patches/server/0929-Configure-sniffer-egg-hatch-time.patch
new file mode 100644
index 0000000000..b42c26e59c
--- /dev/null
+++ b/patches/server/0929-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 7be4e32a4409b539839a480ef83750ed4b5359a6..03da13d1fdf22b425addf0b1b7a82803f6a35b60 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)
+ }
+@@ -106,7 +106,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));