diff options
Diffstat (limited to 'src')
13 files changed, 85 insertions, 87 deletions
diff --git a/src/main/java/gregtech/api/graphs/GenerateNodeMap.java b/src/main/java/gregtech/api/graphs/GenerateNodeMap.java index 60a820cdd1..98c8215fc7 100644 --- a/src/main/java/gregtech/api/graphs/GenerateNodeMap.java +++ b/src/main/java/gregtech/api/graphs/GenerateNodeMap.java @@ -13,7 +13,7 @@ import static gregtech.api.util.GT_Utility.getOppositeSide; //generates the node map abstract public class GenerateNodeMap { - //clearign the node map to make sure it is gone on reset + //clearing the node map to make sure it is gone on reset public static void clearNodeMap(Node aNode,int aReturnNodeValue) { if (aNode.mTileEntity instanceof BaseMetaPipeEntity) { BaseMetaPipeEntity tPipe = (BaseMetaPipeEntity) aNode.mTileEntity; @@ -25,21 +25,21 @@ abstract public class GenerateNodeMap { } } for (int i = 0;i<6;i++) { - NodePath tPath = aNode.mNodePats[i]; + NodePath tPath = aNode.mNodePaths[i]; if (tPath != null) { tPath.clearPath(); - aNode.mNodePats[i] = null; + aNode.mNodePaths[i] = null; } - Node tNextNode = aNode.mNeigbourNodes[i]; + Node tNextNode = aNode.mNeighbourNodes[i]; if (tNextNode == null) continue; if (tNextNode.mNodeValue != aReturnNodeValue) clearNodeMap(tNextNode,aNode.mNodeValue); - aNode.mNeigbourNodes[i] = null; + aNode.mNeighbourNodes[i] = null; } } //gets the next node - protected void generateNextNode(BaseMetaPipeEntity aPipe, Node aPipeNode, byte aInvalidSide, int aNextNodeVale, + protected void generateNextNode(BaseMetaPipeEntity aPipe, Node aPipeNode, byte aInvalidSide, int aNextNodeValue, ArrayList<ConsumerNode> tConsumers, HashSet<Node> tNodeMap) { MetaPipeEntity tMetaPipe = (MetaPipeEntity) aPipe.getMetaTileEntity(); for (byte i = 0;i<6;i++) { @@ -51,20 +51,20 @@ abstract public class GenerateNodeMap { ArrayList<MetaPipeEntity> tNewPipes = new ArrayList<MetaPipeEntity>(); Pair nextTileEntity = getNextValidTileEntity(tNextTileEntity,tNewPipes,i,tNodeMap); if (nextTileEntity != null) { - Node tNextNode = generateNode(nextTileEntity.mTileEntity,aPipeNode,aNextNodeVale+1,tNewPipes, + Node tNextNode = generateNode(nextTileEntity.mTileEntity,aPipeNode,aNextNodeValue+1,tNewPipes, nextTileEntity.mSide,tConsumers,tNodeMap); if (tNextNode != null) { - aNextNodeVale = tNextNode.mHigestNodeValue; - aPipeNode.mHigestNodeValue = tNextNode.mHigestNodeValue; - aPipeNode.mNeigbourNodes[i] = tNextNode; - aPipeNode.mNodePats[i] = aPipeNode.mReturnPath; + aNextNodeValue = tNextNode.mHighestNodeValue; + aPipeNode.mHighestNodeValue = tNextNode.mHighestNodeValue; + aPipeNode.mNeighbourNodes[i] = tNextNode; + aPipeNode.mNodePaths[i] = aPipeNode.mReturnPath; } } } } - //on a valid tilentity create a new node - protected Node generateNode(TileEntity aTileEntity, Node aPreviousNode, int aNextNodeVale, ArrayList<MetaPipeEntity> aPipes, + //on a valid tile entity create a new node + protected Node generateNode(TileEntity aTileEntity, Node aPreviousNode, int aNextNodeValue, ArrayList<MetaPipeEntity> aPipes, int aSide, ArrayList<ConsumerNode> aConsumers, HashSet<Node> aNodeMap) { if (aTileEntity.isInvalid()) return null; byte tSideOp = getOppositeSide(aSide); @@ -73,36 +73,36 @@ abstract public class GenerateNodeMap { if (isPipe(aTileEntity)){ BaseMetaPipeEntity tPipe = (BaseMetaPipeEntity) aTileEntity; MetaPipeEntity tMetaPipe = (MetaPipeEntity) tPipe.getMetaTileEntity(); - int tConections = getNumberOfConections(tMetaPipe); + int tConnections = getNumberOfConnections(tMetaPipe); Node tPipeNode; - if (tConections == 1) { - tPipeNode = getEmptyNode(aNextNodeVale,tSideOp,aTileEntity,aConsumers); + if (tConnections == 1) { + tPipeNode = getEmptyNode(aNextNodeValue,tSideOp,aTileEntity,aConsumers); if (tPipeNode == null) return null; } else { - tPipeNode = getPipeNode(aNextNodeVale,tSideOp,aTileEntity,aConsumers); + tPipeNode = getPipeNode(aNextNodeValue,tSideOp,aTileEntity,aConsumers); } tPipe.setNode(tPipeNode); aNodeMap.add(tPipeNode); tPipeNode.mSelfPath = getNewPath(new MetaPipeEntity[]{tMetaPipe}); tThisNode = tPipeNode; if (tInvalidSide>-1) { - tPipeNode.mNeigbourNodes[tInvalidSide] = aPreviousNode; - tPipeNode.mNodePats[tInvalidSide] = getNewPath(aPipes.toArray(new MetaPipeEntity[0])); - aPreviousNode.mReturnPath = tPipeNode.mNodePats[tInvalidSide]; + tPipeNode.mNeighbourNodes[tInvalidSide] = aPreviousNode; + tPipeNode.mNodePaths[tInvalidSide] = getNewPath(aPipes.toArray(new MetaPipeEntity[0])); + aPreviousNode.mReturnPath = tPipeNode.mNodePaths[tInvalidSide]; } - if (tConections > 1) - generateNextNode(tPipe,tPipeNode,tInvalidSide,aNextNodeVale,aConsumers,aNodeMap); - } else if (addConsumer(aTileEntity,tSideOp,aNextNodeVale,aConsumers)) { + if (tConnections > 1) + generateNextNode(tPipe,tPipeNode,tInvalidSide,aNextNodeValue,aConsumers,aNodeMap); + } else if (addConsumer(aTileEntity,tSideOp,aNextNodeValue,aConsumers)) { ConsumerNode tConsumeNode = aConsumers.get(aConsumers.size()-1); - tConsumeNode.mNeigbourNodes[tSideOp] = aPreviousNode; - tConsumeNode.mNodePats[tSideOp] = getNewPath(aPipes.toArray(new MetaPipeEntity[0])); - aPreviousNode.mReturnPath = tConsumeNode.mNodePats[tSideOp]; + tConsumeNode.mNeighbourNodes[tSideOp] = aPreviousNode; + tConsumeNode.mNodePaths[tSideOp] = getNewPath(aPipes.toArray(new MetaPipeEntity[0])); + aPreviousNode.mReturnPath = tConsumeNode.mNodePaths[tSideOp]; tThisNode = tConsumeNode; } return tThisNode; } - //go over the pipes until we see a valid tileentity that needs a node + //go over the pipes until we see a valid tile entity that needs a node protected Pair getNextValidTileEntity(TileEntity aTileEntity, ArrayList<MetaPipeEntity> aPipes, byte aSide, HashSet<Node> aNodeMap) { if (isPipe(aTileEntity)) { BaseMetaPipeEntity tPipe = (BaseMetaPipeEntity) aTileEntity; @@ -112,8 +112,8 @@ abstract public class GenerateNodeMap { if (aNodeMap.contains(tNode)) return null; } - int tConections = getNumberOfConections(tMetaPipe); - if (tConections == 2) { + int tConnections = getNumberOfConnections(tMetaPipe); + if (tConnections == 2) { byte tSideOp = getOppositeSide(aSide); for (byte i = 0;i<6;i++) { if (i == tSideOp || !(tMetaPipe.isConnectedAtSide(i))) continue; @@ -144,16 +144,16 @@ abstract public class GenerateNodeMap { } } - //if check if the tileentity is the correct pipe + //if check if the tile entity is the correct pipe protected boolean isPipe(TileEntity aTileEntity) { return aTileEntity instanceof BaseMetaPipeEntity; } - //checks if the tileentity is a consumer and add to the list + //checks if the tile entity is a consumer and add to the list abstract protected boolean addConsumer(TileEntity aTileEntity, byte aSide, int aNodeValue, ArrayList<ConsumerNode> aConsumers); //get correct pathClass that you need for your node network protected abstract NodePath getNewPath(MetaPipeEntity[] aPipes); - //used for if you need to use death ends for somthing + //used for if you need to use death ends for something //can be null protected Node getEmptyNode(int aNodeValue, byte aSide, TileEntity aTileEntity, ArrayList<ConsumerNode> aConsumers) { return null; @@ -163,8 +163,8 @@ abstract public class GenerateNodeMap { return new Node(aNodeValue,aTileEntity,aConsumers); } - //get how many conections the pipe have - private static int getNumberOfConections(MetaPipeEntity aPipe) { + //get how many connections the pipe have + private static int getNumberOfConnections(MetaPipeEntity aPipe) { int tCons = 0; for (int i = 0; i < 6; i++) { if (aPipe.isConnectedAtSide(i)) tCons++; diff --git a/src/main/java/gregtech/api/graphs/GenerateNodeMapPower.java b/src/main/java/gregtech/api/graphs/GenerateNodeMapPower.java index c4b9b59a1b..547da44050 100644 --- a/src/main/java/gregtech/api/graphs/GenerateNodeMapPower.java +++ b/src/main/java/gregtech/api/graphs/GenerateNodeMapPower.java @@ -16,7 +16,7 @@ import net.minecraftforge.common.util.ForgeDirection; import java.util.ArrayList; import java.util.HashSet; -//node map generator for power distrubution +//node map generator for power distribution public class GenerateNodeMapPower extends GenerateNodeMap { public GenerateNodeMapPower(BaseMetaPipeEntity aTileEntity) { generateNode(aTileEntity,null,1,null, diff --git a/src/main/java/gregtech/api/graphs/Node.java b/src/main/java/gregtech/api/graphs/Node.java index fed599881c..258915e473 100644 --- a/src/main/java/gregtech/api/graphs/Node.java +++ b/src/main/java/gregtech/api/graphs/Node.java @@ -12,8 +12,8 @@ public class Node { this.mNodeValue = aNodeValue; this.mTileEntity = aTileEntity; this.mConsumers = aConsumers; - mHigestNodeValue = aNodeValue; - //you dont want to generate map multiple times in the same tick + mHighestNodeValue = aNodeValue; + //you don't want to generate map multiple times in the same tick mCreationTime = MinecraftServer.getServer().getTickCounter(); } @@ -23,8 +23,8 @@ public class Node { public ArrayList<ConsumerNode> mConsumers; public int mNodeValue; public final TileEntity mTileEntity; - public Node[] mNeigbourNodes = new Node[6]; - public NodePath[] mNodePats = new NodePath[6]; + public Node[] mNeighbourNodes = new Node[6]; + public NodePath[] mNodePaths = new NodePath[6]; public NodePath mReturnPath; - public int mHigestNodeValue; + public int mHighestNodeValue; } diff --git a/src/main/java/gregtech/api/graphs/NodeList.java b/src/main/java/gregtech/api/graphs/NodeList.java index 702e8446c0..36ebbc4f6f 100644 --- a/src/main/java/gregtech/api/graphs/NodeList.java +++ b/src/main/java/gregtech/api/graphs/NodeList.java @@ -1,23 +1,23 @@ package gregtech.api.graphs; -//keep track on wich node is being looked for accrouse the recursif functions +//keep track on which node is being looked for across the recursive functions public class NodeList { Node[] mNodes; - int mConter = 0; + int mCounter = 0; public NodeList(Node[] mNodes) { this.mNodes = mNodes; } Node getNextNode() { - if (++mConter < mNodes.length) - return mNodes[mConter]; + if (++mCounter < mNodes.length) + return mNodes[mCounter]; else return null; } Node getNode() { - if (mConter < mNodes.length) - return mNodes[mConter]; + if (mCounter < mNodes.length) + return mNodes[mCounter]; else return null; } diff --git a/src/main/java/gregtech/api/graphs/PowerNodes.java b/src/main/java/gregtech/api/graphs/PowerNodes.java index 39844bdd17..411d690cca 100644 --- a/src/main/java/gregtech/api/graphs/PowerNodes.java +++ b/src/main/java/gregtech/api/graphs/PowerNodes.java @@ -12,9 +12,9 @@ import gregtech.api.graphs.paths.PowerNodePath; * this network only includes nodes that have a higher value then it self so it does not know the highest known value that * the return node knows * - * with these rules we can know what a node contains the target node in its network as long the target node has a value - * more or equal then the node we are looking but is less or equal then the highest value that node knows - * this way we don't have to go over the entire network too look for it + * with these rules we can know for the target node to be in the network of a node, the target node must have a value no + * less than the node we are looking and no greater than the highest value that node knows + * this way we don't have to go over the entire network to look for it * * we also hold a list of all consumers so we can check before looking if that consumer actually needs power * and only look for nodes that actually need power @@ -27,11 +27,11 @@ public class PowerNodes { ConsumerNode tConsumer =(ConsumerNode) aConsumers.getNode(); int tLoopProtection = 0; while (tConsumer != null) { - int tTagetNodeValue = tConsumer.mNodeValue; + int tTargetNodeValue = tConsumer.mNodeValue; //if the target node has a value less then the current node - if (tTagetNodeValue < aCurrentNode.mNodeValue || tTagetNodeValue > aCurrentNode.mHigestNodeValue) { + if (tTargetNodeValue < aCurrentNode.mNodeValue || tTargetNodeValue > aCurrentNode.mHighestNodeValue) { for (int j = 0;j<6;j++) { - Node tNextNode = aCurrentNode.mNeigbourNodes[j]; + Node tNextNode = aCurrentNode.mNeighbourNodes[j]; if (tNextNode != null && tNextNode.mNodeValue < aCurrentNode.mNodeValue) { if (tNextNode.mNodeValue == tConsumer.mNodeValue) { tAmpsUsed += processNodeInject(aCurrentNode,tConsumer,j,aMaxAmps-tAmpsUsed,aVoltage,false); @@ -46,16 +46,16 @@ public class PowerNodes { } } } else { - //if the target node has a node value greater then current node vale + //if the target node has a node value greater then current node value for (int side = 5;side>-1;side--) { - Node tNextNode = aCurrentNode.mNeigbourNodes[side]; + Node tNextNode = aCurrentNode.mNeighbourNodes[side]; if (tNextNode == null) continue; - if (tNextNode.mNodeValue > aCurrentNode.mNodeValue && tNextNode.mNodeValue < tTagetNodeValue) { + if (tNextNode.mNodeValue > aCurrentNode.mNodeValue && tNextNode.mNodeValue < tTargetNodeValue) { if (tNextNode == aPreviousNode) return tAmpsUsed; tAmpsUsed += processNextNodeAbove(aCurrentNode,tNextNode,aConsumers,side,aMaxAmps-tAmpsUsed,aVoltage); tConsumer =(ConsumerNode) aConsumers.getNode(); break; - } else if (tNextNode.mNodeValue == tTagetNodeValue) { + } else if (tNextNode.mNodeValue == tTargetNodeValue) { tAmpsUsed += processNodeInject(aCurrentNode,tConsumer,side,aMaxAmps-tAmpsUsed,aVoltage,true); tConsumer =(ConsumerNode) aConsumers.getNextNode(); break; @@ -66,32 +66,32 @@ public class PowerNodes { return tAmpsUsed; } if (tLoopProtection++ > 20) { - throw new NullPointerException("infinit loop in powering nodes "); + throw new NullPointerException("infinite loop in powering nodes "); } } return tAmpsUsed; } - //checking if target node is next to it ot has a higer value then current node value - //thse functions are difrent to eayer go down or up the stack + //checking if target node is next to it or has a higher value then current node value + //these functions are different to either go down or up the stack protected static int powerNodeAbove(Node aCurrentNode, Node aPreviousNode, NodeList aConsumers, int aVoltage, int aMaxAmps) { int tAmpsUsed = 0; int tLoopProtection = 0; ConsumerNode tConsumer =(ConsumerNode) aConsumers.getNode(); while (tConsumer != null) { - int tTagetNodeValue = tConsumer.mNodeValue; - if (tTagetNodeValue > aCurrentNode.mHigestNodeValue || tTagetNodeValue < aCurrentNode.mNodeValue) { + int tTargetNodeValue = tConsumer.mNodeValue; + if (tTargetNodeValue > aCurrentNode.mHighestNodeValue || tTargetNodeValue < aCurrentNode.mNodeValue) { return tAmpsUsed; } else { for (int side = 5;side>-1;side--) { - Node tNextNode = aCurrentNode.mNeigbourNodes[side]; + Node tNextNode = aCurrentNode.mNeighbourNodes[side]; if (tNextNode == null) continue; - if (tNextNode.mNodeValue > aCurrentNode.mNodeValue && tNextNode.mNodeValue < tTagetNodeValue) { + if (tNextNode.mNodeValue > aCurrentNode.mNodeValue && tNextNode.mNodeValue < tTargetNodeValue) { if (tNextNode == aPreviousNode) return tAmpsUsed; tAmpsUsed += processNextNodeAbove(aCurrentNode,tNextNode,aConsumers,side,aMaxAmps-tAmpsUsed,aVoltage); tConsumer =(ConsumerNode) aConsumers.getNode(); break; - } else if (tNextNode.mNodeValue == tTagetNodeValue) { + } else if (tNextNode.mNodeValue == tTargetNodeValue) { tAmpsUsed += processNodeInject(aCurrentNode,tConsumer,side,aMaxAmps-tAmpsUsed,aVoltage,true); tConsumer =(ConsumerNode) aConsumers.getNextNode(); break; @@ -102,14 +102,14 @@ public class PowerNodes { return tAmpsUsed; } if (tLoopProtection++ > 20) { - throw new NullPointerException("infinit loop in powering nodes "); + throw new NullPointerException("infinite loop in powering nodes "); } } return tAmpsUsed; } protected static int processNextNode(Node aCurrentNode, Node aNextNode, NodeList aConsumers, int aSide, int aMaxAmps, int aVoltage) { - PowerNodePath tPath = (PowerNodePath)aCurrentNode.mNodePats[aSide]; + PowerNodePath tPath = (PowerNodePath)aCurrentNode.mNodePaths[aSide]; PowerNodePath tSelfPath = (PowerNodePath) aCurrentNode.mSelfPath; int tVoltLoss = 0; if (tSelfPath != null) { @@ -126,7 +126,7 @@ public class PowerNodes { } protected static int processNextNodeAbove(Node aCurrentNode, Node aNextNode, NodeList aConsumers, int aSide, int aMaxAmps, int aVoltage) { - PowerNodePath tPath = (PowerNodePath)aCurrentNode.mNodePats[aSide]; + PowerNodePath tPath = (PowerNodePath)aCurrentNode.mNodePaths[aSide]; PowerNodePath tSelfPath = (PowerNodePath) aCurrentNode.mSelfPath; int tVoltLoss = 0; if (tSelfPath != null) { @@ -144,7 +144,7 @@ public class PowerNodes { protected static int processNodeInject(Node aCurrentNode, ConsumerNode aConsumer, int aSide,int aMaxAmps, int aVoltage, boolean isUp) { - PowerNodePath tPath = (PowerNodePath)aCurrentNode.mNodePats[aSide]; + PowerNodePath tPath = (PowerNodePath)aCurrentNode.mNodePaths[aSide]; PowerNodePath tSelfPath = (PowerNodePath) aCurrentNode.mSelfPath; int tVoltLoss = 0; if (tSelfPath != null) { diff --git a/src/main/java/gregtech/api/graphs/consumers/ConsumerNode.java b/src/main/java/gregtech/api/graphs/consumers/ConsumerNode.java index d2be4d94f1..87376008c4 100644 --- a/src/main/java/gregtech/api/graphs/consumers/ConsumerNode.java +++ b/src/main/java/gregtech/api/graphs/consumers/ConsumerNode.java @@ -5,7 +5,7 @@ import net.minecraft.tileentity.TileEntity; import java.util.ArrayList; -//node atached to a tileentity that can consume stuff from the network +//node attached to a tile entity that can consume stuff from the network public class ConsumerNode extends Node { public byte mSide; public ConsumerNode(int aNodeValue, TileEntity aTileEntity, byte aSide, ArrayList<ConsumerNode> aConsumers) { @@ -17,7 +17,7 @@ public class ConsumerNode extends Node { return !mTileEntity.isInvalid(); } - public int injectEnergy(int aVoltage, int aMaxApms) { + public int injectEnergy(int aVoltage, int aMaxAmps) { return 0; } } diff --git a/src/main/java/gregtech/api/graphs/consumers/EmptyPowerConsumer.java b/src/main/java/gregtech/api/graphs/consumers/EmptyPowerConsumer.java index 47e3bca144..da3d0a757b 100644 --- a/src/main/java/gregtech/api/graphs/consumers/EmptyPowerConsumer.java +++ b/src/main/java/gregtech/api/graphs/consumers/EmptyPowerConsumer.java @@ -6,7 +6,7 @@ import net.minecraft.tileentity.TileEntity; import java.util.ArrayList; -//this is here to aply voltage to death ends +//this is here to apply voltage to death ends public class EmptyPowerConsumer extends ConsumerNode{ public EmptyPowerConsumer(int aNodeValue, TileEntity aTileEntity, byte aSide, ArrayList<ConsumerNode> aConsumers) { super(aNodeValue, aTileEntity, aSide, aConsumers); @@ -18,7 +18,7 @@ public class EmptyPowerConsumer extends ConsumerNode{ } @Override - public int injectEnergy(int aVoltage, int aMaxApms) { + public int injectEnergy(int aVoltage, int aMaxAmps) { BaseMetaPipeEntity tPipe = (BaseMetaPipeEntity) mTileEntity; PowerNodePath tPath =(PowerNodePath) tPipe.getNodePath(); tPath.applyVoltage(aVoltage,true); diff --git a/src/main/java/gregtech/api/graphs/consumers/NodeEnergyReceiver.java b/src/main/java/gregtech/api/graphs/consumers/NodeEnergyReceiver.java index ec25578e8e..c8c4c64211 100644 --- a/src/main/java/gregtech/api/graphs/consumers/NodeEnergyReceiver.java +++ b/src/main/java/gregtech/api/graphs/consumers/NodeEnergyReceiver.java @@ -22,7 +22,7 @@ public class NodeEnergyReceiver extends ConsumerNode { } @Override - public int injectEnergy(int aVoltage, int aMaxApms) { + public int injectEnergy(int aVoltage, int aMaxAmps) { ForgeDirection tDirection = ForgeDirection.getOrientation(mSide); int rfOut = GT_Utility.safeInt(aVoltage * GregTech_API.mEUtoRF / 100); if (((IEnergyReceiver) mTileEntity).receiveEnergy(tDirection, rfOut, true) == rfOut) { @@ -36,7 +36,7 @@ public class NodeEnergyReceiver extends ConsumerNode { return 0; } - //copyed from IEnergyConnected + //copied from IEnergyConnected private void explode(int aRfOut) { if (aRfOut > 32L * GregTech_API.mEUtoRF / 100L) { int aExplosionPower = aRfOut; diff --git a/src/main/java/gregtech/api/graphs/consumers/NodeEnergySink.java b/src/main/java/gregtech/api/graphs/consumers/NodeEnergySink.java index db9f383492..3f93c62010 100644 --- a/src/main/java/gregtech/api/graphs/consumers/NodeEnergySink.java +++ b/src/main/java/gregtech/api/graphs/consumers/NodeEnergySink.java @@ -18,9 +18,9 @@ public class NodeEnergySink extends ConsumerNode { } @Override - public int injectEnergy(int aVoltage, int aMaxApms) { + public int injectEnergy(int aVoltage, int aMaxAmps) { int tUsedAmps = 0; - while (aMaxApms > tUsedAmps && ((IEnergySink) mTileEntity).getDemandedEnergy() > 0 && + while (aMaxAmps > tUsedAmps && ((IEnergySink) mTileEntity).getDemandedEnergy() > 0 && ((IEnergySink) mTileEntity).injectEnergy(ForgeDirection.getOrientation(mSide), aVoltage, aVoltage) < aVoltage) tUsedAmps++; return tUsedAmps; diff --git a/src/main/java/gregtech/api/graphs/consumers/NodeGTBaseMetaTile.java b/src/main/java/gregtech/api/graphs/consumers/NodeGTBaseMetaTile.java index dbcc3c3b62..5c54ee16f9 100644 --- a/src/main/java/gregtech/api/graphs/consumers/NodeGTBaseMetaTile.java +++ b/src/main/java/gregtech/api/graphs/consumers/NodeGTBaseMetaTile.java @@ -11,8 +11,8 @@ public class NodeGTBaseMetaTile extends ConsumerNode { } @Override - public int injectEnergy(int aVoltage, int aMaxApms) { - return (int)((IEnergyConnected) mTileEntity).injectEnergyUnits(mSide,aVoltage, aMaxApms); + public int injectEnergy(int aVoltage, int aMaxAmps) { + return (int)((IEnergyConnected) mTileEntity).injectEnergyUnits(mSide,aVoltage, aMaxAmps); } @Override diff --git a/src/main/java/gregtech/api/graphs/paths/PowerNodePath.java b/src/main/java/gregtech/api/graphs/paths/PowerNodePath.java index 1445e45734..736373a9ca 100644 --- a/src/main/java/gregtech/api/graphs/paths/PowerNodePath.java +++ b/src/main/java/gregtech/api/graphs/paths/PowerNodePath.java @@ -6,7 +6,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable; import net.minecraft.server.MinecraftServer; //path for cables -//al calculations like ams and voltage hapens here +//all calculations like amp and voltage happens here public class PowerNodePath extends NodePath { int mMaxAmps; int mAmps = 0; @@ -59,7 +59,7 @@ public class PowerNodePath extends NodePath { } //if no amps pass trough for more then 0.5 second reduce them to minimize wrong results - //but still allow the player to see if activity is hapening + //but still allow the player to see if activity is happening public int getAmps() { int tTime = MinecraftServer.getServer().getTickCounter() - 10; if (mTick < tTime) { diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java index 39cbee3aa9..b51377550b 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java @@ -283,14 +283,14 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE if (!hasValidMetaTileEntity()) return; } } - byte oldConections = mConnections; - // Mask-out Connection direction bits to keep only Foam related connections + byte oldConnections = mConnections; + // Mask-out connection direction bits to keep only Foam related connections mConnections = (byte) (mMetaTileEntity.mConnections | (mConnections & ~IConnectable.CONNECTED_ALL)); // If foam not hardened, tries roll chance to harden if ((mConnections & IConnectable.HAS_FOAM) == IConnectable.HAS_FRESHFOAM && getRandomNumber(1000) == 0) { mConnections = (byte) ((mConnections & ~IConnectable.HAS_FRESHFOAM) | IConnectable.HAS_HARDENEDFOAM); } - if (mTickTimer > 12 && oldConections != mConnections) + if (mTickTimer > 12 && oldConnections != mConnections) GregTech_API.causeCableUpdate(worldObj,xCoord,yCoord,zCoord); } case 8: diff --git a/src/main/java/gregtech/api/threads/GT_Runnable_Cable_Update.java b/src/main/java/gregtech/api/threads/GT_Runnable_Cable_Update.java index 6bc42e9cc8..7093184533 100644 --- a/src/main/java/gregtech/api/threads/GT_Runnable_Cable_Update.java +++ b/src/main/java/gregtech/api/threads/GT_Runnable_Cable_Update.java @@ -21,18 +21,16 @@ public class GT_Runnable_Cable_Update extends GT_Runnable_MachineBlockUpdate { } } - @Override public void run() { try { while (!tQueue.isEmpty()) { final ChunkCoordinates aCoords = tQueue.poll(); final TileEntity tTileEntity; - final boolean isMachineBlock; GT_Proxy.TICK_LOCK.lock(); try { - //we dont want to go over cables that are in unloaded chuncks + //we dont want to go over cables that are in unloaded chunks //keeping the lock just to make sure no CME happens if (world.blockExists(aCoords.posX, aCoords.posY, aCoords.posZ)) { tTileEntity = world.getTileEntity(aCoords.posX, aCoords.posY, aCoords.posZ); @@ -48,7 +46,7 @@ public class GT_Runnable_Cable_Update extends GT_Runnable_MachineBlockUpdate { ((IMachineBlockUpdateable) tTileEntity).onMachineBlockUpdate(); // Now see if we should add the nearby blocks to the queue: - //only add blocks wich the cable is conected too + // only add blocks the cable is connected to if (tTileEntity instanceof BaseMetaPipeEntity && ((BaseMetaPipeEntity) tTileEntity).getMetaTileEntity() instanceof GT_MetaPipeEntity_Cable) { |