-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configurable including 5s in getTPS()
- Loading branch information
1 parent
0e85378
commit c53ae5e
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Dreeam <[email protected]> | ||
Date: Sat, 24 Feb 2024 01:16:07 -0500 | ||
Subject: [PATCH] Including 5s in getTPS() | ||
|
||
|
||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java | ||
index a1317e374066d2abe20064bc47e20f4b19db9705..cee77b134c40c6d3e52d32a5fbf0888d121fd00f 100644 | ||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java | ||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java | ||
@@ -3137,6 +3137,8 @@ public final class CraftServer implements Server { | ||
|
||
@Override | ||
public double[] getTPS() { | ||
+ if (org.dreeam.leaf.LeafConfig.including5sIngetTPS)return getTPSIncluding5SecondAverage(); // Leaf - Including 5s in getTPS() | ||
+ | ||
return new double[] { | ||
net.minecraft.server.MinecraftServer.getServer().tps1.getAverage(), | ||
net.minecraft.server.MinecraftServer.getServer().tps5.getAverage(), | ||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java | ||
index 5e362d086d64ec19dd9bffd680cc82d20164c570..c38b6f8df27d37ffc48452deb85fe2f283fa1661 100644 | ||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java | ||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java | ||
@@ -334,4 +334,9 @@ public class LeafConfig { | ||
private static void tripwireDupe() { | ||
fixTripwireDupe = getBoolean("gameplay.fix-tripwire-dupe", fixTripwireDupe); | ||
} | ||
+ | ||
+ public static boolean including5sIngetTPS = true; | ||
+ private static void including5sInTPS() { | ||
+ including5sIngetTPS = getBoolean("including-5s-in-getTPS", including5sIngetTPS); | ||
+ } | ||
} |