diff options
author | Glease <4586901+Glease@users.noreply.github.com> | 2023-12-03 21:19:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-03 14:19:28 +0100 |
commit | 82b2fdb4d39f46fb1ab5aab25757b4720dec5f1d (patch) | |
tree | e8862e34755c230d796b3cc5661a1ea72066e375 /src | |
parent | 5d83fd16deacc98b7541f675da008705b7cd3bc9 (diff) | |
download | GT5-Unofficial-82b2fdb4d39f46fb1ab5aab25757b4720dec5f1d.tar.gz GT5-Unofficial-82b2fdb4d39f46fb1ab5aab25757b4720dec5f1d.tar.bz2 GT5-Unofficial-82b2fdb4d39f46fb1ab5aab25757b4720dec5f1d.zip |
tweak cal structure code (#376)
* tweak cal structure code
* spotless
Former-commit-id: ce2d329edb93b96dfaa624d3dff9e912cdb32a91
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java | 48 |
1 files changed, 37 insertions, 11 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index ea639a186c..e7c9f3f7c7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -15,8 +15,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; import static com.github.bartimaeusnek.bartworks.util.BW_Util.ofGlassTieredMixed; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.GT_HatchElement.Energy; import static gregtech.api.enums.GT_HatchElement.InputBus; import static gregtech.api.enums.GT_HatchElement.InputHatch; @@ -90,6 +89,8 @@ public class GT_TileEntity_CircuitAssemblyLine extends private static final String STRUCTURE_PIECE_FIRST = "first"; private static final String STRUCTURE_PIECE_NEXT = "next"; + private static final String STRUCTURE_PIECE_NEXT_HINT = "next_hint"; + private static final String STRUCTURE_PIECE_LAST = "last"; private static final int MINIMUM_CIRCUIT_ASSEMBLER_LENGTH = 5; protected static final String IMPRINT_KEY = "Type"; @@ -109,6 +110,12 @@ public class GT_TileEntity_CircuitAssemblyLine extends .addShape( STRUCTURE_PIECE_NEXT, transpose(new String[][] { { "G", "G", "G" }, { "g", "l", "g" }, { "b", "I", "b" }, })) + .addShape( + STRUCTURE_PIECE_NEXT_HINT, + transpose(new String[][] { { "G", "G", "G" }, { "g", "l", "g" }, { "b", "i", "b" }, })) + .addShape( + STRUCTURE_PIECE_LAST, + transpose(new String[][] { { "G", "G", "G" }, { "g", "l", "g" }, { "b", "o", "b" }, })) .addElement( 'G', buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class).atLeast(Energy).casingIndex(CASING_INDEX) @@ -118,13 +125,15 @@ public class GT_TileEntity_CircuitAssemblyLine extends .addElement( 'b', buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class).atLeast(InputHatch, Maintenance) - .casingIndex(CASING_INDEX).dot(2).buildAndChain(GregTech_API.sBlockCasings2, 0)) - .addElement('i', InputBus.newAny(CASING_INDEX, 3)) + .casingIndex(CASING_INDEX).dot(2).disallowOnly(ForgeDirection.EAST, ForgeDirection.WEST) + .buildAndChain(GregTech_API.sBlockCasings2, 0)) + .addElement('i', InputBus.newAny(CASING_INDEX, 3, ForgeDirection.DOWN)) .addElement( 'I', buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class).atLeast(InputHatch, InputBus, OutputBus) - .casingIndex(CASING_INDEX).dot(2).buildAndChain(GregTech_API.sBlockCasings2, 0)) - .build(); + .casingIndex(CASING_INDEX).dot(2).disallowOnly(ForgeDirection.EAST, ForgeDirection.WEST) + .buildAndChain(GregTech_API.sBlockCasings2, 0)) + .addElement('o', OutputBus.newAny(CASING_INDEX, 2, ForgeDirection.DOWN)).build(); @Override public IStructureDefinition<GT_TileEntity_CircuitAssemblyLine> getStructureDefinition() { @@ -440,16 +449,33 @@ public class GT_TileEntity_CircuitAssemblyLine extends public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { if (this.mMachine) return -1; int built; - built = this.survivialBuildPiece(STRUCTURE_PIECE_FIRST, stackSize, 0, 0, 0, elementBudget, env, false, true); + built = survivialBuildPiece(STRUCTURE_PIECE_FIRST, stackSize, 0, 0, 0, elementBudget, env, false, true); if (built >= 0) return built; int tLength = Math.min(stackSize.stackSize + 1, 7); - for (int i = 1; i < tLength; ++i) { - built = this - .survivialBuildPiece(STRUCTURE_PIECE_NEXT, stackSize, -i, 0, 0, elementBudget, env, false, true); + for (int i = 1; i < tLength - 1; ++i) { + built = survivialBuildPiece( + STRUCTURE_PIECE_NEXT_HINT, + stackSize, + -i, + 0, + 0, + elementBudget, + env, + false, + true); if (built >= 0) return built; } - return -1; + return survivialBuildPiece( + STRUCTURE_PIECE_LAST, + stackSize, + -(tLength - 1), + 0, + 0, + elementBudget, + env, + false, + true); } @Override |