Dieser Commit ist enthalten in:
Ursprung
e202adeb86
Commit
d7134b6916
@ -45,6 +45,9 @@ public interface ProtocolWrapper {
|
||||
Object playerInfoPacketConstructor(PlayerInfoAction action, GameProfile profile, GameMode mode);
|
||||
|
||||
default void initTPSWarp(LongSupplier longSupplier) {
|
||||
if (Core.getVersion() > 19) return;
|
||||
Class systemUtils = Reflection.getClass("{nms}.SystemUtils");
|
||||
Reflection.getField(systemUtils, LongSupplier.class, 0).set(systemUtils, longSupplier);
|
||||
}
|
||||
|
||||
enum PlayerInfoAction {
|
||||
|
@ -35,14 +35,8 @@ public class TPSWarpUtils {
|
||||
private static BukkitTask bukkitTask = null;
|
||||
|
||||
static {
|
||||
if (Core.getVersion() <= 18) {
|
||||
Class clazz = Reflection.getClass("{nms}.SystemUtils");
|
||||
Reflection.FieldAccessor fieldAccessor = Reflection.getField(clazz, LongSupplier.class, 0);
|
||||
fieldAccessor.set(clazz, (LongSupplier) () -> System.nanoTime() + nanoDOffset);
|
||||
} else {
|
||||
ProtocolWrapper.impl.initTPSWarp(() -> nanoDOffset);
|
||||
}
|
||||
}
|
||||
|
||||
public static void warp(double tps) {
|
||||
double d = 50 - (50 / (tps / 20.0));
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren