This commit is contained in:
Aidan Brady 2013-11-03 11:38:39 -05:00
commit 2ecc48021d
5 changed files with 15 additions and 6 deletions

View file

@ -151,6 +151,7 @@ public class CommonProxy
Mekanism.logPackets = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "LogPackets", false).getBoolean(true);
Mekanism.dynamicTankEasterEgg = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "DynamicTankEasterEgg", false).getBoolean(true);
Mekanism.voiceServerEnabled = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "VoiceServerEnabled", true).getBoolean(true);
Mekanism.forceBuildcraft = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ForceBuildcraftPower", false).getBoolean(false);
Mekanism.obsidianTNTDelay = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ObsidianTNTDelay", 100).getInt();
Mekanism.obsidianTNTBlastRadius = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ObsidianTNTBlastRadius", 12).getInt();
Mekanism.UPDATE_DELAY = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ClientUpdateDelay", 10).getInt();

View file

@ -16,6 +16,7 @@ import mekanism.api.transmitters.DynamicNetwork;
import mekanism.api.transmitters.ITransmitter;
import mekanism.api.transmitters.TransmissionType;
import mekanism.common.util.CableUtils;
import mekanism.common.util.MekanismUtils;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.MinecraftForge;
@ -77,7 +78,7 @@ public class EnergyNetwork extends DynamicNetwork<TileEntity, EnergyNetwork>
{
totalNeeded += Math.min((((IEnergySink)acceptor).demandedEnergyUnits()*Mekanism.FROM_IC2), (((IEnergySink)acceptor).getMaxSafeInput()*Mekanism.FROM_IC2));
}
else if(acceptor instanceof IPowerReceptor && Mekanism.hooks.BuildCraftLoaded)
else if(acceptor instanceof IPowerReceptor && MekanismUtils.useBuildcraft())
{
totalNeeded += (((IPowerReceptor)acceptor).getPowerReceiver(acceptorDirections.get(acceptor).getOpposite()).powerRequest()*Mekanism.FROM_BC);
}
@ -124,7 +125,7 @@ public class EnergyNetwork extends DynamicNetwork<TileEntity, EnergyNetwork>
double toSend = Math.min(currentSending, (((IEnergySink)acceptor).getMaxSafeInput()*Mekanism.FROM_IC2));
energyToSend -= (toSend - (((IEnergySink)acceptor).injectEnergyUnits(acceptorDirections.get(acceptor).getOpposite(), toSend*Mekanism.TO_IC2)*Mekanism.FROM_IC2));
}
else if(acceptor instanceof IPowerReceptor && Mekanism.hooks.BuildCraftLoaded)
else if(acceptor instanceof IPowerReceptor && MekanismUtils.useBuildcraft())
{
PowerReceiver receiver = ((IPowerReceptor)acceptor).getPowerReceiver(acceptorDirections.get(acceptor).getOpposite());
double electricityNeeded = Math.min(receiver.powerRequest(), receiver.getMaxEnergyStored() - receiver.getEnergyStored())*Mekanism.FROM_BC;
@ -175,7 +176,7 @@ public class EnergyNetwork extends DynamicNetwork<TileEntity, EnergyNetwork>
}
}
}
else if(acceptor instanceof IPowerReceptor && Mekanism.hooks.BuildCraftLoaded)
else if(acceptor instanceof IPowerReceptor && MekanismUtils.useBuildcraft())
{
if(((IPowerReceptor)acceptor).getPowerReceiver(acceptorDirections.get(acceptor).getOpposite()) != null)
{

View file

@ -217,6 +217,7 @@ public class Mekanism
public static boolean logPackets = false;
public static boolean dynamicTankEasterEgg = false;
public static boolean voiceServerEnabled = true;
public static boolean forceBuildcraft = false;
public static int obsidianTNTBlastRadius = 12;
public static int obsidianTNTDelay = 100;
public static int UPDATE_DELAY = 10;

View file

@ -45,7 +45,7 @@ public final class CableUtils
if(acceptor instanceof IStrictEnergyAcceptor ||
acceptor instanceof IEnergySink ||
(acceptor instanceof IPowerReceptor && !(acceptor instanceof ITransmitter) && Mekanism.hooks.BuildCraftLoaded) ||
(acceptor instanceof IPowerReceptor && !(acceptor instanceof ITransmitter) && MekanismUtils.useBuildcraft()) ||
acceptor instanceof IElectrical)
{
acceptors[orientation.ordinal()] = acceptor;
@ -177,7 +177,7 @@ public final class CableUtils
return true;
}
if(tileEntity instanceof IPowerReceptor && !(tileEntity instanceof ITransmitter) && Mekanism.hooks.BuildCraftLoaded)
if(tileEntity instanceof IPowerReceptor && !(tileEntity instanceof ITransmitter) && MekanismUtils.useBuildcraft())
{
if(!(tileEntity instanceof IEnergyAcceptor) || ((IEnergyAcceptor)tileEntity).acceptsEnergyFrom(null, side.getOpposite()))
{
@ -281,7 +281,7 @@ public final class CableUtils
double toSend = Math.min(emitter.getEnergy(), emitter.getMaxOutput());
emitter.setEnergy(emitter.getEnergy() - (toSend - acceptor.transferEnergyToAcceptor(toSend)));
}
else if(tileEntity instanceof IPowerReceptor && Mekanism.hooks.BuildCraftLoaded)
else if(tileEntity instanceof IPowerReceptor && MekanismUtils.useBuildcraft())
{
PowerReceiver receiver = ((IPowerReceptor)tileEntity).getPowerReceiver(emitter.getOutputtingSide().getOpposite());

View file

@ -23,6 +23,7 @@ import mekanism.common.IModule;
import mekanism.common.IRedstoneControl;
import mekanism.common.IRedstoneControl.RedstoneControl;
import mekanism.common.Mekanism;
import mekanism.common.MekanismHooks;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.Teleporter;
@ -1005,6 +1006,11 @@ public final class MekanismUtils
return false;
}
public static boolean useBuildcraft()
{
return Mekanism.hooks.BuildCraftLoaded || Mekanism.forceBuildcraft;
}
public static enum ResourceType
{
GUI("gui"),