mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-23 17:19:16 +00:00
Properly rethrow an NPE so it doesn't get stuck in labda
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user