Merge branch 'development' into 1.8

Conflicts:
	src/main/java/mekanism/common/CommonProxy.java
	src/main/java/mekanism/common/Mekanism.java
This commit is contained in:
Aidan C. Brady 2014-10-02 12:47:22 -04:00
commit ed8823b038
10 changed files with 32 additions and 16 deletions

View file

@ -37,6 +37,9 @@ public class MekanismConfig
public static int laserRange;
public static double laserEnergyNeededPerHardness;
public static double minerSilkMultiplier = 6;
public static boolean blacklistBC;
public static boolean blacklistIC2;
public static boolean blacklistRF;
}
public static class client

View file

@ -226,7 +226,7 @@ public class GasTank
stored = GasStack.readFromNBT(nbtTags.getCompoundTag("stored"));
}
if(nbtTags.hasKey("maxGas"))
if(nbtTags.hasKey("maxGas") && nbtTags.getInteger("maxGas") != 0)
{
maxGas = nbtTags.getInteger("maxGas");
}

View file

@ -22,7 +22,7 @@ public class ItemInfo
@Override
public boolean equals(Object obj)
{
return obj instanceof BlockInfo &&
return obj instanceof ItemInfo &&
((ItemInfo)obj).item == item &&
((ItemInfo)obj).meta == meta;
}
@ -31,8 +31,8 @@ public class ItemInfo
public int hashCode()
{
int code = 1;
code = 31 * code + item.getUnlocalizedName().hashCode();
code = 31 * code + meta;
code = 31 * code + System.identityHashCode(item);
code = 7 * code + meta;
return code;
}
}

View file

@ -89,7 +89,6 @@ import mekanism.common.tile.TileEntityRotaryCondensentrator;
import mekanism.common.tile.TileEntitySalinationController;
import mekanism.common.tile.TileEntitySeismicVibrator;
import mekanism.common.tile.TileEntityTeleporter;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
@ -217,6 +216,10 @@ public class CommonProxy
general.maxUpgradeMultiplier = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "UpgradeModifier", 10, null, 1, Integer.MAX_VALUE).getInt();
general.minerSilkMultiplier = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "MinerSilkMultiplier", 6).getDouble();
general.blacklistBC = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "BlacklistBuildCraftPower", false).getBoolean();
general.blacklistIC2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "BlacklistIC2Power", false).getBoolean();
general.blacklistRF = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "BlacklistRFPower", false).getBoolean();
String s = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EnergyType", "J", null, new String[]{"J", "RF", "MJ", "EU"}).getString();
if(s != null)

View file

@ -25,10 +25,11 @@ public final class OreDictCache
}
ItemInfo info = ItemInfo.get(check);
List<String> cached = cachedKeys.get(info);
if(cachedKeys.get(info) != null)
if(cached != null)
{
return cachedKeys.get(info);
return cached;
}
int[] idsFound = OreDictionary.getOreIDs(check);

View file

@ -5,7 +5,6 @@ import java.util.List;
import mekanism.api.EnumColor;
import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.player.EntityPlayer;
@ -21,6 +20,7 @@ public class ItemElectricBow extends ItemEnergized
public ItemElectricBow()
{
super(120000);
setFull3D();
}
@Override

View file

@ -49,6 +49,9 @@ public class PacketConfigSync implements IMessageHandler<ConfigSyncMessage, IMes
dataStream.writeInt(general.maxUpgradeMultiplier);
dataStream.writeInt(general.activeType.ordinal());
dataStream.writeDouble(general.minerSilkMultiplier);
dataStream.writeBoolean(general.blacklistBC);
dataStream.writeBoolean(general.blacklistIC2);
dataStream.writeBoolean(general.blacklistRF);
dataStream.writeDouble(usage.enrichmentChamberUsage);
dataStream.writeDouble(usage.osmiumCompressorUsage);
@ -106,6 +109,9 @@ public class PacketConfigSync implements IMessageHandler<ConfigSyncMessage, IMes
general.maxUpgradeMultiplier = dataStream.readInt();
general.activeType = EnergyType.values()[dataStream.readInt()];
general.minerSilkMultiplier = dataStream.readDouble();
general.blacklistBC = dataStream.readBoolean();
general.blacklistIC2 = dataStream.readBoolean();
general.blacklistRF = dataStream.readBoolean();
general.TO_TE = general.TO_BC*10;
general.FROM_TE = general.FROM_BC/10;

View file

@ -118,7 +118,7 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
}
}
if(!worldObj.isRemote && worldObj.getWorldTime() % 20 == 0)
if(!worldObj.isRemote && ticker % 20 == 0)
{
if(getEnergy() >= usage.electricPumpUsage && (fluidTank.getFluid() == null || fluidTank.getFluid().amount+FluidContainerRegistry.BUCKET_VOLUME <= fluidTank.getCapacity()))
{

View file

@ -37,7 +37,6 @@ import mekanism.common.base.IFactory.RecipeType;
import mekanism.common.base.IInvConfiguration;
import mekanism.common.base.IModule;
import mekanism.common.base.IRedstoneControl;
import mekanism.common.base.IRedstoneControl.RedstoneControl;
import mekanism.common.base.IUpgradeTile;
import mekanism.common.inventory.container.ContainerElectricChest;
import mekanism.common.item.ItemBlockEnergyCube;
@ -47,7 +46,6 @@ import mekanism.common.network.PacketElectricChest.ElectricChestPacketType;
import mekanism.common.tile.TileEntityAdvancedBoundingBlock;
import mekanism.common.tile.TileEntityBoundingBlock;
import mekanism.common.tile.TileEntityElectricChest;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
@ -75,12 +73,11 @@ import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidBlock;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import buildcraft.api.tools.IToolWrench;
import cpw.mods.fml.common.ModAPIManager;
import cpw.mods.fml.common.ModContainer;
import cpw.mods.fml.common.registry.GameData;
import buildcraft.api.tools.IToolWrench;
/**
* Utilities used by Mekanism. All miscellaneous methods are located here.
* @author AidanBrady
@ -1124,7 +1121,7 @@ public final class MekanismUtils
*/
public static boolean useBuildCraft()
{
return Mekanism.hooks.BuildCraftPowerLoaded;
return Mekanism.hooks.BuildCraftPowerLoaded && !general.blacklistBC;
}
/**
@ -1134,7 +1131,7 @@ public final class MekanismUtils
*/
public static boolean useIC2()
{
return Mekanism.hooks.IC2Loaded;
return Mekanism.hooks.IC2Loaded && !general.blacklistIC2;
}
/**
@ -1144,7 +1141,7 @@ public final class MekanismUtils
*/
public static boolean useRF()
{
return Mekanism.hooks.RedstoneFluxLoaded;
return Mekanism.hooks.RedstoneFluxLoaded && !general.blacklistRF;
}
/**

View file

@ -8,6 +8,7 @@ import mekanism.api.transmitters.TransmissionType;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
@ -75,6 +76,11 @@ public final class PipeUtils
connectable[side] = true;
}
}
else if(container.canDrain(ForgeDirection.getOrientation(side).getOpposite(), FluidRegistry.WATER)
|| container.canFill(ForgeDirection.getOrientation(side).getOpposite(), FluidRegistry.WATER)) //I hesitate to pass null to these.
{
connectable[side] = true;
}
}
}