mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-20 12:09:39 +00:00
Fix #2077 Crash from disabling the Arboriculture Module
This commit is contained in:
1 parent
d621d8a5df
commit
36ccd5c3e1
4 files changed
+8
-4
No files matched your search
@@ -390,7 +390,7 @@ public class ModuleArboriculture extends BlankForestryModule {
|
||||
'#', fireproofPlanks.copy());
|
||||
|
||||
// Fabricator recipes
|
||||
if (ModuleHelper.isEnabled(ForestryModuleUids.FACTORY, ForestryModuleUids.APICULTURE)) {
|
||||
if (ModuleHelper.allEnabled(ForestryModuleUids.FACTORY, ForestryModuleUids.APICULTURE)) {
|
||||
logs.setCount(1);
|
||||
fireproofLogs.setCount(1);
|
||||
RecipeManagers.fabricatorManager.addRecipe(ItemStack.EMPTY, Fluids.GLASS.getFluid(500), fireproofLogs.copy(), new Object[]{
|
||||
|
||||
@@ -56,7 +56,7 @@ public class AlleleHelper implements IAlleleHelper {
|
||||
createAlleles(EnumAllele.Territory.class, EnumBeeChromosome.TERRITORY);
|
||||
}
|
||||
|
||||
if (ModuleHelper.isEnabled(ForestryModuleUids.APICULTURE, ForestryModuleUids.LEPIDOPTEROLOGY)) {
|
||||
if (ModuleHelper.anyEnabled(ForestryModuleUids.APICULTURE, ForestryModuleUids.LEPIDOPTEROLOGY)) {
|
||||
createAlleles(EnumAllele.Speed.class,
|
||||
EnumBeeChromosome.SPEED,
|
||||
EnumButterflyChromosome.SPEED
|
||||
|
||||
@@ -483,7 +483,7 @@ public class ModuleFactory extends BlankForestryModule {
|
||||
// RAIN SUBSTRATES
|
||||
|
||||
|
||||
if (ModuleHelper.isEnabled(Constants.MOD_ID, ForestryModuleUids.APICULTURE)) {
|
||||
if (ModuleHelper.isEnabled(ForestryModuleUids.APICULTURE)) {
|
||||
ItemRegistryApiculture beeItems = ModuleApiculture.getItems();
|
||||
RecipeManagers.carpenterManager.addRecipe(5, new FluidStack(FluidRegistry.WATER, 1000), ItemStack.EMPTY, coreItems.iodineCharge.getItemStack(),
|
||||
"Z#Z",
|
||||
|
||||
@@ -22,10 +22,14 @@ public final class ModuleHelper {
|
||||
return isModuleEnabled(Constants.MOD_ID, moduleID);
|
||||
}
|
||||
|
||||
public static boolean isEnabled(String... moduleIDs) {
|
||||
public static boolean allEnabled(String... moduleIDs) {
|
||||
return Stream.of(moduleIDs).allMatch(ModuleHelper::isEnabled);
|
||||
}
|
||||
|
||||
public static boolean anyEnabled(String... moduleIDs) {
|
||||
return Stream.of(moduleIDs).anyMatch(ModuleHelper::isEnabled);
|
||||
}
|
||||
|
||||
public static boolean isModuleEnabled(String containerID, String moduleID){
|
||||
ModuleManager manager = ModuleManager.getInstance();
|
||||
return manager.isModuleEnabled(containerID, moduleID);
|
||||
|
||||
Reference in new issue
Block a user