Set proper field access and use mappings for entities on spigot (#2282)

set proper field access and use mappings
This commit is contained in:
Hannes Greule 2023-06-10 22:47:22 +02:00 committed by GitHub
parent 689c7f62b8
commit 083f8a4dd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View File

@ -202,8 +202,8 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
} }
try { try {
// Non-Paper // Non-Paper
SERVER_LEVEL_ENTITY_MANAGER = ServerLevel.class.getDeclaredField("entityManager"); SERVER_LEVEL_ENTITY_MANAGER = ServerLevel.class.getDeclaredField(Refraction.pickName("entityManager", "P"));
LEVEL_CHUNK_ENTITIES.setAccessible(true); SERVER_LEVEL_ENTITY_MANAGER.setAccessible(true);
} catch (NoSuchFieldException ignored) { } catch (NoSuchFieldException ignored) {
} }
POST_CHUNK_REWRITE = chunkRewrite; POST_CHUNK_REWRITE = chunkRewrite;

View File

@ -199,8 +199,8 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
} }
try { try {
// Non-Paper // Non-Paper
SERVER_LEVEL_ENTITY_MANAGER = ServerLevel.class.getDeclaredField("entityManager"); SERVER_LEVEL_ENTITY_MANAGER = ServerLevel.class.getDeclaredField(Refraction.pickName("entityManager", "P"));
LEVEL_CHUNK_ENTITIES.setAccessible(true); SERVER_LEVEL_ENTITY_MANAGER.setAccessible(true);
} catch (NoSuchFieldException ignored) { } catch (NoSuchFieldException ignored) {
} }
POST_CHUNK_REWRITE = chunkRewrite; POST_CHUNK_REWRITE = chunkRewrite;

View File

@ -204,8 +204,8 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
} }
try { try {
// Non-Paper // Non-Paper
SERVER_LEVEL_ENTITY_MANAGER = ServerLevel.class.getDeclaredField("entityManager"); SERVER_LEVEL_ENTITY_MANAGER = ServerLevel.class.getDeclaredField(Refraction.pickName("entityManager", "L"));
LEVEL_CHUNK_ENTITIES.setAccessible(true); SERVER_LEVEL_ENTITY_MANAGER.setAccessible(true);
} catch (NoSuchFieldException ignored) { } catch (NoSuchFieldException ignored) {
} }
POST_CHUNK_REWRITE = chunkRewrite; POST_CHUNK_REWRITE = chunkRewrite;

View File

@ -211,7 +211,7 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
try { try {
// Non-Paper // Non-Paper
SERVER_LEVEL_ENTITY_MANAGER = ServerLevel.class.getDeclaredField(Refraction.pickName("entityManager", "M")); SERVER_LEVEL_ENTITY_MANAGER = ServerLevel.class.getDeclaredField(Refraction.pickName("entityManager", "M"));
LEVEL_CHUNK_ENTITIES.setAccessible(true); SERVER_LEVEL_ENTITY_MANAGER.setAccessible(true);
} catch (NoSuchFieldException ignored) { } catch (NoSuchFieldException ignored) {
} }
POST_CHUNK_REWRITE = chunkRewrite; POST_CHUNK_REWRITE = chunkRewrite;