Files
ParchmentMC/patches/server/0012-Add-config-for-ticking-TIME_SINCE_REST.patch
Blast-MC 7f2307cc5f 1.21.3
2024-11-24 18:05:29 -05:00

32 lines
1.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Lexi <lexi@qixils.dev>
Date: Fri, 17 Jun 2022 14:36:42 -0400
Subject: [PATCH] Add config for ticking TIME_SINCE_REST
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
index b1c917d65076a3805e5b78cb946753f0c101e214..7034391701ce34119c6cfc22a8dd2dec6293f63d 100644
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
@@ -317,6 +317,7 @@ public class WorldConfiguration extends ConfigurationPart {
}
public boolean disablePlayerCrits = false;
+ public boolean tickTimeSinceSleep = true; // Parchment
public boolean nerfPigmenFromNetherPortals = false;
@Comment("Prevents merging items that are not on the same y level, preventing potential visual artifacts.")
public boolean onlyMergeItemsHorizontally = false;
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 09ed0bd5f012ae2e34d5ed58828475577b6ab6f8..e280cd56a4dc446edab97e6c48397e03edb2ca1e 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -304,7 +304,7 @@ public abstract class Player extends LivingEntity {
this.awardStat(Stats.CROUCH_TIME);
}
- if (!this.isSleeping()) {
+ if (!this.isSleeping() && this.level().paperConfig().entities.behavior.tickTimeSinceSleep) { // Parchment
this.awardStat(Stats.TIME_SINCE_REST);
}
}