Removed invalid reflection fields

This commit is contained in:
Marc Baloup 2022-10-10 16:25:59 +02:00
parent 9a141c146e
commit 763de13c48
Signed by: marcbal
GPG Key ID: BBC0FE3ABC30B893

View File

@ -14,28 +14,13 @@ import static fr.pandacube.lib.util.ThrowableUtil.wrapReflectEx;
public class ChunkMap extends ChunkStorage { public class ChunkMap extends ChunkStorage {
public static final NMSReflect.ClassMapping MAPPING = wrapEx(() -> NMSReflect.mojClass("net.minecraft.server.level.ChunkMap")); public static final NMSReflect.ClassMapping MAPPING = wrapEx(() -> NMSReflect.mojClass("net.minecraft.server.level.ChunkMap"));
private static final ReflectField<?> FIELD_autoSaveQueue = wrapEx(() -> MAPPING.runtimeReflect().field("autoSaveQueue")); // spigot/paper field private static final ReflectField<?> FIELD_level = wrapEx(() -> MAPPING.mojField("level"));
public static final ReflectField<?> FIELD_level = wrapEx(() -> MAPPING.mojField("level"));
public static final ReflectField<?> FIELD_pendingUnloads = wrapEx(() -> MAPPING.mojField("pendingUnloads"));
public static final ReflectField<?> FIELD_toDrop = wrapEx(() -> MAPPING.mojField("toDrop"));
public static final ReflectField<?> FIELD_updatingChunks = wrapEx(() -> MAPPING.runtimeReflect().field("updatingChunks")); // spigot/paper field
/** This field in unmapped */
public final ObjectRBTreeSet<?> autoSaveQueue;
public final ServerLevel level; public final ServerLevel level;
/** This field in unmapped */
public final Long2ObjectLinkedOpenHashMap<?> pendingUnloads;
/** This field in unmapped */
public final LongSet toDrop;
public final QueuedChangesMapLong2Object updatingChunks;
protected ChunkMap(Object obj) { protected ChunkMap(Object obj) {
super(obj); super(obj);
autoSaveQueue = (ObjectRBTreeSet<?>) wrapReflectEx(() -> FIELD_autoSaveQueue.getValue(obj));
level = wrap(wrapReflectEx(() -> FIELD_level.getValue(obj)), ServerLevel.class); level = wrap(wrapReflectEx(() -> FIELD_level.getValue(obj)), ServerLevel.class);
pendingUnloads = (Long2ObjectLinkedOpenHashMap<?>) wrapReflectEx(() -> FIELD_pendingUnloads.getValue(obj));
toDrop = (LongSet) wrapReflectEx(() -> FIELD_toDrop.getValue(obj));
updatingChunks = wrap(wrapReflectEx(() -> FIELD_updatingChunks.getValue(obj)), QueuedChangesMapLong2Object.class);
} }
} }