mirror of
https://github.com/songoda/SongodaCore.git
synced 2024-11-23 10:35:18 +01:00
fix: Fixes NoSuchMethodException
in NMS-Spawners for new 1.20.4 builds
Affects EpicAnchors/EpicSpawners
This commit is contained in:
parent
9f6f8fb660
commit
374856719c
@ -45,7 +45,15 @@ public class BBaseSpawnerImpl implements BBaseSpawner {
|
||||
this.setNextSpawnDataMethod.setAccessible(true);
|
||||
}
|
||||
|
||||
this.getOrCreateNextSpawnDataMethod = this.spawner.getClass().getSuperclass().getDeclaredMethod("b", Level.class, RandomSource.class, BlockPos.class);
|
||||
// Spigot mappings changed again mid-nms-version :<
|
||||
Method getOrCreateNextSpawnDataMethodLocal;
|
||||
try {
|
||||
getOrCreateNextSpawnDataMethodLocal = this.spawner.getClass().getSuperclass().getDeclaredMethod("a", Level.class, RandomSource.class, BlockPos.class);
|
||||
} catch (NoSuchMethodException ex) {
|
||||
getOrCreateNextSpawnDataMethodLocal = this.spawner.getClass().getSuperclass().getDeclaredMethod("b", Level.class, RandomSource.class, BlockPos.class);
|
||||
}
|
||||
|
||||
this.getOrCreateNextSpawnDataMethod = getOrCreateNextSpawnDataMethodLocal;
|
||||
if (!this.getOrCreateNextSpawnDataMethod.canAccess(this.spawner)) {
|
||||
this.getOrCreateNextSpawnDataMethod.setAccessible(true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user