3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-20 09:50:06 +01:00

Fix reflections and casting

Dieser Commit ist enthalten in:
TheMeinerLP 2023-06-18 15:02:44 +02:00 committet von Phillipp Glanz
Ursprung faaf515962
Commit 615663338f
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden

Datei anzeigen

@ -70,13 +70,13 @@ public class PaperweightFaweWorldNativeAccess implements WorldNativeAccess<Level
try {
regionizedServerClass = Class.forName("io.papermc.paper.threadedregions.RegionizedServer");
regionScheduleHandleClass = Class.forName(
"io.papermc.paper.threadedregions.TickRegionScheduler.RegionScheduleHandle");
"io.papermc.paper.threadedregions.TickRegionScheduler$RegionScheduleHandle");
globalTickData = MethodHandles.lookup().unreflect(regionizedServerClass.getDeclaredMethod("getGlobalTickData"));
var data = globalTickData.invoke();
globalCurrentTick = MethodHandles.lookup().unreflect(regionScheduleHandleClass.getDeclaredMethod(
"getCurrentTick"));
final int tick = (int) globalCurrentTick.invoke(data);
this.lastTick = new AtomicInteger(tick);
final long tick = (long) globalCurrentTick.invoke(data);
this.lastTick = new AtomicInteger((int) tick);
} catch (Throwable e) {
throw new RuntimeException(e);
}