Fix RedstonetesterUtils
Fix TPSUtils
Dieser Commit ist enthalten in:
Ursprung
cf2b09007f
Commit
032ff79810
@ -83,17 +83,17 @@ public class RedstonetesterUtils {
|
||||
return;
|
||||
}
|
||||
if (loc1.equals(location)) {
|
||||
if (TPSUtils.currentTick.getAsLong() - lastTick > 100) {
|
||||
if (TPSUtils.currentTick.get() - lastTick > 100) {
|
||||
tick = null;
|
||||
}
|
||||
lastTick = TPSUtils.currentTick.getAsLong();
|
||||
lastTick = TPSUtils.currentTick.get();
|
||||
if (tick == null) {
|
||||
tick = TPSUtils.currentTick.getAsLong();
|
||||
tick = TPSUtils.currentTick.get();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (tick != null && loc2.equals(location)) {
|
||||
player.sendMessage(BauSystem.PREFIX + "Differenz" + ChatColor.DARK_GRAY + ": " + ChatColor.YELLOW + (TPSUtils.currentTick.getAsLong() - tick) + ChatColor.DARK_GRAY + " - " + ChatColor.GRAY + "in Ticks " + ChatColor.DARK_GRAY + "(" + ChatColor.GRAY + "Ticks/2 -> Redstoneticks" + ChatColor.DARK_GRAY + ")");
|
||||
player.sendMessage(BauSystem.PREFIX + "Differenz" + ChatColor.DARK_GRAY + ": " + ChatColor.YELLOW + (TPSUtils.currentTick.get() - tick) + ChatColor.DARK_GRAY + " - " + ChatColor.GRAY + "in Ticks " + ChatColor.DARK_GRAY + "(" + ChatColor.GRAY + "Ticks/2 -> Redstoneticks" + ChatColor.DARK_GRAY + ")");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,6 @@
|
||||
package de.steamwar.bausystem.features.tpslimit;
|
||||
|
||||
import de.steamwar.bausystem.BauSystem;
|
||||
import java.util.function.LongSupplier;
|
||||
import lombok.experimental.UtilityClass;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
@ -30,7 +29,7 @@ import java.util.function.Supplier;
|
||||
public class TPSUtils {
|
||||
|
||||
private static long ticksSinceServerStart = 0;
|
||||
public static final LongSupplier currentTick = () -> ticksSinceServerStart;
|
||||
public static final Supplier<Long> currentTick = () -> ticksSinceServerStart; // This is intended as Supplier<Long>
|
||||
|
||||
static {
|
||||
Bukkit.getScheduler().runTaskTimer(BauSystem.getInstance(), () -> ticksSinceServerStart++, 1, 1);
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren