mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +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<>();
|
CompletableFuture<Object> cf = new CompletableFuture<>();
|
||||||
Object BP = null;
|
Object BP = null;
|
||||||
getBPSafe(clazz, clazzSG, clazzBP, nmsWorld, chunkGenerator).thenAccept(bp -> {
|
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")));
|
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 = "";
|
String positions = "";
|
||||||
for (IrisPosition pos : strongholds){
|
for (IrisPosition pos : strongholds){
|
||||||
@ -192,7 +195,7 @@ public class IrisEngineCompound implements EngineCompound {
|
|||||||
Bukkit.getScheduler().runTask(Iris.instance, () -> {
|
Bukkit.getScheduler().runTask(Iris.instance, () -> {
|
||||||
try {
|
try {
|
||||||
cf.complete(getBP(clazz, clazzSG, clazzBP, nmsWorld, chunkGenerator));
|
cf.complete(getBP(clazz, clazzSG, clazzBP, nmsWorld, chunkGenerator));
|
||||||
} catch (Exception e){
|
} catch (Throwable e){
|
||||||
cf.complete(null);
|
cf.complete(null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user