2014-11-29 19:53:40 -08: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;
|
|
|
|
|
|
2014-12-23 01:16:29 -08:00
|
|
|
import net.minecraftforge.fluids.Fluid;
|
|
|
|
|
|
2014-11-29 19:53:40 -08:00
|
|
|
import cpw.mods.fml.common.Optional;
|
2014-12-23 01:16:29 -08:00
|
|
|
|
2014-11-29 19:53:40 -08:00
|
|
|
import forestry.core.GameMode;
|
|
|
|
|
import forestry.core.config.Defaults;
|
2014-12-13 18:58:49 -08:00
|
|
|
import forestry.core.fluids.Fluids;
|
2014-11-29 19:53:40 -08:00
|
|
|
import forestry.core.proxy.Proxies;
|
2014-12-23 01:16:29 -08:00
|
|
|
|
|
|
|
|
import buildcraft.api.fuels.BuildcraftFuelRegistry;
|
2014-11-29 19:53:40 -08:00
|
|
|
|
|
|
|
|
@Plugin(pluginID = "BC6|Fuels", name = "BuildCraft 6 Fuels", author = "mezz", url = Defaults.URL, unlocalizedDescription = "for.plugin.buildcraft6.description")
|
|
|
|
|
public class PluginBuildCraftFuels extends ForestryPlugin {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean isAvailable() {
|
2015-01-15 22:51:29 -08:00
|
|
|
return Proxies.common.isAPILoaded("buildcraft.api.fuels", "[2.0, 3.0)");
|
2014-11-29 19:53:40 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String getFailMessage() {
|
|
|
|
|
return "Compatible BuildCraftAPI|fuels version not found";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Optional.Method(modid = "BuildCraftAPI|fuels")
|
|
|
|
|
@Override
|
|
|
|
|
public void doInit() {
|
2014-12-24 00:43:22 -08:00
|
|
|
BuildcraftFuelRegistry.coolant.addCoolant(Fluids.ICE.getFluid(), 10.0f);
|
2014-11-29 19:53:40 -08:00
|
|
|
|
2014-12-24 00:38:42 -08:00
|
|
|
Fluid ethanol = Fluids.ETHANOL.getFluid();
|
2014-12-23 01:16:29 -08:00
|
|
|
if (ethanol != null) {
|
|
|
|
|
int ethanolPower = 40;
|
|
|
|
|
int ethanolBurnTime = Math.round(Defaults.ENGINE_CYCLE_DURATION_ETHANOL * GameMode.getGameMode().getFloatSetting("fuel.ethanol.combustion"));
|
|
|
|
|
BuildcraftFuelRegistry.fuel.addFuel(ethanol, ethanolPower, ethanolBurnTime);
|
|
|
|
|
}
|
2014-11-29 19:53:40 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|