mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
Configure sniffer egg hatch time
This commit is contained in:
parent
d300049246
commit
d66a2c4c26
1 changed files with 10 additions and 1 deletions
|
@ -6,7 +6,7 @@
|
|||
|
||||
+ // 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)
|
||||
+ }
|
||||
|
@ -42,3 +42,12 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
@@ -86,7 +105,7 @@
|
||||
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));
|
||||
|
|
Loading…
Reference in a new issue