Remove module configs

We don't support disabling parts
This commit is contained in:
ah-OOG-ah committed 2024-09-26 17:33:07 -04:00
1 parent 0f2e6bd76e
commit 56c2e72748
26 files changed
+52 -168

No files matched your search

-5
View File
@@ -303,11 +303,6 @@ public class Botany extends AbstractMod {
}
}
@Override
public boolean isActive() {
return BinnieCore.isBotanyActive();
}
@Mod.EventHandler
public void onIMC(FMLInterModComms.IMCEvent event) {
for (FMLInterModComms.IMCMessage message : event.getMessages()) {
+1 -1
View File
@@ -30,7 +30,7 @@ public abstract class AbstractMod implements IPacketProvider, IInitializable {
MinecraftForge.EVENT_BUS.register(this);
}
public abstract boolean isActive();
public boolean isActive() { return true; }
@Override
public abstract String getChannel();
+2 -11
View File
@@ -3,7 +3,6 @@ package binnie.core;
import binnie.Binnie;
import binnie.core.block.MultipassBlockRenderer;
import binnie.core.block.TileEntityMetadata;
import binnie.core.config.ModsConfig;
import binnie.core.craftgui.minecraft.ModuleCraftGUI;
import binnie.core.gui.BinnieCoreGUI;
import binnie.core.gui.BinnieGUIHandler;
@@ -134,20 +133,12 @@ public class BinnieCore extends AbstractMod {
return PluginManager.Module.ARBORICULTURE.isEnabled();
}
public static boolean isBotanyActive() {
return ModsConfig.botany;
}
public static boolean isGeneticsActive() {
return ModsConfig.genetics;
}
public static boolean isExtraBeesActive() {
return ModsConfig.extraBees && isApicultureActive();
return isApicultureActive();
}
public static boolean isExtraTreesActive() {
return ModsConfig.extraTrees && isArboricultureActive();
return isArboricultureActive();
}
@Override
@@ -1,29 +0,0 @@
package binnie.core.config;
import static binnie.core.BinnieCore.CORE_MODID;
import com.gtnewhorizon.gtnhlib.config.Config;
@Config(modid = CORE_MODID)
public class ModsConfig {
@Config.Comment("Enables the Extra Bees Mod.")
@Config.DefaultBoolean(true)
@Config.RequiresMcRestart
public static boolean extraBees;
@Config.Comment("Enables the Extra Trees Mod.")
@Config.DefaultBoolean(true)
@Config.RequiresMcRestart
public static boolean extraTrees;
@Config.Comment("Enables the Botany Mod.")
@Config.DefaultBoolean(true)
@Config.RequiresMcRestart
public static boolean botany;
@Config.Comment("Enables the Genetics Mod.")
@Config.DefaultBoolean(true)
@Config.RequiresMcRestart
public static boolean genetics;
}
@@ -1,14 +0,0 @@
package binnie.core.config;
import static binnie.core.BinnieCore.CORE_MODID;
import static binnie.core.BinnieCore.CORE_MOD_NAME;
import com.gtnewhorizon.gtnhlib.config.ConfigException;
import com.gtnewhorizon.gtnhlib.config.SimpleGuiConfig;
import net.minecraft.client.gui.GuiScreen;
public class ModsConfigGUI extends SimpleGuiConfig {
public ModsConfigGUI(GuiScreen parent) throws ConfigException {
super(parent, ModsConfig.class, CORE_MODID, CORE_MOD_NAME);
}
}
@@ -1,11 +0,0 @@
package binnie.core.config;
import com.gtnewhorizon.gtnhlib.config.SimpleGuiFactory;
import net.minecraft.client.gui.GuiScreen;
public class ModsConfigGUIFactory implements SimpleGuiFactory {
@Override
public Class<? extends GuiScreen> mainConfigGuiClass() {
return ModsConfigGUI.class;
}
}
@@ -58,9 +58,8 @@ public class ManagerGenetics extends ManagerBase {
if (BinnieCore.isLepidopteryActive()) {
mothBreedingSystem = new MothBreedingSystem();
}
if (BinnieCore.isBotanyActive()) {
flowerBreedingSystem = new FlowerBreedingSystem();
}
flowerBreedingSystem = new FlowerBreedingSystem();
}
@Override
@@ -51,7 +51,7 @@ public class ModuleItems implements IInitializable {
@SubscribeEvent
public void onUseFieldKit(PlayerInteractEvent event) {
if (!BinnieCore.isBotanyActive() || event.action != PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) {
if (event.action != PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) {
return;
}
@@ -5,6 +5,4 @@ import binnie.core.network.IOrdinaled;
public interface IMachineType extends IOrdinaled {
Class<? extends MachinePackage> getPackageClass();
boolean isActive();
}
@@ -31,14 +31,14 @@ public class MachineGroup {
this.blockName = blockName;
for (IMachineType type : types) {
if (type.getPackageClass() != null && type.isActive()) {
if (type.getPackageClass() != null) {
try {
MachinePackage pack = type.getPackageClass().newInstance();
pack.assignMetadata(type.ordinal());
pack.setActive(type.isActive());
pack.setActive(true);
addPackage(pack);
} catch (Exception e) {
throw new RuntimeException("Failed to create machine package " + type.toString(), e);
throw new RuntimeException("Failed to create machine package " + type, e);
}
}
}
@@ -32,11 +32,6 @@ enum Compartment implements IMachineType {
return clss;
}
@Override
public boolean isActive() {
return true;
}
public ItemStack get(int i) {
return new ItemStack(BinnieCore.packageCompartment.getBlock(), i, ordinal());
}
@@ -46,11 +46,6 @@ public enum AlvearyMachine implements IMachineType {
return new ItemStack(ModuleApiary.blockComponent, size, ordinal());
}
@Override
public boolean isActive() {
return true;
}
public abstract static class AlvearyPackage extends MachinePackage {
protected BinnieResource machineTexture;
@@ -1,13 +1,6 @@
package binnie.extratrees.machines;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import binnie.Binnie;
import binnie.core.BinnieCore;
import binnie.core.machines.IMachineType;
import binnie.core.machines.Machine;
import binnie.core.machines.MachineComponent;
@@ -23,6 +16,11 @@ import binnie.extratrees.machines.designer.PanelworkerPackage;
import binnie.extratrees.machines.designer.TileworkerPackage;
import binnie.extratrees.machines.designer.WoodworkerPackage;
import binnie.extratrees.machines.lumbermill.LumbermillPackage;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public enum ExtraTreeMachine implements IMachineType {
@@ -43,14 +41,6 @@ public enum ExtraTreeMachine implements IMachineType {
return cls;
}
@Override
public boolean isActive() {
if (this == ExtraTreeMachine.Tileworker) {
return BinnieCore.isBotanyActive();
}
return true;
}
public ItemStack get(int i) {
return new ItemStack(ExtraTrees.blockMachine, i, ordinal());
}
+2 -4
View File
@@ -1,9 +1,6 @@
package binnie.genetics;
import net.minecraft.item.Item;
import binnie.core.AbstractMod;
import binnie.core.BinnieCore;
import binnie.core.Tags;
import binnie.core.gui.IBinnieGUID;
import binnie.core.machines.MachineGroup;
@@ -24,6 +21,7 @@ import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import net.minecraft.item.Item;
@Mod(
modid = "Genetics",
@@ -106,7 +104,7 @@ public class Genetics extends AbstractMod {
@Override
public boolean isActive() {
return BinnieCore.isGeneticsActive();
return true;
}
public static class PacketHandler extends BinniePacketHandler {
@@ -306,7 +306,7 @@ public class ModuleItem implements IInitializable {
// as above, there are only 24 permutations here; let's find a way to just get those recipes rather than trying
// 256 combinations in an n^4 loop. This will help performance and maybe be a bit more maintainable.
if (BinnieCore.isBotanyActive() && BinnieCore.isExtraBeesActive() && BinnieCore.isExtraTreesActive()) {
if (BinnieCore.isExtraBeesActive() && BinnieCore.isExtraTreesActive()) {
// 24 full recipe lines is a bit much to maintain; so we'll use a loop here, but we're only going
// to run it 24 times. Start by making an array of all 24 valid dictionary permutations...
String[] permutations = new String[] { "btlf", "btfl", "bltf", "blft", "bftl", "bflt", "tblf", "tbfl",
@@ -23,11 +23,6 @@ public enum AdvGeneticMachine implements IMachineType {
return cls;
}
@Override
public boolean isActive() {
return true;
}
public ItemStack get(int i) {
return new ItemStack(Genetics.packageAdvGenetic.getBlock(), i, ordinal());
}
@@ -116,9 +116,8 @@ public class ComponentGUIHolder extends MachineComponent implements INetwork.Til
}
List<Item> validSelections = new ArrayList<>();
if (BinnieCore.isBotanyActive()) {
validSelections.add(Botany.database);
}
validSelections.add(Botany.database);
if (BinnieCore.isExtraBeesActive()) {
validSelections.add(ExtraBees.dictionary);
}
@@ -28,11 +28,6 @@ public enum GeneticMachine implements IMachineType {
return clss;
}
@Override
public boolean isActive() {
return true;
}
public ItemStack get(int i) {
return new ItemStack(Genetics.packageGenetic.getBlock(), i, ordinal());
}
@@ -30,11 +30,6 @@ public enum LaboratoryMachine implements IMachineType {
return clss;
}
@Override
public boolean isActive() {
return true;
}
public ItemStack get(int i) {
return new ItemStack(Genetics.packageLabMachine.getBlock(), i, ordinal());
}
@@ -106,17 +106,15 @@ public class Acclimatiser {
ToleranceType.Temperature);
}
if (BinnieCore.isBotanyActive()) {
addTolerance(
Binnie.Genetics.getFlowerRoot().getUID(),
EnumFlowerChromosome.HUMIDITY_TOLERANCE,
ToleranceType.Humidity);
addTolerance(
Binnie.Genetics.getFlowerRoot().getUID(),
EnumFlowerChromosome.TEMPERATURE_TOLERANCE,
ToleranceType.Temperature);
addTolerance(Binnie.Genetics.getFlowerRoot().getUID(), EnumFlowerChromosome.PH_TOLERANCE, ToleranceType.PH);
}
addTolerance(
Binnie.Genetics.getFlowerRoot().getUID(),
EnumFlowerChromosome.HUMIDITY_TOLERANCE,
ToleranceType.Humidity);
addTolerance(
Binnie.Genetics.getFlowerRoot().getUID(),
EnumFlowerChromosome.TEMPERATURE_TOLERANCE,
ToleranceType.Temperature);
addTolerance(Binnie.Genetics.getFlowerRoot().getUID(), EnumFlowerChromosome.PH_TOLERANCE, ToleranceType.PH);
addTemperatureItem(new ItemStack(Items.blaze_powder), 0.5f);
addTemperatureItem(new ItemStack(Items.blaze_rod), 0.75f);
@@ -37,11 +37,10 @@ public class AcclimatiserRecipeHandler extends RecipeHandlerBase {
targets.add(Mods.forestry.stack("caterpillarGE", 1, OreDictionary.WILDCARD_VALUE));
targets.add(Mods.forestry.stack("serumGE", 1, OreDictionary.WILDCARD_VALUE));
}
if (BinnieCore.isBotanyActive()) {
targets.add(new ItemStack(Botany.flowerItem, 1, OreDictionary.WILDCARD_VALUE));
targets.add(new ItemStack(Botany.seed, 1, OreDictionary.WILDCARD_VALUE));
targets.add(new ItemStack(Botany.pollen, 1, OreDictionary.WILDCARD_VALUE));
}
targets.add(new ItemStack(Botany.flowerItem, 1, OreDictionary.WILDCARD_VALUE));
targets.add(new ItemStack(Botany.seed, 1, OreDictionary.WILDCARD_VALUE));
targets.add(new ItemStack(Botany.pollen, 1, OreDictionary.WILDCARD_VALUE));
recipes.add(new AcclimatiserRecipe(targets, resource, effect, ToleranceType.Temperature));
});
Acclimatiser.humidityItems.forEach((resource, effect) -> {
@@ -57,11 +56,10 @@ public class AcclimatiserRecipeHandler extends RecipeHandlerBase {
targets.add(Mods.forestry.stack("caterpillarGE", 1, OreDictionary.WILDCARD_VALUE));
targets.add(Mods.forestry.stack("serumGE", 1, OreDictionary.WILDCARD_VALUE));
}
if (BinnieCore.isBotanyActive()) {
targets.add(new ItemStack(Botany.flowerItem, 1, OreDictionary.WILDCARD_VALUE));
targets.add(new ItemStack(Botany.seed, 1, OreDictionary.WILDCARD_VALUE));
targets.add(new ItemStack(Botany.pollen, 1, OreDictionary.WILDCARD_VALUE));
}
targets.add(new ItemStack(Botany.flowerItem, 1, OreDictionary.WILDCARD_VALUE));
targets.add(new ItemStack(Botany.seed, 1, OreDictionary.WILDCARD_VALUE));
targets.add(new ItemStack(Botany.pollen, 1, OreDictionary.WILDCARD_VALUE));
recipes.add(new AcclimatiserRecipe(targets, resource, effect, ToleranceType.Humidity));
});
}
@@ -42,11 +42,10 @@ public class AnalyserRecipeHandler extends RecipeHandlerBase {
recipes.add(new AnalyserRecipe(Mods.forestry.stack("caterpillarGE", 1, OreDictionary.WILDCARD_VALUE)));
recipes.add(new AnalyserRecipe(Mods.forestry.stack("serumGE", 1, OreDictionary.WILDCARD_VALUE)));
}
if (BinnieCore.isBotanyActive()) {
recipes.add(new AnalyserRecipe(new ItemStack(Botany.flowerItem, 1, OreDictionary.WILDCARD_VALUE)));
recipes.add(new AnalyserRecipe(new ItemStack(Botany.seed, 1, OreDictionary.WILDCARD_VALUE)));
recipes.add(new AnalyserRecipe(new ItemStack(Botany.pollen, 1, OreDictionary.WILDCARD_VALUE)));
}
recipes.add(new AnalyserRecipe(new ItemStack(Botany.flowerItem, 1, OreDictionary.WILDCARD_VALUE)));
recipes.add(new AnalyserRecipe(new ItemStack(Botany.seed, 1, OreDictionary.WILDCARD_VALUE)));
recipes.add(new AnalyserRecipe(new ItemStack(Botany.pollen, 1, OreDictionary.WILDCARD_VALUE)));
}
@Override
@@ -44,11 +44,10 @@ public class GenepoolRecipeHandler extends RecipeHandlerBase {
recipes.add(new GenepoolRecipe(Mods.forestry.stack("caterpillarGE", 1, OreDictionary.WILDCARD_VALUE)));
recipes.add(new GenepoolRecipe(Mods.forestry.stack("serumGE", 1, OreDictionary.WILDCARD_VALUE)));
}
if (BinnieCore.isBotanyActive()) {
recipes.add(new GenepoolRecipe(new ItemStack(Botany.flowerItem, 1, OreDictionary.WILDCARD_VALUE)));
recipes.add(new GenepoolRecipe(new ItemStack(Botany.seed, 1, OreDictionary.WILDCARD_VALUE)));
recipes.add(new GenepoolRecipe(new ItemStack(Botany.pollen, 1, OreDictionary.WILDCARD_VALUE)));
}
recipes.add(new GenepoolRecipe(new ItemStack(Botany.flowerItem, 1, OreDictionary.WILDCARD_VALUE)));
recipes.add(new GenepoolRecipe(new ItemStack(Botany.seed, 1, OreDictionary.WILDCARD_VALUE)));
recipes.add(new GenepoolRecipe(new ItemStack(Botany.pollen, 1, OreDictionary.WILDCARD_VALUE)));
}
@Override
@@ -44,8 +44,8 @@ public class InoculatorRecipeHandler extends RecipeHandlerBase {
createInoculatorRecipeForNEI(Mods.forestry.stack("pollenFertile", 1, OreDictionary.WILDCARD_VALUE));
if (BinnieCore.isLepidopteryActive())
createInoculatorRecipeForNEI(Mods.forestry.stack("serumGE", 1, OreDictionary.WILDCARD_VALUE));
if (BinnieCore.isBotanyActive())
createInoculatorRecipeForNEI(new ItemStack(Botany.pollen, 1, OreDictionary.WILDCARD_VALUE));
createInoculatorRecipeForNEI(new ItemStack(Botany.pollen, 1, OreDictionary.WILDCARD_VALUE));
}
@Override
@@ -50,11 +50,10 @@ public class IsolatorRecipeHandler extends RecipeHandlerBase {
recipes.add(new IsolatorRecipe(Mods.forestry.stack("caterpillarGE", 1, OreDictionary.WILDCARD_VALUE)));
recipes.add(new IsolatorRecipe(Mods.forestry.stack("serumGE", 1, OreDictionary.WILDCARD_VALUE)));
}
if (BinnieCore.isBotanyActive()) {
recipes.add(new IsolatorRecipe(new ItemStack(Botany.flowerItem, 1, OreDictionary.WILDCARD_VALUE)));
recipes.add(new IsolatorRecipe(new ItemStack(Botany.seed, 1, OreDictionary.WILDCARD_VALUE)));
recipes.add(new IsolatorRecipe(new ItemStack(Botany.pollen, 1, OreDictionary.WILDCARD_VALUE)));
}
recipes.add(new IsolatorRecipe(new ItemStack(Botany.flowerItem, 1, OreDictionary.WILDCARD_VALUE)));
recipes.add(new IsolatorRecipe(new ItemStack(Botany.seed, 1, OreDictionary.WILDCARD_VALUE)));
recipes.add(new IsolatorRecipe(new ItemStack(Botany.pollen, 1, OreDictionary.WILDCARD_VALUE)));
}
@Override
@@ -44,8 +44,8 @@ public class SplicerRecipeHandler extends RecipeHandlerBase {
createSplicerRecipeForNEI(Mods.forestry.stack("pollenFertile", 1, OreDictionary.WILDCARD_VALUE));
if (BinnieCore.isLepidopteryActive())
createSplicerRecipeForNEI(Mods.forestry.stack("serumGE", 1, OreDictionary.WILDCARD_VALUE));
if (BinnieCore.isBotanyActive())
createSplicerRecipeForNEI(new ItemStack(Botany.pollen, 1, OreDictionary.WILDCARD_VALUE));
createSplicerRecipeForNEI(new ItemStack(Botany.pollen, 1, OreDictionary.WILDCARD_VALUE));
}
@Override