diff options
| author | Elisis <gtandemmodding@gmail.com> | 2024-09-09 15:26:49 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-09 05:26:49 +0000 |
| commit | eda122bfba27558f89d1e2accf83e43027772366 (patch) | |
| tree | 1073d26c79e17f099306e272266cfd5012026a9f /src/main/java/gtnhlanth/common/hatch | |
| parent | 418491cbccdc6a0908868247c7aac36a41c70c2d (diff) | |
| download | GT5-Unofficial-eda122bfba27558f89d1e2accf83e43027772366.tar.gz GT5-Unofficial-eda122bfba27558f89d1e2accf83e43027772366.tar.bz2 GT5-Unofficial-eda122bfba27558f89d1e2accf83e43027772366.zip | |
Beamline Fixes and Balancing (#3064)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Diffstat (limited to 'src/main/java/gtnhlanth/common/hatch')
| -rw-r--r-- | src/main/java/gtnhlanth/common/hatch/MTEHatchOutputBeamline.java | 49 |
1 files changed, 44 insertions, 5 deletions
diff --git a/src/main/java/gtnhlanth/common/hatch/MTEHatchOutputBeamline.java b/src/main/java/gtnhlanth/common/hatch/MTEHatchOutputBeamline.java index dfb210d725..00772fb5e8 100644 --- a/src/main/java/gtnhlanth/common/hatch/MTEHatchOutputBeamline.java +++ b/src/main/java/gtnhlanth/common/hatch/MTEHatchOutputBeamline.java @@ -83,14 +83,53 @@ public class MTEHatchOutputBeamline extends MTEHatchBeamlineConnector<BeamLinePa public void moveAround(IGregTechTileEntity aBaseMetaTileEntity) { IConnectsToBeamline current = this, source = this, next; int range = 0; - while ((next = current.getNext(source)) != null && range++ < 100) { - if (next instanceof MTEHatchInputBeamline) { - ((MTEHatchInputBeamline) next).setContents(q); + + ForgeDirection front = this.getBaseMetaTileEntity() + .getFrontFacing(); + + for (int distance = 1; distance <= 129; distance++) { // 128 pipes max + + IGregTechTileEntity nextTE = (IGregTechTileEntity) this.getBaseMetaTileEntity() + .getTileEntityAtSideAndDistance(front, distance); // Straight line transmission only + + if (nextTE == null) { + return; + } + + IMetaTileEntity nextMeta = nextTE.getMetaTileEntity(); + + if (nextMeta == null || !(nextMeta instanceof IConnectsToBeamline)) { // Non-beamliney block + return; + } + + if (((IConnectsToBeamline) nextMeta) instanceof MTEHatchInputBeamline) { + ((MTEHatchInputBeamline) nextMeta).setContents(q); // Reached another multi break; + + } else if (((IConnectsToBeamline) nextMeta) instanceof MTEBeamlinePipe) { // Another pipe follows + + if (((MTEBeamlinePipe) nextMeta).isDataInputFacing(front.getOpposite())) { // Connected to previous pipe + ((MTEBeamlinePipe) nextMeta).markUsed(); + } else { + return; + } + + } else { + return; } - source = current; - current = next; + } + + /* + * while ((next = current.getNext(source)) != null && range++ < 100) { + * if (next instanceof TileHatchInputBeamline) { + * ((TileHatchInputBeamline) next).setContents(q); + * break; + * } + * source = current; + * current = next; + * } + */ q = null; } |
