mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 10:12:53 +00:00
Properly rethrow an NPE so it doesn't get stuck in labda
This commit is contained in:
parent
6a4a25db40
commit
1edafc40d0
@ -86,6 +86,9 @@ public class IrisEngineCompound implements EngineCompound {
|
||||
CompletableFuture<Object> cf = new CompletableFuture<>();
|
||||
Object BP = null;
|
||||
getBPSafe(clazz, clazzSG, clazzBP, nmsWorld, chunkGenerator).thenAccept(bp -> {
|
||||
if (bp == null){
|
||||
throw new NullPointerException();
|
||||
}
|
||||
strongholds.add(new IrisPosition((int) new V(bp, false).invoke("getX"), (int) new V(bp, false).invoke("getY"), (int) new V(bp, false).invoke("getZ")));
|
||||
String positions = "";
|
||||
for (IrisPosition pos : strongholds){
|
||||
@ -192,7 +195,7 @@ public class IrisEngineCompound implements EngineCompound {
|
||||
Bukkit.getScheduler().runTask(Iris.instance, () -> {
|
||||
try {
|
||||
cf.complete(getBP(clazz, clazzSG, clazzBP, nmsWorld, chunkGenerator));
|
||||
} catch (Exception e){
|
||||
} catch (Throwable e){
|
||||
cf.complete(null);
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user