mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-18 11:19:28 +00:00
Fix #209. Hardened plugin loading. IC2 machines load only with IC2
This commit is contained in:
1 parent
23ae1abb06
commit
2986536e66
16 files changed
+295
-186
No files matched your search
@@ -53,9 +53,12 @@ import net.minecraft.item.Item;
|
||||
version = Version.VERSION,
|
||||
dependencies = "required-after:Forge@[10.13.0.1207,);"
|
||||
+ "after:Buildcraft|Core;"
|
||||
+ "after:Buildcraft|Transport;"
|
||||
+ "after:ExtrabiomesXL;"
|
||||
+ "after:BiomesOPlenty;"
|
||||
+ "after:IC2")
|
||||
+ "after:IC2;"
|
||||
+ "after:Natura;"
|
||||
+ "after:mod_EE")
|
||||
//, certificateFingerprint = Version.FINGERPRINT)
|
||||
public class Forestry {
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ package forestry.core;
|
||||
import java.util.List;
|
||||
|
||||
import forestry.core.utils.StringUtil;
|
||||
import forestry.plugins.PluginModule;
|
||||
import net.minecraft.command.CommandException;
|
||||
import net.minecraft.command.ICommand;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
@@ -96,7 +97,7 @@ public class CommandForestry extends CommandMC {
|
||||
|
||||
String pluginList = "";
|
||||
|
||||
for (PluginManager.Module pluginModule : PluginManager.getLoadedModules()) {
|
||||
for (PluginModule pluginModule : PluginManager.getLoadedModules()) {
|
||||
if (!pluginList.isEmpty())
|
||||
pluginList += ", ";
|
||||
pluginList += makeListEntry(pluginModule.instance());
|
||||
@@ -111,7 +112,7 @@ public class CommandForestry extends CommandMC {
|
||||
throw new WrongUsageException("/" + getCommandName() + " plugins info <plugin-name>");
|
||||
|
||||
ForestryPlugin found = null;
|
||||
for (PluginManager.Module pluginModule : PluginManager.getLoadedModules()) {
|
||||
for (PluginModule pluginModule : PluginManager.getLoadedModules()) {
|
||||
Plugin info = pluginModule.instance().getClass().getAnnotation(Plugin.class);
|
||||
if (info == null)
|
||||
continue;
|
||||
|
||||
@@ -125,6 +125,7 @@ public class Defaults {
|
||||
public static final int ID_PACKAGE_MACHINE_STILL = 1;
|
||||
public static final int ID_PACKAGE_MACHINE_BOTTLER = 2;
|
||||
public static final int ID_PACKAGE_MACHINE_RAINTANK = 3;
|
||||
public static final int ID_PACKAGE_MACHINE_GENERATOR = 4;
|
||||
public static final int ID_PACKAGE_MACHINE_CARPENTER = 5;
|
||||
public static final int ID_PACKAGE_MACHINE_MOISTENER = 6;
|
||||
public static final int ID_PACKAGE_MACHINE_APIARY = 7;
|
||||
|
||||
@@ -110,7 +110,11 @@ public class BlockBase extends BlockForestry {
|
||||
if (metadata >= definitions.size() || definitions.get(metadata) == null)
|
||||
metadata = 0;
|
||||
|
||||
return definitions.get(metadata).createMachine();
|
||||
MachineDefinition definition = definitions.get(metadata);
|
||||
if (definition == null)
|
||||
return null;
|
||||
|
||||
return definition.createMachine();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -207,6 +211,9 @@ public class BlockBase extends BlockForestry {
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
|
||||
|
||||
IOwnable tile = (IOwnable) world.getTileEntity(x, y, z);
|
||||
if (tile == null)
|
||||
return world.setBlockToAir(x, y, z);
|
||||
|
||||
if (tile.isOwnable() && !tile.allowsRemoval(player))
|
||||
return false;
|
||||
|
||||
@@ -234,6 +241,8 @@ public class BlockBase extends BlockForestry {
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
for (MachineDefinition def : definitions) {
|
||||
if (def == null)
|
||||
continue;
|
||||
def.registerIcons(register);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,20 +10,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.core.gadgets;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import buildcraft.api.gates.ITrigger;
|
||||
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import forestry.api.core.ISpecialInventory;
|
||||
@@ -40,7 +27,19 @@ import forestry.plugins.PluginApiculture;
|
||||
import forestry.plugins.PluginCore;
|
||||
import forestry.plugins.PluginEnergy;
|
||||
import forestry.plugins.PluginFactory;
|
||||
import forestry.plugins.PluginIC2;
|
||||
import forestry.plugins.PluginMail;
|
||||
import forestry.plugins.PluginManager;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
|
||||
public abstract class TileMachine extends TileForestry implements ISpecialInventory, IClimatised, IHintSource {
|
||||
|
||||
@@ -153,7 +152,8 @@ public abstract class TileMachine extends TileForestry implements ISpecialInvent
|
||||
machineMap.put(Defaults.ID_PACKAGE_MACHINE_SQUEEZER, PluginFactory.definitionSqueezer);
|
||||
machineMap.put(Defaults.ID_PACKAGE_MACHINE_STILL, PluginFactory.definitionStill);
|
||||
machineMap.put(Defaults.ID_PACKAGE_MACHINE_APIARY, PluginApiculture.definitionApiary);
|
||||
machineMap.put(4, PluginEnergy.definitionGenerator);
|
||||
if (PluginManager.isModuleLoaded(PluginIC2.class))
|
||||
machineMap.put(Defaults.ID_PACKAGE_MACHINE_GENERATOR, PluginIC2.definitionGenerator);
|
||||
definitionMap.put(ForestryBlock.factoryTESR.block(), machineMap);
|
||||
|
||||
HashMap<Integer, MachineDefinition> millMap = new HashMap<Integer, MachineDefinition>();
|
||||
@@ -168,7 +168,8 @@ public abstract class TileMachine extends TileForestry implements ISpecialInvent
|
||||
HashMap<Integer, MachineDefinition> engineMap = new HashMap<Integer, MachineDefinition>();
|
||||
engineMap.put(0, PluginEnergy.definitionEngineBronze);
|
||||
engineMap.put(1, PluginEnergy.definitionEngineCopper);
|
||||
engineMap.put(2, PluginEnergy.definitionEngineTin);
|
||||
if (PluginManager.isModuleLoaded(PluginIC2.class))
|
||||
engineMap.put(2, PluginIC2.definitionEngineTin);
|
||||
definitionMap.put(ForestryBlock.engine.block(), engineMap);
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.energy.gadgets;
|
||||
|
||||
import forestry.plugins.PluginManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
@@ -63,7 +64,8 @@ public class EngineTin extends Engine implements ISocketable, IInventory {
|
||||
super(Defaults.ENGINE_TIN_HEAT_MAX, 10000, 400);
|
||||
setHints(Config.hints.get("engine.tin"));
|
||||
|
||||
if (PluginIC2.instance.isAvailable()) ic2EnergySink = new BasicSink(this, euConfig.euStorage, 3);
|
||||
if (PluginManager.isModuleLoaded(PluginIC2.class))
|
||||
ic2EnergySink = new BasicSink(this, euConfig.euStorage, 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,19 +10,6 @@
|
||||
******************************************************************************/
|
||||
package forestry.energy.gadgets;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.core.ISpecialInventory;
|
||||
import forestry.api.fuels.FuelManager;
|
||||
@@ -30,9 +17,8 @@ import forestry.api.fuels.GeneratorFuel;
|
||||
import forestry.core.EnumErrorCode;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.Defaults;
|
||||
import forestry.core.fluids.tanks.StandardTank;
|
||||
import forestry.core.fluids.tanks.FilteredTank;
|
||||
import forestry.core.fluids.TankManager;
|
||||
import forestry.core.fluids.tanks.FilteredTank;
|
||||
import forestry.core.gadgets.TileBase;
|
||||
import forestry.core.interfaces.ILiquidTankContainer;
|
||||
import forestry.core.interfaces.IRenderableMachine;
|
||||
@@ -44,8 +30,18 @@ import forestry.core.utils.LiquidHelper;
|
||||
import forestry.core.utils.StackUtils;
|
||||
import forestry.core.utils.Utils;
|
||||
import forestry.plugins.PluginIC2;
|
||||
import forestry.plugins.PluginManager;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
public class MachineGenerator extends TileBase implements ISpecialInventory, ILiquidTankContainer, IRenderableMachine {
|
||||
|
||||
@@ -67,7 +63,7 @@ public class MachineGenerator extends TileBase implements ISpecialInventory, ILi
|
||||
resourceTank = new FilteredTank(Defaults.PROCESSOR_TANK_CAPACITY, FuelManager.generatorFuel.keySet());
|
||||
tankManager = new TankManager(resourceTank);
|
||||
|
||||
if (PluginIC2.instance.isAvailable()) {
|
||||
if (PluginManager.isModuleLoaded(PluginIC2.class)) {
|
||||
ic2EnergySource = new BasicSource(this, maxEnergy, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,20 +11,18 @@
|
||||
package forestry.plugins;
|
||||
|
||||
import cpw.mods.fml.common.IFuelHandler;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.command.ICommand;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
|
||||
import forestry.core.interfaces.IOreDictionaryHandler;
|
||||
import forestry.core.interfaces.IPacketHandler;
|
||||
import forestry.core.interfaces.IPickupHandler;
|
||||
import forestry.core.interfaces.IResupplyHandler;
|
||||
import forestry.core.interfaces.ISaveEventHandler;
|
||||
import java.util.EnumSet;
|
||||
import net.minecraft.command.ICommand;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Random;
|
||||
|
||||
public abstract class ForestryPlugin {
|
||||
|
||||
@@ -36,8 +34,11 @@ public abstract class ForestryPlugin {
|
||||
return "";
|
||||
}
|
||||
|
||||
public EnumSet<PluginManager.Module> getDependancies() {
|
||||
return EnumSet.of(PluginManager.Module.CORE);
|
||||
public HashSet<Class<? extends ForestryPlugin>> getDependencies() {
|
||||
HashSet<Class<? extends ForestryPlugin>> dependencies = new HashSet<Class<? extends ForestryPlugin>>();
|
||||
dependencies.add(PluginCore.class);
|
||||
|
||||
return dependencies;
|
||||
}
|
||||
|
||||
protected void preInit() {
|
||||
|
||||
@@ -10,15 +10,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.plugins;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
|
||||
import forestry.api.circuits.ChipsetManager;
|
||||
import forestry.api.circuits.ICircuitLayout;
|
||||
import forestry.api.fuels.FuelManager;
|
||||
@@ -26,7 +19,6 @@ import forestry.api.fuels.GeneratorFuel;
|
||||
import forestry.core.GameMode;
|
||||
import forestry.core.circuits.Circuit;
|
||||
import forestry.core.circuits.CircuitId;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.Defaults;
|
||||
import forestry.core.config.ForestryBlock;
|
||||
import forestry.core.config.ForestryItem;
|
||||
@@ -50,17 +42,19 @@ import forestry.energy.gadgets.EngineDefinition;
|
||||
import forestry.energy.gadgets.EngineTin;
|
||||
import forestry.energy.gadgets.MachineGenerator;
|
||||
import forestry.energy.proxy.ProxyEnergy;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
@Plugin(pluginID = "Energy", name = "Energy", author = "SirSengir", url = Defaults.URL, description = "Adds several engines compatible with BuildCraft 3 as well as a generator for IC2.")
|
||||
public class PluginEnergy extends ForestryPlugin {
|
||||
|
||||
@SidedProxy(clientSide = "forestry.energy.proxy.ClientProxyEnergy", serverSide = "forestry.energy.proxy.ProxyEnergy")
|
||||
public static ProxyEnergy proxy;
|
||||
public static MachineDefinition definitionEngineTin;
|
||||
public static MachineDefinition definitionEngineCopper;
|
||||
public static MachineDefinition definitionEngineBronze;
|
||||
public static MachineDefinition definitionEngineClockwork;
|
||||
public static MachineDefinition definitionGenerator;
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
@@ -68,16 +62,6 @@ public class PluginEnergy extends ForestryPlugin {
|
||||
|
||||
ForestryBlock.engine.registerBlock(new BlockBase(Material.iron, true), ItemForestryBlock.class, "engine");
|
||||
|
||||
definitionEngineTin = ((BlockBase) ForestryBlock.engine.block()).addDefinition(new EngineDefinition(Defaults.DEFINITION_ENGINETIN_META, "forestry.EngineTin", EngineTin.class,
|
||||
PluginEnergy.proxy.getRenderDefaultEngine(Defaults.TEXTURE_PATH_BLOCKS + "/engine_tin_"), ShapedRecipeCustom.createShapedRecipe(
|
||||
ForestryBlock.engine.getItemStack(1, Defaults.DEFINITION_ENGINETIN_META),
|
||||
"###",
|
||||
" X ",
|
||||
"YVY",
|
||||
'#', "ingotTin",
|
||||
'X', Blocks.glass,
|
||||
'Y', "gearTin",
|
||||
'V', Blocks.piston)));
|
||||
definitionEngineCopper = ((BlockBase) ForestryBlock.engine.block()).addDefinition(new EngineDefinition(Defaults.DEFINITION_ENGINECOPPER_META, "forestry.EngineCopper", EngineCopper.class,
|
||||
PluginEnergy.proxy.getRenderDefaultEngine(Defaults.TEXTURE_PATH_BLOCKS + "/engine_copper_"), ShapedRecipeCustom.createShapedRecipe(
|
||||
ForestryBlock.engine.getItemStack(1, Defaults.DEFINITION_ENGINECOPPER_META),
|
||||
@@ -99,16 +83,6 @@ public class PluginEnergy extends ForestryPlugin {
|
||||
'Y', "gearBronze",
|
||||
'V', Blocks.piston)));
|
||||
|
||||
definitionGenerator = ((BlockBase) ForestryBlock.engine.block()).addDefinition(new MachineDefinition(Defaults.DEFINITION_GENERATOR_META, "forestry.Generator", MachineGenerator.class,
|
||||
Proxies.render.getRenderDefaultMachine(Defaults.TEXTURE_PATH_BLOCKS + "/generator_"), ShapedRecipeCustom.createShapedRecipe(
|
||||
ForestryBlock.engine.getItemStack(1, Defaults.DEFINITION_GENERATOR_META),
|
||||
"X#X",
|
||||
"XYX",
|
||||
"X#X",
|
||||
'#', Blocks.glass,
|
||||
'X', Items.gold_ingot,
|
||||
'Y', ForestryItem.sturdyCasing)));
|
||||
|
||||
ShapedRecipeCustom clockworkRecipe = null;
|
||||
if (GameMode.getGameMode().getBooleanSetting("energy.engine.clockwork"))
|
||||
clockworkRecipe = ShapedRecipeCustom.createShapedRecipe(
|
||||
@@ -136,10 +110,8 @@ public class PluginEnergy extends ForestryPlugin {
|
||||
public void doInit() {
|
||||
super.doInit();
|
||||
|
||||
definitionEngineTin.register();
|
||||
definitionEngineCopper.register();
|
||||
definitionEngineBronze.register();
|
||||
definitionGenerator.register();
|
||||
definitionEngineClockwork.register();
|
||||
|
||||
FluidStack ethanol = LiquidHelper.getLiquid(Defaults.LIQUID_ETHANOL, 1);
|
||||
|
||||
@@ -22,7 +22,6 @@ import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import forestry.api.recipes.ICraftingProvider;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.core.GameMode;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.Defaults;
|
||||
import forestry.core.config.ForestryBlock;
|
||||
import forestry.core.config.ForestryItem;
|
||||
@@ -264,9 +263,6 @@ public class PluginFactory extends ForestryPlugin {
|
||||
" X ", "#X#", "XXX", '#', Items.redstone, 'X', Blocks.obsidian});
|
||||
RecipeManagers.fabricatorManager.addRecipe(null, LiquidHelper.getLiquid(Defaults.LIQUID_GLASS, 500), ForestryItem.tubes.getItemStack(4, 7), new Object[]{
|
||||
" X ", "#X#", "XXX", '#', Items.redstone, 'X', Items.blaze_powder});
|
||||
if (PluginIC2.rubber != null)
|
||||
RecipeManagers.fabricatorManager.addRecipe(null, LiquidHelper.getLiquid(Defaults.LIQUID_GLASS, 500), ForestryItem.tubes.getItemStack(4, 8),
|
||||
new Object[]{" X ", "#X#", "XXX", '#', Items.redstone, 'X', PluginIC2.rubber});
|
||||
RecipeManagers.fabricatorManager.addRecipe(null, LiquidHelper.getLiquid(Defaults.LIQUID_GLASS, 500), ForestryItem.tubes.getItemStack(4, 9), new Object[]{
|
||||
" X ", "#X#", "XXX", '#', Items.redstone, 'X', Items.emerald});
|
||||
RecipeManagers.fabricatorManager.addRecipe(null, LiquidHelper.getLiquid(Defaults.LIQUID_GLASS, 500), ForestryItem.tubes.getItemStack(4, 10),
|
||||
|
||||
@@ -10,30 +10,17 @@
|
||||
******************************************************************************/
|
||||
package forestry.plugins;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import cpw.mods.fml.common.registry.GameData;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import forestry.api.circuits.ChipsetManager;
|
||||
import forestry.api.circuits.ICircuitLayout;
|
||||
import forestry.api.farming.Farmables;
|
||||
import forestry.api.farming.IFarmable;
|
||||
import forestry.core.circuits.Circuit;
|
||||
import forestry.core.circuits.CircuitLayout;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.Defaults;
|
||||
import forestry.core.config.ForestryBlock;
|
||||
import forestry.core.config.ForestryItem;
|
||||
@@ -79,6 +66,15 @@ import forestry.farming.proxy.ProxyFarming;
|
||||
import forestry.farming.triggers.TriggerLowFertilizer;
|
||||
import forestry.farming.triggers.TriggerLowLiquid;
|
||||
import forestry.farming.triggers.TriggerLowSoil;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@Plugin(pluginID = "Farming", name = "Farming", author = "SirSengir", url = Defaults.URL, description = "Adds automatic farms and harvesters for a wide variety of products.")
|
||||
public class PluginFarming extends ForestryPlugin {
|
||||
@@ -182,7 +178,6 @@ public class PluginFarming extends ForestryPlugin {
|
||||
Circuit.farmCocoaManual = new CircuitFarmLogic("manualCocoa", FarmLogicCocoa.class).setManual();
|
||||
|
||||
Circuit.farmOrchardManual = new CircuitFarmLogic("manualOrchard", FarmLogicOrchard.class);
|
||||
Circuit.farmRubberManual = new CircuitFarmLogic("manualRubber", FarmLogicRubber.class);
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandlerFarming());
|
||||
}
|
||||
@@ -351,8 +346,5 @@ public class PluginFarming extends ForestryPlugin {
|
||||
ChipsetManager.solderManager.addRecipe(layoutManual, ForestryItem.tubes.getItemStack(1, 6), Circuit.farmGourdManual);
|
||||
ChipsetManager.solderManager.addRecipe(layoutManual, ForestryItem.tubes.getItemStack(1, 10), Circuit.farmShroomManual);
|
||||
ChipsetManager.solderManager.addRecipe(layoutManual, ForestryItem.tubes.getItemStack(1, 11), Circuit.farmCocoaManual);
|
||||
|
||||
if (PluginIC2.resin != null && PluginIC2.rubberwood != null)
|
||||
ChipsetManager.solderManager.addRecipe(layoutManual, ForestryItem.tubes.getItemStack(1, 8), Circuit.farmRubberManual);
|
||||
}
|
||||
}
|
||||
@@ -10,37 +10,54 @@
|
||||
******************************************************************************/
|
||||
package forestry.plugins;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.registry.GameData;
|
||||
|
||||
import ic2.api.item.IC2Items;
|
||||
import ic2.api.recipe.RecipeInputItemStack;
|
||||
import ic2.api.recipe.Recipes;
|
||||
|
||||
import forestry.api.circuits.ChipsetManager;
|
||||
import forestry.api.circuits.ICircuitLayout;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.api.storage.BackpackManager;
|
||||
import forestry.core.GameMode;
|
||||
import forestry.core.circuits.Circuit;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.Configuration;
|
||||
import forestry.core.config.Defaults;
|
||||
import forestry.core.config.ForestryBlock;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.core.gadgets.BlockBase;
|
||||
import forestry.core.gadgets.MachineDefinition;
|
||||
import forestry.core.items.ItemCrated;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.utils.LiquidHelper;
|
||||
import forestry.core.utils.RecipeUtil;
|
||||
import forestry.core.utils.ShapedRecipeCustom;
|
||||
import forestry.core.utils.StackUtils;
|
||||
import forestry.energy.gadgets.EngineDefinition;
|
||||
import forestry.energy.gadgets.EngineTin;
|
||||
import forestry.energy.gadgets.MachineGenerator;
|
||||
import forestry.farming.circuits.CircuitFarmLogic;
|
||||
import forestry.farming.logic.FarmLogicRubber;
|
||||
import ic2.api.item.IC2Items;
|
||||
import ic2.api.recipe.RecipeInputItemStack;
|
||||
import ic2.api.recipe.Recipes;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
@Plugin(pluginID = "IC2", name = "IndustrialCraft2", author = "SirSengir", url = Defaults.URL, description = "Compatibility plugin for IC2.")
|
||||
public class PluginIC2 extends ForestryPlugin {
|
||||
|
||||
public static PluginIC2 instance;
|
||||
public static Configuration config;
|
||||
|
||||
// Ignore IC2?
|
||||
public static boolean ignore;
|
||||
|
||||
// Forestry Stuff
|
||||
public static MachineDefinition definitionGenerator;
|
||||
public static MachineDefinition definitionEngineTin;
|
||||
|
||||
// IC2 stuff
|
||||
public static ItemStack plantBall;
|
||||
public static ItemStack compressedPlantBall;
|
||||
@@ -74,6 +91,41 @@ public class PluginIC2 extends ForestryPlugin {
|
||||
return "IndustrialCraft2 not found";
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashSet<Class<? extends ForestryPlugin>> getDependencies() {
|
||||
HashSet<Class<? extends ForestryPlugin>> dependencies = super.getDependencies();
|
||||
dependencies.add(PluginFactory.class);
|
||||
dependencies.add(PluginFarming.class);
|
||||
dependencies.add(PluginEnergy.class);
|
||||
|
||||
return dependencies;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
|
||||
definitionEngineTin = ((BlockBase) ForestryBlock.engine.block()).addDefinition(new EngineDefinition(Defaults.DEFINITION_ENGINETIN_META, "forestry.EngineTin", EngineTin.class,
|
||||
PluginEnergy.proxy.getRenderDefaultEngine(Defaults.TEXTURE_PATH_BLOCKS + "/engine_tin_"), ShapedRecipeCustom.createShapedRecipe(
|
||||
ForestryBlock.engine.getItemStack(1, Defaults.DEFINITION_ENGINETIN_META),
|
||||
"###",
|
||||
" X ",
|
||||
"YVY",
|
||||
'#', "ingotTin",
|
||||
'X', Blocks.glass,
|
||||
'Y', "gearTin",
|
||||
'V', Blocks.piston)));
|
||||
|
||||
definitionGenerator = ((BlockBase) ForestryBlock.engine.block()).addDefinition(new MachineDefinition(Defaults.DEFINITION_GENERATOR_META, "forestry.Generator", MachineGenerator.class,
|
||||
Proxies.render.getRenderDefaultMachine(Defaults.TEXTURE_PATH_BLOCKS + "/generator_"), ShapedRecipeCustom.createShapedRecipe(
|
||||
ForestryBlock.engine.getItemStack(1, Defaults.DEFINITION_GENERATOR_META),
|
||||
"X#X",
|
||||
"XYX",
|
||||
"X#X",
|
||||
'#', Blocks.glass,
|
||||
'X', Items.gold_ingot,
|
||||
'Y', ForestryItem.sturdyCasing)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doInit() {
|
||||
config = Config.config;
|
||||
@@ -82,11 +134,31 @@ public class PluginIC2 extends ForestryPlugin {
|
||||
initRubberChain();
|
||||
initFermentation();
|
||||
|
||||
definitionEngineTin.register();
|
||||
definitionGenerator.register();
|
||||
|
||||
if (resin != null && rubberwood != null) {
|
||||
Circuit.farmRubberManual = new CircuitFarmLogic("manualRubber", FarmLogicRubber.class);
|
||||
}
|
||||
|
||||
// Remove some items from the recycler
|
||||
Recipes.recyclerBlacklist.add(new RecipeInputItemStack(ForestryItem.beeQueenGE.getItemStack()));
|
||||
Recipes.recyclerBlacklist.add(new RecipeInputItemStack(ForestryItem.beePrincessGE.getItemStack()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerRecipes() {
|
||||
if (rubber != null) {
|
||||
RecipeManagers.fabricatorManager.addRecipe(null, LiquidHelper.getLiquid(Defaults.LIQUID_GLASS, 500), ForestryItem.tubes.getItemStack(4, 8),
|
||||
new Object[]{" X ", "#X#", "XXX", '#', Items.redstone, 'X', rubber});
|
||||
}
|
||||
|
||||
if (Circuit.farmRubberManual != null) {
|
||||
ICircuitLayout layoutManual = ChipsetManager.circuitRegistry.getLayout("forestry.farms.manual");
|
||||
ChipsetManager.solderManager.addRecipe(layoutManual, ForestryItem.tubes.getItemStack(1, 8), Circuit.farmRubberManual);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerBackpackItems() {
|
||||
if (BackpackManager.backpackItems == null)
|
||||
|
||||
@@ -11,28 +11,18 @@
|
||||
package forestry.plugins;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import cpw.mods.fml.common.IFuelHandler;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import forestry.Forestry;
|
||||
|
||||
import forestry.core.interfaces.IOreDictionaryHandler;
|
||||
import forestry.core.interfaces.IPacketHandler;
|
||||
import forestry.core.interfaces.IPickupHandler;
|
||||
import forestry.core.interfaces.IResupplyHandler;
|
||||
import forestry.core.interfaces.ISaveEventHandler;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import java.io.File;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import net.minecraft.command.CommandHandler;
|
||||
import net.minecraft.command.ICommand;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
@@ -40,6 +30,16 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
public class PluginManager {
|
||||
|
||||
public static final String MODULE_CONFIG_FILE_NAME = "modules.cfg";
|
||||
@@ -52,8 +52,8 @@ public class PluginManager {
|
||||
public static ArrayList<IResupplyHandler> resupplyHandlers = Lists.newArrayList();
|
||||
public static ArrayList<IOreDictionaryHandler> dictionaryHandlers = Lists.newArrayList();
|
||||
|
||||
private static final Set<Module> loadedModules = EnumSet.noneOf(Module.class);
|
||||
private static final Set<Module> unloadedModules = EnumSet.allOf(Module.class);
|
||||
private static ArrayList<PluginModule> loadedModules;
|
||||
private static ArrayList<PluginModule> unloadedModules;
|
||||
private static Stage stage = Stage.SETUP;
|
||||
|
||||
public enum Stage {
|
||||
@@ -61,51 +61,52 @@ public class PluginManager {
|
||||
SETUP, PRE_INIT, INIT, POST_INIT, INIT_DISABLED, FINISHED;
|
||||
}
|
||||
|
||||
public enum Module {
|
||||
private static HashMap<Class<? extends ForestryPlugin>, PluginModule> pluginModules = new HashMap<Class<? extends ForestryPlugin>, PluginModule>();
|
||||
|
||||
CORE(new PluginCore()),
|
||||
APICULTURE(new PluginApiculture()),
|
||||
ARBORICULTURE(new PluginArboriculture()),
|
||||
ENERGY(new PluginEnergy()),
|
||||
FACTORY(new PluginFactory()),
|
||||
FARMING(new PluginFarming()),
|
||||
FOOD(new PluginFood()),
|
||||
LEPIDOPTEROLOGY(new PluginLepidopterology()),
|
||||
MAIL(new PluginMail()),
|
||||
STORAGE(new PluginStorage()),
|
||||
BUILDCRAFT(new PluginBuildCraft()),
|
||||
PROPOLIS_PIPE(new PluginPropolisPipe()),
|
||||
EQUIVELENT_EXCHANGE(new PluginEE()),
|
||||
FARM_CRAFTORY(new PluginFarmCraftory()),
|
||||
INDUSTRIALCRAFT(new PluginIC2()),
|
||||
NATURA(new PluginNatura()),;
|
||||
static {
|
||||
ArrayList<Class<? extends ForestryPlugin>> pluginClasses = new ArrayList<Class<? extends ForestryPlugin>>();
|
||||
pluginClasses.add(PluginCore.class);
|
||||
pluginClasses.add(PluginApiculture.class);
|
||||
pluginClasses.add(PluginArboriculture.class);
|
||||
pluginClasses.add(PluginEnergy.class);
|
||||
pluginClasses.add(PluginFactory.class);
|
||||
pluginClasses.add(PluginFarming.class);
|
||||
pluginClasses.add(PluginFood.class);
|
||||
pluginClasses.add(PluginLepidopterology.class);
|
||||
pluginClasses.add(PluginMail.class);
|
||||
pluginClasses.add(PluginStorage.class);
|
||||
pluginClasses.add(PluginBuildCraft.class);
|
||||
pluginClasses.add(PluginPropolisPipe.class);
|
||||
pluginClasses.add(PluginEE.class);
|
||||
pluginClasses.add(PluginFarmCraftory.class);
|
||||
pluginClasses.add(PluginIC2.class);
|
||||
pluginClasses.add(PluginNatura.class);
|
||||
|
||||
private final ForestryPlugin instance;
|
||||
unloadedModules = new ArrayList<PluginModule>();
|
||||
loadedModules = new ArrayList<PluginModule>();
|
||||
|
||||
private Module(ForestryPlugin plugin) {
|
||||
this.instance = plugin;
|
||||
for (Class<? extends ForestryPlugin>pluginClass : pluginClasses) {
|
||||
PluginModule pluginModule = new PluginModule(pluginClass);
|
||||
pluginModules.put(pluginClass, pluginModule);
|
||||
unloadedModules.add(pluginModule);
|
||||
}
|
||||
|
||||
public ForestryPlugin instance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return isModuleLoaded(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static Stage getStage() {
|
||||
return stage;
|
||||
}
|
||||
|
||||
public static EnumSet<Module> getLoadedModules() {
|
||||
return EnumSet.copyOf(loadedModules);
|
||||
public static PluginModule getPluginModule(Class<? extends ForestryPlugin> pluginClass) {
|
||||
return pluginModules.get(pluginClass);
|
||||
}
|
||||
|
||||
public static boolean isModuleLoaded(Module module) {
|
||||
return loadedModules.contains(module);
|
||||
public static List<PluginModule> getLoadedModules() {
|
||||
return new ArrayList<PluginModule>(loadedModules);
|
||||
}
|
||||
|
||||
public static boolean isModuleLoaded(Class<? extends ForestryPlugin> pluginClass) {
|
||||
PluginModule pluginModule = pluginModules.get(pluginClass);
|
||||
return loadedModules.contains(pluginModule);
|
||||
}
|
||||
|
||||
public static void addPlugin(ForestryPlugin plugin) {
|
||||
@@ -123,21 +124,20 @@ public class PluginManager {
|
||||
config.addCustomCategoryComment(CATEGORY_MODULES, "Disabling these modules can greatly change how the mod functions.\n"
|
||||
+ "Your milage may vary, please report any issues.");
|
||||
|
||||
Set<Module> toLoad = EnumSet.allOf(Module.class);
|
||||
Iterator<Module> it = toLoad.iterator();
|
||||
ArrayList<PluginModule> toLoad = new ArrayList<PluginModule>(unloadedModules);
|
||||
Iterator<PluginModule> it = toLoad.iterator();
|
||||
while (it.hasNext()) {
|
||||
Module m = it.next();
|
||||
if (m == Module.CORE)
|
||||
PluginModule m = it.next();
|
||||
if (m == getPluginModule(PluginCore.class))
|
||||
continue;
|
||||
if (!isEnabled(config, m)) {
|
||||
it.remove();
|
||||
Proxies.log.info("Module disabled: {0}", m);
|
||||
continue;
|
||||
}
|
||||
ForestryPlugin plugin = m.instance;
|
||||
if (!plugin.isAvailable()) {
|
||||
if (m.instance() == null) {
|
||||
it.remove();
|
||||
Proxies.log.info("Module {0} failed to load: {1}", plugin, plugin.getFailMessage());
|
||||
Proxies.log.info("Module {0} failed to load.", m);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -146,12 +146,17 @@ public class PluginManager {
|
||||
changed = false;
|
||||
it = toLoad.iterator();
|
||||
while (it.hasNext()) {
|
||||
Module m = it.next();
|
||||
Set<Module> deps = m.instance().getDependancies();
|
||||
if (!toLoad.containsAll(deps)) {
|
||||
PluginModule m = it.next();
|
||||
|
||||
Set<Class<? extends ForestryPlugin>> dependenciesClasses = m.instance().getDependencies();
|
||||
Set<PluginModule> dependencies = new HashSet<PluginModule>();
|
||||
for (Class<? extends ForestryPlugin> depClass : dependenciesClasses)
|
||||
dependencies.add(getPluginModule(depClass));
|
||||
|
||||
if (!toLoad.containsAll(dependencies)) {
|
||||
it.remove();
|
||||
changed = true;
|
||||
Proxies.log.warning("Module {0} is missing dependancies: {1}", m, deps);
|
||||
Proxies.log.warning("Module {0} is missing dependencies: {1}", m, dependencies);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -166,8 +171,8 @@ public class PluginManager {
|
||||
Locale.setDefault(locale);
|
||||
|
||||
stage = Stage.PRE_INIT;
|
||||
for (Module m : loadedModules) {
|
||||
ForestryPlugin plugin = m.instance;
|
||||
for (PluginModule m : loadedModules) {
|
||||
ForestryPlugin plugin = m.instance();
|
||||
loadPlugin(plugin);
|
||||
Proxies.log.fine("Pre-Init Start: {0}", plugin);
|
||||
plugin.preInit();
|
||||
@@ -210,8 +215,8 @@ public class PluginManager {
|
||||
|
||||
public static void runInit() {
|
||||
stage = Stage.INIT;
|
||||
for (Module m : loadedModules) {
|
||||
ForestryPlugin plugin = m.instance;
|
||||
for (PluginModule m : loadedModules) {
|
||||
ForestryPlugin plugin = m.instance();
|
||||
Proxies.log.fine("Init Start: {0}", plugin);
|
||||
plugin.registerBackpackItems();
|
||||
plugin.registerCrates();
|
||||
@@ -222,8 +227,8 @@ public class PluginManager {
|
||||
|
||||
public static void runPostInit() {
|
||||
stage = Stage.POST_INIT;
|
||||
for (Module m : loadedModules) {
|
||||
ForestryPlugin plugin = m.instance;
|
||||
for (PluginModule m : loadedModules) {
|
||||
ForestryPlugin plugin = m.instance();
|
||||
Proxies.log.fine("Post-Init Start: {0}", plugin);
|
||||
plugin.registerRecipes();
|
||||
plugin.postInit();
|
||||
@@ -231,11 +236,12 @@ public class PluginManager {
|
||||
}
|
||||
|
||||
stage = Stage.INIT_DISABLED;
|
||||
for (Module m : unloadedModules) {
|
||||
ForestryPlugin plugin = m.instance;
|
||||
Proxies.log.fine("Disabled-Init Start: {0}", plugin);
|
||||
plugin.disabledInit();
|
||||
Proxies.log.fine("Disabled-Init Complete: {0}", plugin);
|
||||
for (PluginModule m : unloadedModules) {
|
||||
ForestryPlugin plugin = m.instance();
|
||||
Proxies.log.fine("Disabled-Init Start: {0}", m);
|
||||
if (plugin != null)
|
||||
plugin.disabledInit();
|
||||
Proxies.log.fine("Disabled-Init Complete: {0}", m);
|
||||
}
|
||||
stage = Stage.FINISHED;
|
||||
}
|
||||
@@ -243,8 +249,8 @@ public class PluginManager {
|
||||
public static void serverStarting(MinecraftServer server) {
|
||||
CommandHandler commandManager = (CommandHandler) server.getCommandManager();
|
||||
|
||||
for (Module m : loadedModules) {
|
||||
ForestryPlugin plugin = m.instance;
|
||||
for (PluginModule m : loadedModules) {
|
||||
ForestryPlugin plugin = m.instance();
|
||||
ICommand[] commands = plugin.getConsoleCommands();
|
||||
if (commands == null)
|
||||
continue;
|
||||
@@ -255,21 +261,21 @@ public class PluginManager {
|
||||
|
||||
public static void processIMCMessages(ImmutableList<FMLInterModComms.IMCMessage> messages) {
|
||||
for (FMLInterModComms.IMCMessage message : messages)
|
||||
for (Module m : loadedModules) {
|
||||
ForestryPlugin plugin = m.instance;
|
||||
for (PluginModule m : loadedModules) {
|
||||
ForestryPlugin plugin = m.instance();
|
||||
if (plugin.processIMCMessage(message))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static void generateSurface(World world, Random rand, int chunkX, int chunkZ) {
|
||||
for (Module m : loadedModules) {
|
||||
ForestryPlugin plugin = m.instance;
|
||||
for (PluginModule m : loadedModules) {
|
||||
ForestryPlugin plugin = m.instance();
|
||||
plugin.generateSurface(world, rand, chunkX, chunkZ);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isEnabled(Configuration config, Module m) {
|
||||
private static boolean isEnabled(Configuration config, PluginModule m) {
|
||||
boolean defaultValue = true;
|
||||
Property prop = config.get(CATEGORY_MODULES, m.toString().toLowerCase(Locale.ENGLISH).replace('_', '.'), defaultValue);
|
||||
return prop.getBoolean(true);
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.plugins;
|
||||
|
||||
import forestry.core.proxy.Proxies;
|
||||
|
||||
public class PluginModule {
|
||||
|
||||
private final String pluginName;
|
||||
private final ForestryPlugin instance;
|
||||
|
||||
public PluginModule(Class<? extends ForestryPlugin> pluginClass) {
|
||||
Plugin info = pluginClass.getAnnotation(Plugin.class);
|
||||
if (info == null) {
|
||||
String error = "Forestry Plugin missing @Plugin annotation: " + pluginClass.getName();
|
||||
Proxies.log.severe(error);
|
||||
throw new RuntimeException(error);
|
||||
}
|
||||
this.pluginName = info.name();
|
||||
ForestryPlugin plugin;
|
||||
|
||||
try {
|
||||
plugin = pluginClass.newInstance();
|
||||
if (!plugin.isAvailable())
|
||||
plugin = null;
|
||||
} catch (Throwable e) {
|
||||
plugin = null;
|
||||
}
|
||||
|
||||
this.instance = plugin;
|
||||
}
|
||||
|
||||
public ForestryPlugin instance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.pluginName;
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,11 @@ import forestry.core.config.Defaults;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.utils.LiquidHelper;
|
||||
|
||||
@Plugin(pluginID = "Natura",
|
||||
name = "Natura",
|
||||
author = "SirSengir",
|
||||
url = Defaults.URL,
|
||||
description = "Adds support for Natura seeds, saplings, and berries.")
|
||||
public class PluginNatura extends ForestryPlugin {
|
||||
|
||||
private static final String NATURA = "Natura";
|
||||
|
||||
@@ -19,6 +19,8 @@ import forestry.pipes.GuiHandlerPipes;
|
||||
import forestry.pipes.network.PacketHandlerPipes;
|
||||
import forestry.pipes.proxy.ProxyPipes;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
@Plugin(pluginID = "Pipes", name = "Pipes", author = "SirSengir", url = Defaults.URL, description = "Adds the apiarist's pipe for beekeeping if apiculture is enabled and BuildCraft 6 is present.")
|
||||
public class PluginPropolisPipe extends ForestryPlugin {
|
||||
@@ -46,10 +48,11 @@ public class PluginPropolisPipe extends ForestryPlugin {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<PluginManager.Module> getDependancies() {
|
||||
EnumSet<PluginManager.Module> deps = super.getDependancies();
|
||||
deps.add(PluginManager.Module.BUILDCRAFT);
|
||||
return deps;
|
||||
public HashSet<Class<? extends ForestryPlugin>> getDependencies() {
|
||||
HashSet<Class<? extends ForestryPlugin>> dependencies = super.getDependencies();
|
||||
dependencies.add(PluginBuildCraft.class);
|
||||
|
||||
return dependencies;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user