From 3a090d7c1da8588b6e1a167062c368ef3ad99bcd Mon Sep 17 00:00:00 2001 From: CocoTheOwner Date: Thu, 29 Jul 2021 11:07:27 +0200 Subject: [PATCH] Fix tree NPE --- src/main/java/com/volmit/iris/core/TreeManager.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/com/volmit/iris/core/TreeManager.java b/src/main/java/com/volmit/iris/core/TreeManager.java index 97af60c99..cb4fa89ae 100644 --- a/src/main/java/com/volmit/iris/core/TreeManager.java +++ b/src/main/java/com/volmit/iris/core/TreeManager.java @@ -83,6 +83,16 @@ public class TreeManager implements Listener { return; } + if (worldAccess.getCompound() == null) { + Iris.debug(this.getClass().getName() + " passed off to vanilla because dimension compound is null"); + Iris.reportError(new NullPointerException(event.getWorld().getName() + " is accessible but does not have compound")); + } + + if (worldAccess.getCompound().getRootDimension() == null) { + Iris.debug(this.getClass().getName() + " passed off to vanilla because compound's root dimension is null"); + Iris.reportError(new NullPointerException(event.getWorld().getName() + " is accessible & has compound but has no root dimension")); + } + if (!worldAccess.getCompound().getRootDimension().getTreeSettings().isEnabled()) { Iris.debug(this.getClass().getName() + " cancelled because tree overrides are disabled"); return;