PaperMC/Spigot-Server-Patches/0125-gottagofast.patch

59 lines
2.3 KiB
Diff
Raw Normal View History

2016-04-01 08:54:53 +02:00
From 57c2f9101b897153d7afe526de98b4334ad925dd Mon Sep 17 00:00:00 2001
2016-04-01 08:33:12 +02:00
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Fri, 1 Apr 2016 01:29:29 -0500
Subject: [PATCH] gottagofast
diff --git a/src/main/java/org/spigotmc/TicksPerSecondCommand.java b/src/main/java/org/spigotmc/TicksPerSecondCommand.java
2016-04-01 08:54:53 +02:00
index 6d21c32..dc1d134 100644
2016-04-01 08:33:12 +02:00
--- a/src/main/java/org/spigotmc/TicksPerSecondCommand.java
+++ b/src/main/java/org/spigotmc/TicksPerSecondCommand.java
@@ -6,6 +6,7 @@ import org.bukkit.command.CommandSender;
public class TicksPerSecondCommand extends Command
{
+ private static boolean goFast = false; // Paper
public TicksPerSecondCommand(String name)
{
@@ -13,6 +14,11 @@ public class TicksPerSecondCommand extends Command
this.description = "Gets the current ticks per second for the server";
this.usageMessage = "/tps";
this.setPermission( "bukkit.command.tps" );
+
+ // Paper start - goFast
+ java.time.LocalDate date = new java.util.Date().toInstant().atZone(java.time.ZoneId.systemDefault()).toLocalDate();
+ if (date.getMonthValue() == 4 && date.getDayOfMonth() == 1) goFast = true;
+ // Paper end
}
@Override
2016-04-01 08:54:53 +02:00
@@ -25,6 +31,7 @@ public class TicksPerSecondCommand extends Command
2016-04-01 08:33:12 +02:00
// Paper start - Further improve tick handling
double[] tps = org.bukkit.Bukkit.getTPS();
2016-04-01 08:54:53 +02:00
+ if (goFast) tps = java.util.Arrays.stream(tps).map(t -> t * 100).toArray(); // Paper gotta go more faster super hot fire
2016-04-01 08:33:12 +02:00
String[] tpsAvg = new String[tps.length];
for ( int i = 0; i < tps.length; i++) {
2016-04-01 08:54:53 +02:00
@@ -38,7 +45,15 @@ public class TicksPerSecondCommand extends Command
2016-04-01 08:33:12 +02:00
private static String format(double tps) // Paper - Made static
{
+ // Paper start - gottagofast.jpg
+ double dubs;
+ if (goFast) {
+ dubs = 2000.0D;
+ } else {
+ dubs = 20.0D;
+ }
return ( ( tps > 18.0 ) ? ChatColor.GREEN : ( tps > 16.0 ) ? ChatColor.YELLOW : ChatColor.RED ).toString()
- + ( ( tps > 20.0 ) ? "*" : "" ) + Math.min( Math.round( tps * 100.0 ) / 100.0, 20.0 );
+ + ( ( tps > 20.0 ) ? "*" : "" ) + Math.min( Math.round( tps * 100.0 ) / 100.0, dubs );
+ // Paper end - cantgoanyfater.avi
}
}
--
2016-04-01 08:54:53 +02:00
2.7.4
2016-04-01 08:33:12 +02:00