Config for skipping night

This commit is contained in:
Ben Kerllenevich
2025-01-11 17:20:19 -08:00
committed by granny
parent f9f880f249
commit f399f40924
3 changed files with 11 additions and 39 deletions

View File

@@ -43,6 +43,15 @@
}
// Paper start
@@ -727,7 +_,7 @@
}
int _int = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
- if (this.sleepStatus.areEnoughSleeping(_int) && this.sleepStatus.areEnoughDeepSleeping(_int, this.players)) {
+ if (this.purpurConfig.playersSkipNight && this.sleepStatus.areEnoughSleeping(_int) && this.sleepStatus.areEnoughDeepSleeping(_int, this.players)) { // Purpur - Config for skipping night
// Paper start - create time skip event - move up calculations
final long newDayTime = this.levelData.getDayTime() + 24000L;
org.bukkit.event.world.TimeSkipEvent event = new org.bukkit.event.world.TimeSkipEvent(
@@ -846,6 +_,13 @@
this.serverLevelData.getScheduledEvents().tick(this.server, l);
Profiler.get().pop();

View File

@@ -343,6 +343,7 @@ public class PurpurWorldConfig {
public boolean playerFixStuckPortal = false;
public boolean creativeOnePunch = false;
public boolean playerSleepNearMonsters = false;
public boolean playersSkipNight = true;
private void playerSettings() {
if (PurpurConfig.version < 19) {
boolean oldVal = getBoolean("gameplay-mechanics.player.idle-timeout.mods-target", idleTimeoutTargetPlayer);
@@ -361,6 +362,7 @@ public class PurpurWorldConfig {
playerFixStuckPortal = getBoolean("gameplay-mechanics.player.fix-stuck-in-portal", playerFixStuckPortal);
creativeOnePunch = getBoolean("gameplay-mechanics.player.one-punch-in-creative", creativeOnePunch);
playerSleepNearMonsters = getBoolean("gameplay-mechanics.player.sleep-ignore-nearby-mobs", playerSleepNearMonsters);
playersSkipNight = getBoolean("gameplay-mechanics.player.can-skip-night", playersSkipNight);
}
public boolean silkTouchEnabled = false;