2014-05-02 21:31:20 +02:00
|
|
|
/*******************************************************************************
|
|
|
|
|
* Copyright 2011-2014 by SirSengir
|
|
|
|
|
*
|
|
|
|
|
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
|
|
|
|
|
*
|
|
|
|
|
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/3.0/.
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
package forestry.plugins;
|
|
|
|
|
|
|
|
|
|
import cpw.mods.fml.common.FMLCommonHandler;
|
|
|
|
|
import cpw.mods.fml.common.network.IGuiHandler;
|
|
|
|
|
import forestry.core.config.Defaults;
|
|
|
|
|
import forestry.core.config.ForestryItem;
|
|
|
|
|
import forestry.core.interfaces.IPacketHandler;
|
|
|
|
|
import forestry.core.proxy.Proxies;
|
|
|
|
|
import forestry.pipes.GuiHandlerPipes;
|
|
|
|
|
import forestry.pipes.network.PacketHandlerPipes;
|
|
|
|
|
import forestry.pipes.proxy.ProxyPipes;
|
2014-11-29 19:53:40 -08:00
|
|
|
import net.minecraft.item.Item;
|
|
|
|
|
|
2014-09-20 22:43:13 -07:00
|
|
|
import java.util.EnumSet;
|
2014-05-02 21:31:20 +02:00
|
|
|
|
2014-09-27 12:46:54 -07:00
|
|
|
@Plugin(pluginID = "Pipes", name = "Pipes", author = "SirSengir", url = Defaults.URL, unlocalizedDescription = "for.plugin.pipes.description")
|
2014-09-20 22:43:13 -07:00
|
|
|
public class PluginPropolisPipe extends ForestryPlugin {
|
2014-05-02 21:31:20 +02:00
|
|
|
|
|
|
|
|
public static ProxyPipes proxy;
|
|
|
|
|
/**
|
|
|
|
|
* Pipe used to sort bees from Forestry.
|
|
|
|
|
*/
|
|
|
|
|
public static Item pipeItemsPropolis;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean isAvailable() {
|
2014-11-29 19:53:40 -08:00
|
|
|
return Proxies.common.isModLoaded("BuildCraft|Transport");
|
2014-05-02 21:31:20 +02:00
|
|
|
}
|
|
|
|
|
|
2014-09-20 22:43:13 -07:00
|
|
|
@Override
|
|
|
|
|
public String getFailMessage() {
|
2014-11-29 19:53:40 -08:00
|
|
|
return "BuildCraft|Transport not found";
|
2014-09-20 22:43:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2014-09-22 23:20:58 -07:00
|
|
|
public EnumSet<PluginManager.Module> getDependancies() {
|
|
|
|
|
EnumSet<PluginManager.Module> deps = super.getDependancies();
|
2014-10-01 22:28:21 -07:00
|
|
|
deps.add(PluginManager.Module.APICULTURE);
|
2014-09-22 23:20:58 -07:00
|
|
|
return deps;
|
2014-09-20 22:43:13 -07:00
|
|
|
}
|
|
|
|
|
|
2014-05-02 21:31:20 +02:00
|
|
|
@Override
|
|
|
|
|
public void postInit() {
|
2014-09-20 22:43:13 -07:00
|
|
|
String proxyClass = "forestry.pipes.proxy.ProxyPipes";
|
|
|
|
|
if (FMLCommonHandler.instance().getSide().isClient())
|
|
|
|
|
proxyClass = "forestry.pipes.proxy.ClientProxyPipes";
|
2014-05-02 21:31:20 +02:00
|
|
|
|
2014-11-29 19:53:40 -08:00
|
|
|
proxy = (ProxyPipes) Proxies.common.instantiateIfModLoaded("BuildCraft|Transport", proxyClass);
|
2014-05-02 21:31:20 +02:00
|
|
|
|
2014-09-20 22:43:13 -07:00
|
|
|
if (proxy == null)
|
|
|
|
|
return;
|
2014-05-02 21:31:20 +02:00
|
|
|
|
|
|
|
|
proxy.initPropolisPipe();
|
|
|
|
|
proxy.registerCraftingPropolis(ForestryItem.propolis.getItemStack());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public IGuiHandler getGuiHandler() {
|
|
|
|
|
return new GuiHandlerPipes();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public IPacketHandler getPacketHandler() {
|
|
|
|
|
return new PacketHandlerPipes();
|
|
|
|
|
}
|
2014-09-20 22:43:13 -07:00
|
|
|
|
2014-05-02 21:31:20 +02:00
|
|
|
}
|