From 034d18f495c3fc05a286a24d2206a272d8028842 Mon Sep 17 00:00:00 2001 From: tterrag Date: Fri, 4 Dec 2015 21:22:43 -0500 Subject: [PATCH] #60 Fix crash when AE2 decorative quartz is disabled --- src/main/java/team/chisel/Features.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/team/chisel/Features.java b/src/main/java/team/chisel/Features.java index f573bcae..e4216347 100644 --- a/src/main/java/team/chisel/Features.java +++ b/src/main/java/team/chisel/Features.java @@ -59,6 +59,9 @@ import cpw.mods.fml.common.registry.GameRegistry; public enum Features { AE_CERTUS_QUARTZ("appliedenergistics2") { + + private Block blockCheck; + private boolean blockChecked; @Override void addBlocks() { @@ -67,6 +70,15 @@ public enum Features { Carving.chisel.addVariation("AECertusQuartz", GameRegistry.findBlock("appliedenergistics2", "tile.BlockQuartzChiseled"), 0, 2); Carving.chisel.registerOre("AECertusQuartz", "AECertusQuartz"); } + + @Override + public boolean enabled() { + if (!blockChecked) { + blockCheck = GameRegistry.findBlock("appliedenergistics2", "tile.BlockQuartz"); + blockChecked = true; + } + return super.enabled() && blockCheck != null; + } }, AE_SKY_STONE("appliedenergistics2") { @@ -3069,7 +3081,7 @@ public enum Features { ; } - public final boolean enabled() { + public boolean enabled() { return Configurations.featureEnabled(this) && hasRequiredMod() && hasParentFeature(); }