2015-01-30 07:07:52 -06:00
|
|
|
/*******************************************************************************
|
|
|
|
|
* 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 java.util.ArrayList;
|
|
|
|
|
|
|
|
|
|
import net.minecraft.block.Block;
|
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
|
|
|
|
|
import cpw.mods.fml.common.registry.GameRegistry;
|
|
|
|
|
|
2015-04-18 14:06:13 -07:00
|
|
|
import forestry.api.circuits.ChipsetManager;
|
|
|
|
|
import forestry.api.circuits.ICircuitLayout;
|
2015-01-30 07:07:52 -06:00
|
|
|
import forestry.api.farming.Farmables;
|
|
|
|
|
import forestry.api.farming.IFarmable;
|
|
|
|
|
import forestry.core.circuits.Circuit;
|
|
|
|
|
import forestry.core.config.Config;
|
2015-09-25 15:06:43 -07:00
|
|
|
import forestry.core.config.Constants;
|
2015-04-18 14:06:13 -07:00
|
|
|
import forestry.core.config.ForestryItem;
|
2015-10-17 12:25:13 -07:00
|
|
|
import forestry.core.utils.ModUtil;
|
2015-01-30 07:07:52 -06:00
|
|
|
import forestry.farming.circuits.CircuitFarmLogic;
|
|
|
|
|
import forestry.farming.logic.FarmLogicEnder;
|
|
|
|
|
import forestry.farming.logic.FarmableGenericCrop;
|
|
|
|
|
|
2015-09-25 15:06:43 -07:00
|
|
|
@Plugin(pluginID = "ExtraUtilities", name = "ExtraUtilities", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.plugin.extrautilities.description")
|
2015-01-30 07:07:52 -06:00
|
|
|
public class PluginExtraUtilities extends ForestryPlugin {
|
|
|
|
|
|
|
|
|
|
private static final String ExU = "ExtraUtilities";
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean isAvailable() {
|
2015-10-17 12:25:13 -07:00
|
|
|
return ModUtil.isModLoaded(ExU);
|
2015-01-30 07:07:52 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String getFailMessage() {
|
|
|
|
|
return "ExtraUtilities not found";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void doInit() {
|
|
|
|
|
super.doInit();
|
|
|
|
|
|
2015-08-02 01:15:41 -07:00
|
|
|
Block exUEnderLilly = GameRegistry.findBlock(ExU, "plant/ender_lilly");
|
2015-01-30 07:07:52 -06:00
|
|
|
Farmables.farmables.put("farmEnder", new ArrayList<IFarmable>());
|
|
|
|
|
if (Config.isExUtilEnderLilyEnabled()) {
|
|
|
|
|
Circuit.farmEnderManaged = new CircuitFarmLogic("managedEnder", FarmLogicEnder.class);
|
2015-08-02 01:15:41 -07:00
|
|
|
Farmables.farmables.get("farmEnder").add(new FarmableGenericCrop(new ItemStack(exUEnderLilly, 1, 0), exUEnderLilly, 7));
|
2015-01-30 07:07:52 -06:00
|
|
|
}
|
|
|
|
|
}
|
2015-04-18 14:06:13 -07:00
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void registerRecipes() {
|
|
|
|
|
super.registerRecipes();
|
|
|
|
|
|
|
|
|
|
if (PluginManager.Module.FARMING.isEnabled() && Config.isExUtilEnderLilyEnabled()) {
|
|
|
|
|
ICircuitLayout layoutManaged = ChipsetManager.circuitRegistry.getLayout("forestry.farms.managed");
|
|
|
|
|
ChipsetManager.solderManager.addRecipe(layoutManaged, ForestryItem.tubes.getItemStack(1, 12), Circuit.farmEnderManaged);
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-01-30 07:07:52 -06:00
|
|
|
}
|