mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 17:07:43 +01:00
add back pufferfish patches
This commit is contained in:
39
patches/server/0146-Config-for-skipping-night.patch
Normal file
39
patches/server/0146-Config-for-skipping-night.patch
Normal file
@@ -0,0 +1,39 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Kerllenevich <ben@omega24.dev>
|
||||
Date: Thu, 18 Mar 2021 06:22:40 -0400
|
||||
Subject: [PATCH] Config for skipping night
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 0e8452f6a8300992f397fb15db763304d72fe3b9..49c412f46854ee877de1721b08629e8a3cd319f9 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -805,7 +805,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
int i = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
|
||||
long j;
|
||||
|
||||
- if (this.sleepStatus.areEnoughSleeping(i) && this.sleepStatus.areEnoughDeepSleeping(i, this.players)) {
|
||||
+ if (this.purpurConfig.playersSkipNight && this.sleepStatus.areEnoughSleeping(i) && this.sleepStatus.areEnoughDeepSleeping(i, this.players)) {
|
||||
// CraftBukkit start
|
||||
j = this.levelData.getDayTime() + 24000L;
|
||||
TimeSkipEvent event = new TimeSkipEvent(this.getWorld(), TimeSkipEvent.SkipReason.NIGHT_SKIP, (j - j % 24000L) - this.getDayTime());
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 62035c2b1b4a41296405a5b252469dbac0bf2d17..3fb96a14928d24920999336a40920f0a4db65e9b 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -360,6 +360,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);
|
||||
@@ -380,6 +381,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);
|
||||
}
|
||||
|
||||
private static boolean projectileDespawnRateSettingsMigrated = false;
|
||||
Reference in New Issue
Block a user