Fix pr stuff
Dieser Commit ist enthalten in:
Ursprung
813b8803b4
Commit
8802828676
@ -24,7 +24,7 @@ import net.minecraft.server.v1_15_R1.SystemUtils;
|
|||||||
|
|
||||||
import java.util.function.LongSupplier;
|
import java.util.function.LongSupplier;
|
||||||
|
|
||||||
public class TPSLimit_15 {
|
public class TPSUtils_15 {
|
||||||
|
|
||||||
public static void init(LongSupplier longSupplier) {
|
public static void init(LongSupplier longSupplier) {
|
||||||
SystemUtils.a = () -> System.nanoTime() + longSupplier.getAsLong();
|
SystemUtils.a = () -> System.nanoTime() + longSupplier.getAsLong();
|
@ -23,7 +23,6 @@ import de.steamwar.bausystem.BauSystem;
|
|||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
import de.steamwar.bausystem.world.TPSUtils;
|
import de.steamwar.bausystem.world.TPSUtils;
|
||||||
import de.steamwar.bausystem.world.Welt;
|
import de.steamwar.bausystem.world.Welt;
|
||||||
import de.steamwar.core.TPSWatcher;
|
|
||||||
import de.steamwar.core.VersionedRunnable;
|
import de.steamwar.core.VersionedRunnable;
|
||||||
import net.md_5.bungee.api.ChatMessageType;
|
import net.md_5.bungee.api.ChatMessageType;
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
|
@ -31,6 +31,7 @@ import java.util.List;
|
|||||||
public class CommandTPSLimiterTabComplete implements TabCompleter {
|
public class CommandTPSLimiterTabComplete implements TabCompleter {
|
||||||
|
|
||||||
private List<String> arguments = new ArrayList<>(Arrays.asList("default", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"));
|
private List<String> arguments = new ArrayList<>(Arrays.asList("default", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"));
|
||||||
|
|
||||||
public CommandTPSLimiterTabComplete() {
|
public CommandTPSLimiterTabComplete() {
|
||||||
if (TPSUtils.isWarpAllowed()) arguments.addAll(Arrays.asList("21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40"));
|
if (TPSUtils.isWarpAllowed()) arguments.addAll(Arrays.asList("21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40"));
|
||||||
}
|
}
|
||||||
|
@ -37,9 +37,11 @@ public class TPSUtils {
|
|||||||
private static long nanoDOffset = 0;
|
private static long nanoDOffset = 0;
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
Bukkit.getScheduler().runTaskTimer(BauSystem.getPlugin(), () -> nanoOffset += nanoDOffset, 1, 1);
|
|
||||||
VersionedRunnable.call(new VersionedRunnable(() -> warp = false, 8),
|
VersionedRunnable.call(new VersionedRunnable(() -> warp = false, 8),
|
||||||
new VersionedRunnable(() -> TPSLimit_15.init(() -> nanoOffset), 15));
|
new VersionedRunnable(() -> {
|
||||||
|
Bukkit.getScheduler().runTaskTimer(BauSystem.getPlugin(), () -> nanoOffset += nanoDOffset, 1, 1);
|
||||||
|
TPSUtils_15.init(() -> nanoOffset);
|
||||||
|
}, 15));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setTPS(double tps) {
|
public static void setTPS(double tps) {
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren