Merge branch 'master' into universal-wires
This commit is contained in:
commit
29741b999a
8 changed files with 109 additions and 88 deletions
|
@ -37,7 +37,7 @@ public class RenderObsidianTNTPrimed extends Render
|
|||
public void renderObsidianTNT(EntityObsidianTNT entityobsidiantnt, double x, double y, double z, float f, float f1)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)x, (float)y-1.2f, (float)z);
|
||||
GL11.glTranslatef((float)x, (float)y+1.2F, (float)z);
|
||||
GL11.glScalef(0.8F, 0.8F, 0.8F);
|
||||
GL11.glRotatef(180, 1, 0, 0);
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ public class RenderDynamicTank extends TileEntitySpecialRenderer
|
|||
|
||||
if(tileEntity.structure.fluidStored.getFluid().isGaseous())
|
||||
{
|
||||
GL11.glColor4f(1F, 1F, 1F, (float)tileEntity.structure.fluidStored.amount / (float)tileEntity.clientCapacity);
|
||||
GL11.glColor4f(1F, 1F, 1F, Math.min(1, ((float)tileEntity.structure.fluidStored.amount / (float)tileEntity.clientCapacity)+0.3F));
|
||||
GL11.glCallList(displayList[getStages(data.height)-1]);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -166,6 +166,7 @@ public class CommonProxy
|
|||
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.overrideUERatios = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "OverrideUERatios", true).getBoolean(true);
|
||||
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();
|
||||
|
|
|
@ -103,6 +103,7 @@ import net.minecraftforge.oredict.OreDictionary;
|
|||
import rebelkeithy.mods.metallurgy.api.IOreInfo;
|
||||
import rebelkeithy.mods.metallurgy.api.MetallurgyAPI;
|
||||
import thermalexpansion.api.crafting.CraftingManagers;
|
||||
import universalelectricity.compatibility.Compatibility;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
|
@ -233,6 +234,7 @@ public class Mekanism
|
|||
public static boolean dynamicTankEasterEgg = false;
|
||||
public static boolean voiceServerEnabled = true;
|
||||
public static boolean forceBuildcraft = false;
|
||||
public static boolean overrideUERatios = true;
|
||||
public static int obsidianTNTBlastRadius = 12;
|
||||
public static int obsidianTNTDelay = 100;
|
||||
public static int UPDATE_DELAY = 10;
|
||||
|
@ -269,7 +271,7 @@ public class Mekanism
|
|||
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(BasicBlock, 1, 3), new Object[] {
|
||||
"***", "***", "***", Character.valueOf('*'), new ItemStack(Item.coal, 1, 1)
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(Item.coal, 9), new Object[] {
|
||||
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(Item.coal, 1, 9), new Object[] {
|
||||
"*", Character.valueOf('*'), new ItemStack(BasicBlock, 1, 3)
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(BasicBlock, 1, 2), new Object[] {
|
||||
|
@ -627,6 +629,8 @@ public class Mekanism
|
|||
OreDictionary.registerOre("ingotBronze", new ItemStack(Ingot, 1, 2));
|
||||
OreDictionary.registerOre("ingotRefinedGlowstone", new ItemStack(Ingot, 1, 3));
|
||||
OreDictionary.registerOre("ingotSteel", new ItemStack(Ingot, 1, 4));
|
||||
OreDictionary.registerOre("ingotCopper", new ItemStack(Ingot, 1, 5));
|
||||
OreDictionary.registerOre("ingotTin", new ItemStack(Ingot, 1, 6));
|
||||
|
||||
OreDictionary.registerOre("blockOsmium", new ItemStack(BasicBlock, 1, 0));
|
||||
OreDictionary.registerOre("blockBronze", new ItemStack(BasicBlock, 1, 1));
|
||||
|
@ -655,6 +659,8 @@ public class Mekanism
|
|||
OreDictionary.registerOre("clumpObsidian", new ItemStack(Clump, 1, 6));
|
||||
|
||||
OreDictionary.registerOre("oreOsmium", new ItemStack(OreBlock, 1, 0));
|
||||
OreDictionary.registerOre("oreCopper", new ItemStack(OreBlock, 1, 1));
|
||||
OreDictionary.registerOre("oreTin", new ItemStack(OreBlock, 1, 2));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1178,6 +1184,16 @@ public class Mekanism
|
|||
|
||||
addIntegratedItems();
|
||||
|
||||
if(overrideUERatios)
|
||||
{
|
||||
Compatibility.BC3_RATIO = (float)FROM_BC;
|
||||
Compatibility.TO_BC_RATIO = (float)TO_BC;
|
||||
Compatibility.IC2_RATIO = (float)FROM_IC2;
|
||||
Compatibility.TO_IC2_RATIO = (float)TO_IC2;
|
||||
Compatibility.TE_RATIO = (float)FROM_TE;
|
||||
Compatibility.TO_TE_RATIO = (float)TO_TE;
|
||||
}
|
||||
|
||||
System.out.println("[Mekanism] Hooking complete.");
|
||||
}
|
||||
|
||||
|
|
|
@ -48,6 +48,20 @@ public class ItemBlockOre extends ItemBlock
|
|||
list.add("It is known to have many uses in");
|
||||
list.add("the construction of machinery.");
|
||||
}
|
||||
else if(itemstack.getItemDamage() == 1)
|
||||
{
|
||||
list.add("A common, conductive material that");
|
||||
list.add("can be used in the production of.");
|
||||
list.add("wires. It's ability to withstand");
|
||||
list.add("high heats also makes it essential");
|
||||
list.add("to advanced machinery.");
|
||||
}
|
||||
else if(itemstack.getItemDamage() == 2)
|
||||
{
|
||||
list.add("A lightweight, yet sturdy, conductive");
|
||||
list.add("material that is found slighly less");
|
||||
list.add("commonly than Copper.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,8 +23,9 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.ChatMessageComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
|
||||
public class ItemConfigurator extends ItemEnergized
|
||||
public class ItemConfigurator extends ItemEnergized implements IToolWrench
|
||||
{
|
||||
public final int ENERGY_PER_CONFIGURE = 400;
|
||||
public final int ENERGY_PER_ITEM_DUMP = 8;
|
||||
|
@ -302,4 +303,13 @@ public class ItemConfigurator extends ItemEnergized
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canWrench(EntityPlayer player, int x, int y, int z)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wrenchUsed(EntityPlayer player, int x, int y, int z) {}
|
||||
}
|
||||
|
|
|
@ -109,8 +109,10 @@ public abstract class TileEntityUniversalConductor extends TileEntityConductor i
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity()
|
||||
public void validate()
|
||||
{
|
||||
super.validate();
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
if (!this.isAddedToEnergyNet)
|
||||
|
@ -136,15 +138,11 @@ public abstract class TileEntityUniversalConductor extends TileEntityConductor i
|
|||
|
||||
protected void initIC()
|
||||
{
|
||||
if (Compatibility.isIndustrialCraft2Loaded())
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
|
||||
}
|
||||
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
|
||||
this.isAddedToEnergyNet = true;
|
||||
}
|
||||
|
||||
private void unloadTileIC2()
|
||||
protected void unloadTileIC2()
|
||||
{
|
||||
if (this.isAddedToEnergyNet && this.worldObj != null)
|
||||
{
|
||||
|
@ -172,7 +170,7 @@ public abstract class TileEntityUniversalConductor extends TileEntityConductor i
|
|||
public double injectEnergyUnits(ForgeDirection directionFrom, double amount)
|
||||
{
|
||||
TileEntity tile = VectorHelper.getTileEntityFromSide(this.worldObj, new Vector3(this), directionFrom);
|
||||
ElectricityPack pack = ElectricityPack.getFromWatts((float) (amount * Compatibility.IC2_RATIO), 120);
|
||||
ElectricityPack pack = ElectricityPack.getFromWatts((float) (amount * Compatibility.IC2_RATIO), 1);
|
||||
return this.getNetwork().produce(pack, this, tile) * Compatibility.TO_IC2_RATIO;
|
||||
}
|
||||
|
||||
|
@ -209,7 +207,7 @@ public abstract class TileEntityUniversalConductor extends TileEntityConductor i
|
|||
ignoreTiles.add(tile);
|
||||
}
|
||||
|
||||
ElectricityPack pack = ElectricityPack.getFromWatts(workProvider.useEnergy(0, this.getNetwork().getRequest(this).getWatts() * Compatibility.TO_BC_RATIO, true) * Compatibility.BC3_RATIO, 120);
|
||||
ElectricityPack pack = ElectricityPack.getFromWatts(workProvider.useEnergy(0, this.getNetwork().getRequest(this).getWatts() * Compatibility.TO_BC_RATIO, true) * Compatibility.BC3_RATIO, 1);
|
||||
this.getNetwork().produce(pack, ignoreTiles.toArray(new TileEntity[0]));
|
||||
}
|
||||
|
||||
|
@ -233,7 +231,8 @@ public abstract class TileEntityUniversalConductor extends TileEntityConductor i
|
|||
{
|
||||
if (request > 0)
|
||||
{
|
||||
return (int) (maxReceive - (this.getNetwork().produce(pack, new Vector3(this).modifyPositionFromSide(from).getTileEntity(this.worldObj)) * Compatibility.TO_TE_RATIO));
|
||||
float reject = this.getNetwork().produce(pack, new Vector3(this).modifyPositionFromSide(from).getTileEntity(this.worldObj));
|
||||
return (int) (maxReceive - (reject * Compatibility.TO_TE_RATIO));
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -90,7 +90,7 @@ public class UniversalNetwork extends ElectricityNetwork
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (Compatibility.isIndustrialCraft2Loaded() && tileEntity instanceof IEnergySink)
|
||||
else if (tileEntity instanceof IEnergySink)
|
||||
{
|
||||
IEnergySink electricalTile = (IEnergySink) tileEntity;
|
||||
|
||||
|
@ -109,7 +109,7 @@ public class UniversalNetwork extends ElectricityNetwork
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (Compatibility.isBuildcraftLoaded() && tileEntity instanceof IPowerReceptor)
|
||||
else if (tileEntity instanceof IPowerReceptor)
|
||||
{
|
||||
IPowerReceptor electricalTile = (IPowerReceptor) tileEntity;
|
||||
|
||||
|
@ -132,7 +132,7 @@ public class UniversalNetwork extends ElectricityNetwork
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (Compatibility.isThermalExpansionLoaded() && tileEntity instanceof IEnergyHandler)
|
||||
else if (tileEntity instanceof IEnergyHandler)
|
||||
{
|
||||
IEnergyHandler receiver = (IEnergyHandler) tileEntity;
|
||||
|
||||
|
@ -205,7 +205,30 @@ public class UniversalNetwork extends ElectricityNetwork
|
|||
continue;
|
||||
}
|
||||
|
||||
if (Compatibility.isIndustrialCraft2Loaded() && tileEntity instanceof IEnergySink)
|
||||
if (tileEntity instanceof IEnergyHandler)
|
||||
{
|
||||
IEnergyHandler receiver = (IEnergyHandler) tileEntity;
|
||||
|
||||
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
TileEntity conductor = VectorHelper.getConnectorFromSide(tileEntity.worldObj, new Vector3(tileEntity), direction);
|
||||
|
||||
if (receiver.canInterface(direction) && this.getConductors().contains(conductor))
|
||||
{
|
||||
ElectricityPack pack = ElectricityPack.getFromWatts(receiver.receiveEnergy(direction, (int) Integer.MAX_VALUE, true) * Compatibility.TE_RATIO, 1);
|
||||
|
||||
if (pack.getWatts() > 0)
|
||||
{
|
||||
requests.add(pack);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tileEntity instanceof IEnergySink)
|
||||
{
|
||||
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
|
@ -223,7 +246,7 @@ public class UniversalNetwork extends ElectricityNetwork
|
|||
continue;
|
||||
}
|
||||
|
||||
if (Compatibility.isBuildcraftLoaded() && tileEntity instanceof IPowerReceptor)
|
||||
if (tileEntity instanceof IPowerReceptor)
|
||||
{
|
||||
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
|
@ -241,29 +264,6 @@ public class UniversalNetwork extends ElectricityNetwork
|
|||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Compatibility.isThermalExpansionLoaded() && tileEntity instanceof IEnergyHandler)
|
||||
{
|
||||
IEnergyHandler receiver = (IEnergyHandler) tileEntity;
|
||||
|
||||
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
TileEntity conductor = VectorHelper.getConnectorFromSide(tileEntity.worldObj, new Vector3(tileEntity), direction);
|
||||
|
||||
if (receiver.canInterface(direction))
|
||||
{
|
||||
ElectricityPack pack = ElectricityPack.getFromWatts(receiver.receiveEnergy(direction, (int) Integer.MAX_VALUE, true) * Compatibility.TE_RATIO, 1);
|
||||
|
||||
if (pack.getWatts() > 0)
|
||||
{
|
||||
requests.add(pack);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -290,10 +290,17 @@ public class UniversalNetwork extends ElectricityNetwork
|
|||
if (conductor == null)
|
||||
{
|
||||
it.remove();
|
||||
continue;
|
||||
}
|
||||
else if (((TileEntity) conductor).isInvalid())
|
||||
else if (((TileEntity) conductor).isInvalid() || ((TileEntity) conductor).getWorldObj() == null)
|
||||
{
|
||||
it.remove();
|
||||
continue;
|
||||
}
|
||||
else if (((TileEntity) conductor).getWorldObj().getBlockTileEntity(((TileEntity) conductor).xCoord, ((TileEntity) conductor).yCoord, ((TileEntity) conductor).zCoord) != conductor)
|
||||
{
|
||||
it.remove();
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -303,10 +310,12 @@ public class UniversalNetwork extends ElectricityNetwork
|
|||
for (int i = 0; i < conductor.getAdjacentConnections().length; i++)
|
||||
{
|
||||
TileEntity acceptor = conductor.getAdjacentConnections()[i];
|
||||
// The direction is from the perspective of the conductor.
|
||||
ForgeDirection direction = ForgeDirection.getOrientation(i);
|
||||
|
||||
if (!(acceptor instanceof IConductor))
|
||||
{
|
||||
if (acceptor instanceof IElectrical)
|
||||
if (acceptor instanceof IElectrical || acceptor instanceof IEnergyHandler || acceptor instanceof IEnergyAcceptor || acceptor instanceof IPowerReceptor)
|
||||
{
|
||||
ArrayList<ForgeDirection> possibleDirections = null;
|
||||
|
||||
|
@ -319,56 +328,28 @@ public class UniversalNetwork extends ElectricityNetwork
|
|||
possibleDirections = new ArrayList<ForgeDirection>();
|
||||
}
|
||||
|
||||
if (((IElectrical) acceptor).canConnect(ForgeDirection.getOrientation(i)) && this.getConductors().contains(VectorHelper.getConnectorFromSide(acceptor.worldObj, new Vector3(acceptor), ForgeDirection.getOrientation(i))))
|
||||
if (acceptor instanceof IElectrical && ((IElectrical) acceptor).canConnect(direction))
|
||||
{
|
||||
possibleDirections.add(ForgeDirection.getOrientation(i));
|
||||
possibleDirections.add(direction);
|
||||
}
|
||||
else if (acceptor instanceof IEnergyHandler && ((IEnergyHandler) acceptor).canInterface(direction))
|
||||
{
|
||||
possibleDirections.add(direction);
|
||||
}
|
||||
else if (acceptor instanceof IEnergyAcceptor && ((IEnergyAcceptor) acceptor).acceptsEnergyFrom((TileEntity) conductor, direction))
|
||||
{
|
||||
possibleDirections.add(direction);
|
||||
}
|
||||
else if (acceptor instanceof IPowerReceptor && ((IPowerReceptor) acceptor).getPowerReceiver(direction) != null)
|
||||
{
|
||||
possibleDirections.add(direction);
|
||||
}
|
||||
|
||||
this.electricalTiles.put(acceptor, possibleDirections);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Compatibility.isIndustrialCraft2Loaded() && acceptor instanceof IEnergyAcceptor)
|
||||
{
|
||||
ArrayList<ForgeDirection> possibleDirections = null;
|
||||
|
||||
if (this.electricalTiles.containsKey(acceptor))
|
||||
if (!possibleDirections.isEmpty())
|
||||
{
|
||||
possibleDirections = this.electricalTiles.get(acceptor);
|
||||
}
|
||||
else
|
||||
{
|
||||
possibleDirections = new ArrayList<ForgeDirection>();
|
||||
this.electricalTiles.put(acceptor, possibleDirections);
|
||||
}
|
||||
|
||||
if (((IEnergyAcceptor) acceptor).acceptsEnergyFrom(VectorHelper.getTileEntityFromSide(acceptor.worldObj, new Vector3(acceptor), ForgeDirection.getOrientation(i)), ForgeDirection.getOrientation(i)) && this.getConductors().contains(VectorHelper.getConnectorFromSide(acceptor.worldObj, new Vector3(acceptor), ForgeDirection.getOrientation(i))))
|
||||
{
|
||||
possibleDirections.add(ForgeDirection.getOrientation(i));
|
||||
}
|
||||
|
||||
this.electricalTiles.put(acceptor, possibleDirections);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Compatibility.isBuildcraftLoaded() && acceptor instanceof IPowerReceptor)
|
||||
{
|
||||
ArrayList<ForgeDirection> possibleDirections = null;
|
||||
|
||||
if (this.electricalTiles.containsKey(acceptor))
|
||||
{
|
||||
possibleDirections = this.electricalTiles.get(acceptor);
|
||||
}
|
||||
else
|
||||
{
|
||||
possibleDirections = new ArrayList<ForgeDirection>();
|
||||
}
|
||||
|
||||
if (this.getConductors().contains(VectorHelper.getConnectorFromSide(acceptor.worldObj, new Vector3(acceptor), ForgeDirection.getOrientation(i))))
|
||||
{
|
||||
possibleDirections.add(ForgeDirection.getOrientation(i));
|
||||
}
|
||||
|
||||
this.electricalTiles.put(acceptor, possibleDirections);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue