mirror of
https://github.com/songoda/SongodaCore.git
synced 2024-11-27 12:35:12 +01:00
Added compatibility with a 1.16.5 changed field name.
This commit is contained in:
parent
fdbe0da191
commit
6b9380fd50
@ -141,8 +141,13 @@ public enum CompatibleBiome {
|
|||||||
methodGetBiomeIndex = classChunk.getMethod("getBiomeIndex");
|
methodGetBiomeIndex = classChunk.getMethod("getBiomeIndex");
|
||||||
methodSetBiome = classBiomeStorage.getMethod("setBiome", int.class, int.class, int.class, classBiomeBase);
|
methodSetBiome = classBiomeStorage.getMethod("setBiome", int.class, int.class, int.class, classBiomeBase);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// If 1.16.5
|
||||||
|
fieldStorageRegistry = classBiomeStorage.getDeclaredField("registry");
|
||||||
|
} catch (NoSuchFieldException e) {
|
||||||
|
// If less than 1.16.5
|
||||||
fieldStorageRegistry = classBiomeStorage.getDeclaredField("g");
|
fieldStorageRegistry = classBiomeStorage.getDeclaredField("g");
|
||||||
|
}
|
||||||
fieldStorageRegistry.setAccessible(true);
|
fieldStorageRegistry.setAccessible(true);
|
||||||
} catch (NoSuchMethodException | NoSuchFieldException e) {
|
} catch (NoSuchMethodException | NoSuchFieldException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
Loading…
Reference in New Issue
Block a user