The mechanism of brief analysis GT6 pipeline and wire [GT6] Gregtech 6 (Gregtech 6) Minecraft Game

This tutorial is set by the author to use the CC by-NC protocol.

Many people seem to be familiar with the wires and fluid pipeline mechanisms in the GT6. Here are briefly explaining the distribution mechanism of these two things (maybe the logistics pipes will also write QVQ painting. Jpg).

electric wire

Look at the code first:

 for (byte tside: all_sides_valid_but [aside]) if (CanMitenerGyto (Tside)) {

If (AAMPERAGE <= Rusedampers) Break;

Delegatortilentity tDelegator = getadjacentTilentity (Tside);

If (AALREADYPASSED.ADD (TDELEGATOR.MTILEENTITY)) {{

If (TDELEGATOR.MTILEENTITITY Instanceof MultiLeleEleElectric) {{

If (MultiTitilentityWireelectric) tdelegator.mtilentity).

RUSEEDAMPERES+= (MULTITILEENTITYWIREELECTRIC) TDELEGATOR.MTILEENTITY) .TRANSFELELECTRITY (TDELEGATOR.MSIDEIFTILENTITY, AAMPERAGE -RUS Edamperes, ACHANNEL, AALREADYPASED);

}

} Else {

RUSEEDAMPERES+= iTilentity Energy.util.InSerTenerGyinto (td.energy.eu, Avoltage, Aamperage-RUSEDAMPERES, this, TDELEGATOR);

}

}

}

ASIDE is the surface of the wire input power from the wire.

Simply put, when the power supply outputs the power to a certain guide wire, the wires will try to output power from each "other" each of the other "other" each "other" other "other" other ".Otherwise, output power to the machine on that surface, consume the consumption current reported by the machine, if there is a surplus current, continue to output current to the next priority surface.

There is a specification in the gregi.data.cs. It stipulates that all_sides_valid = 0,1,2,3,4,5, the output order of the wire is also trying out of the output from the number 0 to 5, in fact, according to the following> North> South> South> South> South> South> South> South> South> South> South> South> South> South> South> South> South> South> South> South> South> South> South> South> South> South> South> South> South>East> West order output.Therefore, the wires in the GT6 are the algorithm of the neighborhood exchange. A wire should not be regarded as the whole, but it should be regarded as a single -grid wire for transmission.(However, recursive execution is performed in the same Tick, that is, electricity will instantly reach electrical appliances, and the wires will not cache electricity.)

(In addition: According to the basic code of most processing machines, the number of current consumed N is actually the minimum value when the demand voltage is when the demand voltage is used. For example, the ordinary MV machine will consume 256EU by default.For the reason, the voltage of 120EU is provided, and the machine will accept the electricity of 3A*120EU, and the electricity of the excess 3*120-256eu (104EU) will be stored in the cache. The demand voltage will become 256-104EU at the next moment.

For other machine overclocking mechanisms, please refer to another tutorial in the station: https://www.mcmod.cn/post/3180.html

Let ’s take a few examples below (8 full batteries are placed in battery boxes):

When the battery box cache is not expired, the 16A current can be entered. According to the priority of the above, the battery box below will give priority to filling the cache, and the battery box on the right will not get any current.

After the battery box cache is full, the number of ampels of the input current can be determined according to the number of air batteries in the battery box.

As shown in the figure, it can be seen that the order and distance, position and other factors of the wire output current have nothing to do. The wires will only try the output in order in order of the order of the following> above> North> South> East> West.The grid wire that is tightly adjacent to the output battery box will first transfer the electricity to the grid wire below it in this order, and then search for the connected battery box. The battery box/wire on the other side cannot get any current.

(The optical cable and the wire are the same algorithm)

Fluid pipeline

Look at the code first:

 // omitted: fill in the refined pot and other blocks to detect whether the corresponding surface is accepted by the fluid, the cover version allows the fluid to pass to prevent fluid flow from the input surface of a game moment, etc.

for (byte tside: all_sides_valid) {

// omitted: detect all possible fluid pipes that may output six planes or machines with fluid grooves (and remove the fluid pipes entered to this pipeline last time), and count it to the two lists (ttargetCount)Pipeline: TPIPES, fluid groove: TTANKS)

// amount to distribute normally.

tamount = ut.code.divup (tamount, ttargetCount);

// Distribute to pipes first.

For (FLUIDTANKGT TPIPE: TPIPES) mtransferredamount+= Atank.remove (tpipe.add (atank.amount (tamount-tpipe.amount ())), Atank.get ()));

// Check if we are embty.

if (atank.isempty ()) Return;

// Distribute to Tanks afterwards.

For (delegatortilentity ttank: ttanks) mtransferredamount+= Atank.remove (FL.Fill (ttank, atank.get (tamount), T));

// Check if we are embty.

if (atank.isempty ()) Return;

// no targets? Nothing to do then.if (tpipes.isempty ()) return;

// and then if only is presenture, distribute to pipes again.

tamount = (atank.amount ()-mcapacity/2)/tpipes.size ();

If (Tamount> 0) for (Fluidtankgt TPIPES) mtransferredamount+= Atank.remove (tpipe.add (atank.amount (tamount), Atank.get ())))

}

In short, all possible fluid pipelines that may output output or the number of machines with fluid grooves with a fluid pipeline accounting number (recorded as N) first outputs the fluid of N L to each connected pipeline, and then to each fluid to each fluidThe slot output N L fluid.Note that the output N L does not mean that N L, the target may be half full and can only accept a part.Therefore, if the pipeline is not empty, it will finally output to the fluid of each connected pipeline (the current remaining fluid volume- (this pipe capacity/2)/target quantity) L.

Although the GT has the code to prevent the flow of the fluid pipeline, the code has not solved the phenomenon of 1L fluid back and forth, looking forward to the solution after the GT.