Ok, I've just finished the new code, here it goes:   The transfer pipe for sending and receiving energy: public class TileEntityPipeTransferEnergy extends TileEntityEnergy { //private Map<BlockPos, Integer> connected_weight = new HashMap<>(); // with pre-calculated weight, no clue how to do this... :( private Set<BlockPos> connected = new HashSet<>(); // without pre-calculated weight public boolean shouldRecalculate = false; pu