diff --git a/build.properties b/build.properties index fe94e15..ef7c143 100644 --- a/build.properties +++ b/build.properties @@ -4,5 +4,5 @@ version.forge=10.13.2.1231 version.minecraft=1.7.10 version.mod.major=0 version.mod.minor=5 -version.mod.revis=2 +version.mod.revis=4 version.nei=1.0.3.62 \ No newline at end of file diff --git a/src/main/java/stevesaddons/tileentities/TileEntityRFNode.java b/src/main/java/stevesaddons/tileentities/TileEntityRFNode.java index 213fc04..9ebc257 100644 --- a/src/main/java/stevesaddons/tileentities/TileEntityRFNode.java +++ b/src/main/java/stevesaddons/tileentities/TileEntityRFNode.java @@ -51,7 +51,11 @@ private void loadManagers() { TileEntity te = worldObj.getTileEntity(manager.getX(), manager.getY(), manager.getZ()); if (te instanceof TileEntityManager) - managers.add((TileEntityManager) te); + { + TileEntityManager tileEntityManager = (TileEntityManager) te; + tileEntityManager.updateInventories(); + managers.add(tileEntityManager); + } } } addManagers=null; @@ -198,9 +202,16 @@ public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) if (from != ForgeDirection.UNKNOWN) { if (!inputSides[from.ordinal()]) return 0; + Set outputs = new HashSet(); + int outputPacket = toReceive/connections.size(); for (TileEntityRFNode connected : connections) { - toReceive-=connected.receiveEnergy(ForgeDirection.UNKNOWN,toReceive,simulate); + if (connected.receiveEnergy(ForgeDirection.UNKNOWN,outputPacket,true)>0) outputs.add(connected); + } + outputPacket = maxReceive/outputs.size(); + for (TileEntityRFNode connected : outputs) + { + toReceive-=connected.receiveEnergy(ForgeDirection.UNKNOWN,outputPacket,simulate); if (toReceive==0) return maxReceive; } } @@ -229,9 +240,16 @@ public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) if (from != ForgeDirection.UNKNOWN) { if (!outputSides[from.ordinal()]) return 0; + int outputPacket = toExtract/connections.size(); + Set inputs = new HashSet(); for (TileEntityRFNode connected : connections) { - toExtract-=connected.extractEnergy(ForgeDirection.UNKNOWN,toExtract,simulate); + if (connected.extractEnergy(ForgeDirection.UNKNOWN,outputPacket,true)>0) inputs.add(connected); + } + outputPacket = toExtract/inputs.size(); + for (TileEntityRFNode connected : inputs) + { + toExtract-=connected.extractEnergy(ForgeDirection.UNKNOWN,outputPacket,simulate); if (toExtract==0) return maxExtract; } } diff --git a/src/main/resources/assets/stevesaddons/textures/blocks/cable_rf.png b/src/main/resources/assets/stevesaddons/textures/blocks/cable_rf.png new file mode 100644 index 0000000..d3f39e6 Binary files /dev/null and b/src/main/resources/assets/stevesaddons/textures/blocks/cable_rf.png differ