aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech
diff options
context:
space:
mode:
authorGlease <4586901+Glease@users.noreply.github.com>2021-06-10 05:23:15 +0800
committerGlease <4586901+Glease@users.noreply.github.com>2021-07-30 14:34:37 +0800
commit3a472099af01778f5b62cc4ab2aaf6dc5cfff299 (patch)
tree049efac9b9ae43432422a842b41f5f0166ccc576 /src/main/java/gregtech
parent2085a8654580f2b1b457343cf5c225ecb1800dd6 (diff)
downloadGT5-Unofficial-3a472099af01778f5b62cc4ab2aaf6dc5cfff299.tar.gz
GT5-Unofficial-3a472099af01778f5b62cc4ab2aaf6dc5cfff299.tar.bz2
GT5-Unofficial-3a472099af01778f5b62cc4ab2aaf6dc5cfff299.zip
migrate even more multis over
Signed-off-by: Glease <4586901+Glease@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gregtech')
-rw-r--r--src/main/java/gregtech/common/GT_Client.java2
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller1.java5
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller2.java35
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java12
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java89
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java8
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java149
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java139
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java131
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java2
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java2
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java2
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java2
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java3
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java276
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill1.java5
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill2.java5
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill3.java5
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java17
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java5
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant2.java5
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant3.java5
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant4.java5
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java8
24 files changed, 423 insertions, 494 deletions
diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java
index 154b8d7308..8e06207267 100644
--- a/src/main/java/gregtech/common/GT_Client.java
+++ b/src/main/java/gregtech/common/GT_Client.java
@@ -293,7 +293,7 @@ public class GT_Client extends GT_Proxy
drawRotationMarker(t);
}
} else {
- drawRotationMarker(ROTATION_MARKER_TRANSFORMS_SIDES_TRANSFORMS[ROTATION_MARKER_TRANSFORMS_SIDES[tSideHit*6+direction.ordinal()]]);
+ drawRotationMarker(ROTATION_MARKER_TRANSFORMS_SIDES_TRANSFORMS[ROTATION_MARKER_TRANSFORMS_SIDES[tSideHit * 6 + direction.ordinal()]]);
}
}
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller1.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller1.java
index a509d35ad3..af1468396b 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller1.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller1.java
@@ -4,6 +4,7 @@ import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
public class GT_MetaTileEntity_ConcreteBackfiller1 extends GT_MetaTileEntity_ConcreteBackfillerBase {
public GT_MetaTileEntity_ConcreteBackfiller1(int aID, String aName, String aNameRegional) {
@@ -15,8 +16,8 @@ public class GT_MetaTileEntity_ConcreteBackfiller1 extends GT_MetaTileEntity_Con
}
@Override
- public String[] getDescription() {
- return getDescriptionInternal("");
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ return createTooltip("Concrete Backfiller");
}
@Override
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller2.java
index d1f44580c6..05646676e7 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller2.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller2.java
@@ -6,10 +6,6 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
-import static gregtech.api.enums.GT_Values.VN;
-
-import org.lwjgl.input.Keyboard;
-
public class GT_MetaTileEntity_ConcreteBackfiller2 extends GT_MetaTileEntity_ConcreteBackfillerBase {
public GT_MetaTileEntity_ConcreteBackfiller2(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -20,35 +16,8 @@ public class GT_MetaTileEntity_ConcreteBackfiller2 extends GT_MetaTileEntity_Con
}
@Override
- public String[] getDescription() {
- String casings = getCasingBlockItem().get(0).getDisplayName();
-
- final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType("Concrete Backfiller")
- .addInfo("Controller Block for the Advanced Concrete Backfiller")
- .addInfo("Will fill in areas below it with light concrete. This goes through walls")
- .addInfo("Use it to remove any spawning locations beneath your base to reduce lag")
- .addInfo("Will pull back the pipes after it finishes that layer")
- .addInfo("Put Programmed Circuits into a Data Access Hatch to config radius. Buggy")
- .addInfo("Radius = (total config value)x2 blocks. Default 64, Maximum 128")//broken
- .addSeparator()
- .beginStructureBlock(3, 7, 3, false)
- .addController("Front bottom")
- .addStructureInfo(casings + " form the 3x1x3 Base")
- .addOtherStructurePart(casings, " 1x3x1 pillar above the center of the base (2 minimum total)")
- .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top")
- .addEnergyHatch(VN[getMinTier()] + "+, Any base casing")
- .addMaintenanceHatch("Any base casing")
- .addStructureInfo("Data Access Hatch: Any base casing")
- .addInputBus("Mining Pipes, optional, any base casing")
- .addInputHatch("GT Concrete, any base casing")
- .addOutputBus("Mining Pipes, optional, any base casing")
- .toolTipFinisher("Gregtech");
- if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
- return tt.getInformation();
- } else {
- return tt.getStructureInformation();
- }
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ return createTooltip("Advanced Concrete Backfiller");
}
@Override
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java
index a64fea5ab0..2341452ebe 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java
@@ -11,8 +11,6 @@ import net.minecraft.item.ItemStack;
import static gregtech.api.enums.GT_Values.VN;
-import org.lwjgl.input.Keyboard;
-
public abstract class GT_MetaTileEntity_ConcreteBackfillerBase extends GT_MetaTileEntity_DrillerBase {
private int mLastXOff = 0, mLastZOff = 0;
@@ -25,12 +23,12 @@ public abstract class GT_MetaTileEntity_ConcreteBackfillerBase extends GT_MetaTi
super(aName);
}
- protected String[] getDescriptionInternal(String tierSuffix) {
+ protected GT_Multiblock_Tooltip_Builder createTooltip(String aStructureName) {
String casings = getCasingBlockItem().get(0).getDisplayName();
final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
tt.addMachineType("Concrete Backfiller")
- .addInfo("Controller Block for the Concrete Backfiller " + (tierSuffix != null ? tierSuffix : ""))//Unused?
+ .addInfo("Controller Block for the " + aStructureName)
.addInfo("Will fill in areas below it with light concrete. This goes through walls")
.addInfo("Use it to remove any spawning locations beneath your base to reduce lag")
.addInfo("Will pull back the pipes after it finishes that layer")
@@ -47,11 +45,7 @@ public abstract class GT_MetaTileEntity_ConcreteBackfillerBase extends GT_MetaTi
.addInputHatch("GT Concrete, any base casing")
.addOutputBus("Mining Pipes, optional, any base casing")
.toolTipFinisher("Gregtech");
- if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
- return tt.getInformation();
- } else {
- return tt.getStructureInformation();
- }
+ return tt;
}
@Override
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java
index a57a237060..8916c9f42a 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java
@@ -1,5 +1,8 @@
package gregtech.common.tileentities.machines.multi;
+import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
@@ -7,10 +10,10 @@ import gregtech.api.interfaces.IChunkLoader;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_DataAccess;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_ChunkManager;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_ModHandler;
@@ -27,18 +30,45 @@ import net.minecraftforge.common.util.ForgeDirection;
import java.util.ArrayList;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.defer;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
import static gregtech.api.enums.GT_Values.W;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL_ACTIVE;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL_ACTIVE_GLOW;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL_GLOW;
import static gregtech.api.enums.Textures.BlockIcons.getCasingTextureForId;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
-public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_MultiBlockBase implements IChunkLoader {
+public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_DrillerBase> implements IChunkLoader {
private static final ItemStack miningPipe = GT_ModHandler.getIC2Item("miningPipe", 0);
private static final ItemStack miningPipeTip = GT_ModHandler.getIC2Item("miningPipeTip", 0);
private static final Block miningPipeBlock = GT_Utility.getBlockFromStack(miningPipe);
private static final Block miningPipeTipBlock = GT_Utility.getBlockFromStack(miningPipeTip);
+ protected static final String STRUCTURE_PIECE_MAIN = "main";
+ protected static final IStructureDefinition<GT_MetaTileEntity_DrillerBase> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_DrillerBase>builder()
+ .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{
+ {" ", " f ", " "},
+ {" ", " f ", " "},
+ {" ", " f ", " "},
+ {" f ", "fcf", " f "},
+ {" f ", "fcf", " f "},
+ {" f ", "fcf", " f "},
+ {"b~b", "bbb", "bbb"},
+ }))
+ .addElement('f', defer(t -> ofBlock(GregTech_API.sBlockMachines, t.frameMeta)))
+ .addElement('c', defer(t -> ofBlock(t.casingBlock, t.casingMeta)))
+ .addElement('b', defer(t -> ofChain(
+ ofBlock(t.casingBlock, t.casingMeta),
+ ofHatchAdder(GT_MetaTileEntity_DrillerBase::addMaintenanceToMachineList, t.casingTextureIndex, 1),
+ ofHatchAdder(GT_MetaTileEntity_DrillerBase::addInputToMachineList, t.casingTextureIndex, 1),
+ ofHatchAdder(GT_MetaTileEntity_DrillerBase::addOutputToMachineList, t.casingTextureIndex, 1),
+ ofHatchAdder(GT_MetaTileEntity_DrillerBase::addEnergyInputToMachineList, t.casingTextureIndex, 1),
+ ofHatchAdder(GT_MetaTileEntity_DrillerBase::addDataAccessToMachineList, t.casingTextureIndex, 1)
+ )))
+ .build();
private Block casingBlock;
private int casingMeta;
@@ -82,12 +112,12 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_Mu
if (aSide == aFacing) {
if (aActive) return new ITexture[]{
getCasingTextureForId(casingTextureIndex),
- TextureFactory.of(OVERLAY_FRONT_ORE_DRILL_ACTIVE),
- TextureFactory.builder().addIcon(OVERLAY_FRONT_ORE_DRILL_ACTIVE_GLOW).glow().build()};
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_ORE_DRILL_ACTIVE).extFacing().build(),
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_ORE_DRILL_ACTIVE_GLOW).extFacing().glow().build()};
return new ITexture[]{
getCasingTextureForId(casingTextureIndex),
- TextureFactory.of(OVERLAY_FRONT_ORE_DRILL),
- TextureFactory.builder().addIcon(OVERLAY_FRONT_ORE_DRILL_GLOW).glow().build()};
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_ORE_DRILL).extFacing().build(),
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_ORE_DRILL_GLOW).extFacing().glow().build()};
}
return new ITexture[]{getCasingTextureForId(casingTextureIndex)};
}
@@ -319,36 +349,19 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_Mu
}
@Override
+ protected IAlignmentLimits getInitialAlignmentLimits() {
+ return (d, r, f) -> d.offsetY == 0 && r.isNotRotated();
+ }
+
+ @Override
+ public IStructureDefinition<GT_MetaTileEntity_DrillerBase> getStructureDefinition() {
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
updateCoordinates();
- //check base layer
- for (int xOff = -1 + back.offsetX; xOff <= 1 + back.offsetX; xOff++) {
- for (int zOff = -1 + back.offsetZ; zOff <= 1 + back.offsetZ; zOff++) {
- if (xOff == 0 && zOff == 0) continue;
-
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xOff, 0, zOff);
- if (!checkCasingBlock(xOff, 0, zOff)
- && !addMaintenanceToMachineList(tTileEntity, casingTextureIndex)
- && !addInputToMachineList(tTileEntity, casingTextureIndex)
- && !addOutputToMachineList(tTileEntity, casingTextureIndex)
- && !addEnergyInputToMachineList(tTileEntity, casingTextureIndex)
- && !addDataAccessToMachineList(tTileEntity, casingTextureIndex))
- return false;
- }
- }
- if(!checkHatches()) return false;
- if (GT_Utility.getTier(getMaxInputVoltage()) < getMinTier()) return false;
- //check tower
- for (int yOff = 1; yOff < 4; yOff++) {
- if (!checkCasingBlock(back.offsetX, yOff, back.offsetZ)
- || !checkFrameBlock(back.offsetX + 1, yOff, back.offsetZ)
- || !checkFrameBlock(back.offsetX - 1, yOff, back.offsetZ)
- || !checkFrameBlock(back.offsetX, yOff, back.offsetZ + 1)
- || !checkFrameBlock(back.offsetX, yOff, back.offsetZ - 1)
- || !checkFrameBlock(back.offsetX, yOff + 3, back.offsetZ))
- return false;
- }
- return true;
+ return checkPiece(STRUCTURE_PIECE_MAIN, 1, 6, 0) && checkHatches() && GT_Utility.getTier(getMaxInputVoltage()) >= getMinTier();
}
private void updateCoordinates() {
@@ -370,14 +383,17 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_Mu
return true;
}
+ @Deprecated
protected boolean checkCasingBlock(int xOff, int yOff, int zOff) {
return checkBlockAndMetaOffset(xOff, yOff, zOff, casingBlock, casingMeta);
}
//meta of frame is getTileEntityBaseType; frame should be checked using its drops (possible a high weight operation)
+ @Deprecated
protected boolean checkFrameBlock(int xOff, int yOff, int zOff) {
return checkBlockAndMetaOffset(xOff, yOff, zOff, GregTech_API.sBlockMachines, frameMeta);
}
+ @Deprecated
protected boolean checkBlockAndMetaOffset(int xOff, int yOff, int zOff, Block block, int meta) {
return checkBlockAndMeta(xDrill + xOff, yDrill + yOff, zDrill + zOff, block, meta);
}
@@ -484,4 +500,9 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_Mu
}
@Override
public ChunkCoordIntPair getActiveChunk(){return mCurrentChunk;}
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(STRUCTURE_PIECE_MAIN, stackSize, hintsOnly, 1, 6, 0);
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java
index 010a73f777..22171e6e04 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java
@@ -4,6 +4,7 @@ import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import gregtech.api.GregTech_API;
+import gregtech.api.enums.HeatingCoilLevel;
import gregtech.api.enums.Materials;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.ITexture;
@@ -35,6 +36,7 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAS
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW;
import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages;
+import static gregtech.api.util.GT_StructureUtility.ofCoil;
import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
@@ -55,7 +57,7 @@ public class GT_MetaTileEntity_ElectricBlastFurnace extends GT_MetaTileEntity_Ab
}))
.addElement('t', ofHatchAdderOptional(GT_MetaTileEntity_ElectricBlastFurnace::addOutputHatchToTopList, CASING_INDEX, 1, GregTech_API.sBlockCasings1, CASING_INDEX))
.addElement('m', ofHatchAdder(GT_MetaTileEntity_ElectricBlastFurnace::addMufflerToMachineList, CASING_INDEX, 2))
- .addElement('C', GT_StructureUtility.ofCoil(GT_MetaTileEntity_ElectricBlastFurnace::setCoilLevel, GT_MetaTileEntity_ElectricBlastFurnace::getCoilLevel))
+ .addElement('C', ofCoil(GT_MetaTileEntity_ElectricBlastFurnace::setCoilLevel, GT_MetaTileEntity_ElectricBlastFurnace::getCoilLevel))
.addElement('b', ofHatchAdderOptional(GT_MetaTileEntity_ElectricBlastFurnace::addBottomHatch, CASING_INDEX, 3, GregTech_API.sBlockCasings1, CASING_INDEX))
.build();
@@ -256,7 +258,9 @@ public class GT_MetaTileEntity_ElectricBlastFurnace extends GT_MetaTileEntity_Ab
replaceDeprecatedCoils(aBaseMetaTileEntity);
- setCoilLevel(null);
+ setCoilLevel(HeatingCoilLevel.None);
+
+ mPollutionOutputHatches.clear();
if (!checkPiece(STRUCTURE_PIECE_MAIN, 1, 3, 0))
return false;
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java
index 9ce1de3fec..0579c4871b 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java
@@ -1,44 +1,69 @@
package gregtech.common.tileentities.machines.multi;
+import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import gregtech.api.GregTech_API;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
-import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
-import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
-import org.lwjgl.input.Keyboard;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW;
import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages;
-
-public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBlockBase {
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
+
+public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_HeatExchanger> {
+ private static final int CASING_INDEX = 50;
+ private static final String STRUCTURE_PIECE_MAIN = "main";
+ private static final IStructureDefinition<GT_MetaTileEntity_HeatExchanger> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_HeatExchanger>builder()
+ .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{
+ {"ccc", "cCc", "ccc"},
+ {"ccc", "cPc", "ccc"},
+ {"ccc", "cPc", "ccc"},
+ {"c~c", "cHc", "ccc"},
+ }))
+ .addElement('P', ofBlock(GregTech_API.sBlockCasings2, 14))
+ .addElement('C', ofHatchAdder(GT_MetaTileEntity_HeatExchanger::addColdFluidOutputToMachineList, CASING_INDEX, 2))
+ .addElement('H', ofHatchAdder(GT_MetaTileEntity_HeatExchanger::addHotFluidInputToMachineList, CASING_INDEX, 3))
+ .addElement('c', ofChain(
+ ofHatchAdder(GT_MetaTileEntity_HeatExchanger::addInputToMachineList, CASING_INDEX, 1),
+ ofHatchAdder(GT_MetaTileEntity_HeatExchanger::addOutputToMachineList, CASING_INDEX, 1),
+ ofHatchAdder(GT_MetaTileEntity_HeatExchanger::addMaintenanceToMachineList, CASING_INDEX, 1),
+ ofHatchAdder(GT_MetaTileEntity_HeatExchanger::addEnergyInputToMachineList, CASING_INDEX, 1),
+ onElementPass(GT_MetaTileEntity_HeatExchanger::onCasingAdded, ofBlock(GregTech_API.sBlockCasings4, (byte) 2))
+ ))
+ .build();
public static float penalty_per_config = 0.015f; // penalize 1.5% efficiency per circuitry level (1-25)
- private static boolean controller;
private GT_MetaTileEntity_Hatch_Input mInputHotFluidHatch;
private GT_MetaTileEntity_Hatch_Output mOutputColdFluidHatch;
private boolean superheated = false;
private int superheated_threshold=0;
private float water;
+ private int mCasingAmount;
public GT_MetaTileEntity_HeatExchanger(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -48,7 +73,7 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc
}
@Override
- public String[] getDescription() {
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
tt.addMachineType("Heat Exchanger")
.addInfo("Controller Block for the Large Heat Exchanger")
@@ -68,11 +93,7 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc
.addOutputHatch("Cold fluid, top center")
.addOutputHatch("Steam/SH Steam, any casing")
.toolTipFinisher("Gregtech");
- if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
- return tt.getStructureInformation();
- } else {
- return tt.getInformation();
- }
+ return tt;
}
@Override
@@ -92,15 +113,15 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc
if (aSide == aFacing) {
if (aActive)
return new ITexture[]{
- casingTexturePages[0][50],
- TextureFactory.of(OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE),
- TextureFactory.builder().addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW).glow().build()};
+ casingTexturePages[0][CASING_INDEX],
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE).extFacing().build(),
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW).extFacing().glow().build()};
return new ITexture[]{
- casingTexturePages[0][50],
- TextureFactory.of(OVERLAY_FRONT_HEAT_EXCHANGER),
- TextureFactory.builder().addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_GLOW).glow().build()};
+ casingTexturePages[0][CASING_INDEX],
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_HEAT_EXCHANGER).extFacing().build(),
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_GLOW).extFacing().glow().build()};
}
- return new ITexture[]{casingTexturePages[0][50]};
+ return new ITexture[]{casingTexturePages[0][CASING_INDEX]};
}
@Override
@@ -114,8 +135,8 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc
}
@Override
- public boolean isFacingValid(byte aFacing) {
- return aFacing > 1;
+ protected IAlignmentLimits getInitialAlignmentLimits() {
+ return (d, r, f) -> !r.isUpsideDown();
}
@Override
@@ -208,57 +229,20 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc
}
@Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
-
- int tCasingAmount = 0;
- controller = false;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if ((i != 0) || (j != 0)) {
- for (int k = 0; k <= 3; k++) {
- if (!addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, k, zDir + j), 50) &&
- !addInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, k, zDir + j), 50) &&
- !addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, k, zDir + j), 50) &&
- !ignoreController(aBaseMetaTileEntity.getBlockOffset(xDir + i, k, zDir + j))) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, k, zDir + j) != getCasingBlock()) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, k, zDir + j) != getCasingMeta()) {
- return false;
- }
- tCasingAmount++;
- }
- }
- } else {
- if (!addHotFluidInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j), 50)) {
- return false;
- }
- if (!addColdFluidOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 3, zDir + j), 50)) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != getPipeBlock()) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != getPipeMeta()) {
- return false;
- }
+ public IStructureDefinition<GT_MetaTileEntity_HeatExchanger> getStructureDefinition() {
+ return STRUCTURE_DEFINITION;
+ }
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != getPipeBlock()) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != getPipeMeta()) {
- return false;
- }
- }
- }
- }
- return tCasingAmount >= 20;
+ private void onCasingAdded() {
+ mCasingAmount++;
}
- public boolean ignoreController(Block tTileEntity) {
- return !controller && tTileEntity == GregTech_API.sBlockMachines;
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mOutputColdFluidHatch = null;
+ mInputHotFluidHatch = null;
+ mCasingAmount = 0;
+ return checkPiece(STRUCTURE_PIECE_MAIN, 1, 3, 0) && mCasingAmount >= 20 && mMaintenanceHatches.size() == 1;
}
public boolean addColdFluidOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
@@ -286,26 +270,6 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc
return false;
}
- public Block getCasingBlock() {
- return GregTech_API.sBlockCasings4;
- }
-
- public byte getCasingMeta() {
- return 2;
- }
-
- public byte getCasingTextureIndex() {
- return 50;
- }
-
- public Block getPipeBlock() {
- return GregTech_API.sBlockCasings2;
- }
-
- public byte getPipeMeta() {
- return 14;
- }
-
@Override
public int getMaxEfficiency(ItemStack aStack) {
return 10000;
@@ -351,4 +315,9 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc
StatCollector.translateToLocal("GT5U.LHE.superheated") + " " + StatCollector.translateToLocal("GT5U.LHE.threshold") + ": " + EnumChatFormatting.GREEN + superheated_threshold + EnumChatFormatting.RESET
};
}
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(STRUCTURE_PIECE_MAIN, stackSize, hintsOnly, 1, 3, 0);
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java
index 841a4fb57c..7f409f38f4 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java
@@ -1,5 +1,7 @@
package gregtech.common.tileentities.machines.multi;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import gregtech.GT_Mod;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
@@ -8,7 +10,7 @@ import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_ModHandler;
@@ -20,25 +22,52 @@ import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
-import org.lwjgl.input.Keyboard;
import java.util.ArrayList;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.defer;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
import static gregtech.api.enums.GT_Values.STEAM_PER_WATER;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE_GLOW;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_GLOW;
-
-public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_MultiBlockBase {
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
+
+public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_LargeBoiler> {
+ private static final String STRUCTURE_PIECE_MAIN = "main";
+ private static final IStructureDefinition<GT_MetaTileEntity_LargeBoiler> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_LargeBoiler>builder()
+ .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{
+ {"ccc", "ccc", "ccc"},
+ {"ccc", "cPc", "ccc"},
+ {"ccc", "cPc", "ccc"},
+ {"ccc", "cPc", "ccc"},
+ {"f~f", "fff", "fff"},
+ }))
+ .addElement('P', defer(t -> ofBlock(t.getPipeBlock(), t.getPipeMeta())))
+ .addElement('c', defer(t -> ofChain(
+ ofHatchAdder(GT_MetaTileEntity_LargeBoiler::addOutputToMachineList, t.getCasingTextureIndex(), 2),
+ onElementPass(GT_MetaTileEntity_LargeBoiler::onCasingAdded, ofBlock(t.getCasingBlock(), t.getCasingMeta()))
+ )))
+ .addElement('f', defer(t -> ofChain(
+ ofHatchAdder(GT_MetaTileEntity_LargeBoiler::addMaintenanceToMachineList, t.getCasingTextureIndex(), 1),
+ ofHatchAdder(GT_MetaTileEntity_LargeBoiler::addInputToMachineList, t.getCasingTextureIndex(), 1),
+ ofHatchAdder(GT_MetaTileEntity_LargeBoiler::addMufflerToMachineList, t.getCasingTextureIndex(), 1),
+ onElementPass(GT_MetaTileEntity_LargeBoiler::onFireboxAdded, ofBlock(t.getCasingBlock(), t.getCasingMeta()))
+ )))
+ .build();
private boolean firstRun = true;
private int mSuperEfficencyIncrease = 0;
private int integratedCircuitConfig = 0; //Steam output is reduced by 1000L per config
private int excessWater = 0; //Eliminate rounding errors for water
private int excessFuel = 0; //Eliminate rounding errors for fuels that burn half items
private int excessProjectedEU = 0; //Eliminate rounding errors from throttling the boiler
+ private int mCasingAmount;
+ private int mFireboxAmount;
public GT_MetaTileEntity_LargeBoiler(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -49,7 +78,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_Mu
}
@Override
- public String[] getDescription() {
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
tt.addMachineType("Boiler")
.addInfo("Controller block for the Large " + getCasingMaterial() + " Boiler")
@@ -71,11 +100,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_Mu
.addInputHatch("Water, Any firebox")
.addOutputHatch("Steam, any casing")
.toolTipFinisher("Gregtech");
- if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
- return tt.getStructureInformation();
- } else {
- return tt.getInformation();
- }
+ return tt;
}
public abstract String getCasingMaterial();
@@ -107,12 +132,12 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_Mu
if (aSide == aFacing) {
if (aActive) return new ITexture[]{
BlockIcons.getCasingTextureForId(getCasingTextureIndex()),
- TextureFactory.of(OVERLAY_FRONT_LARGE_BOILER_ACTIVE),
- TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_BOILER_ACTIVE_GLOW).glow().build()};
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_BOILER_ACTIVE).extFacing().build(),
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_BOILER_ACTIVE_GLOW).extFacing().glow().build()};
return new ITexture[]{
BlockIcons.getCasingTextureForId(getCasingTextureIndex()),
- TextureFactory.of(OVERLAY_FRONT_LARGE_BOILER),
- TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_BOILER_GLOW).glow().build()};
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_BOILER).extFacing().build(),
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_BOILER_GLOW).extFacing().glow().build()};
}
return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(getCasingTextureIndex())};
}
@@ -128,11 +153,6 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_Mu
}
@Override
- public boolean isFacingValid(byte aFacing) {
- return aFacing > 1;
- }
-
- @Override
public boolean checkRecipe(ItemStack aStack) {
//Do we have an integrated circuit with a valid configuration?
if (mInventory[1] != null && mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit")) {
@@ -250,64 +270,24 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_Mu
}
@Override
+ public IStructureDefinition<GT_MetaTileEntity_LargeBoiler> getStructureDefinition() {
+ return STRUCTURE_DEFINITION;
+ }
+
+ private void onCasingAdded() {
+ mCasingAmount++;
+ }
+
+ private void onFireboxAdded() {
+ mFireboxAmount++;
+ }
+
+ @Override
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
-
- int tCasingAmount = 0;
- int tFireboxAmount = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if (i != 0 || j != 0) {
- for (int k = 1; k <= 4; k++) {
- if (!addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, k, zDir + j), getCasingTextureIndex())) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, k, zDir + j) != getCasingBlock()) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, k, zDir + j) != getCasingMeta()) {
- return false;
- }
- tCasingAmount++;
- }
- }
- } else {
- for (int k = 1; k <= 3; k++) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, k, zDir + j) != getPipeBlock()) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, k, zDir + j) != getPipeMeta()) {
- return false;
- }
- }
- if (!addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 4, zDir + j), getCasingTextureIndex())) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 4, zDir + j) != getCasingBlock()) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 4, zDir + j) != getCasingMeta()) {
- return false;
- }
- tCasingAmount++;
- }
- }
- }
- }
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if (xDir + i != 0 || zDir + j != 0) {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
- if (!addMaintenanceToMachineList(tTileEntity, getFireboxTextureIndex()) && !addInputToMachineList(tTileEntity, getFireboxTextureIndex()) && !addMufflerToMachineList(tTileEntity, getFireboxTextureIndex())) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != getFireboxBlock()) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != getFireboxMeta()) {
- return false;
- }
- tFireboxAmount++;
- }
- }
- }
- }
- return tCasingAmount >= 24 && tFireboxAmount >= 3;
+ mCasingAmount = 0;
+ mFireboxAmount = 0;
+ return checkPiece(STRUCTURE_PIECE_MAIN, 1, 4, 0) && mCasingAmount >= 24 && mFireboxAmount >= 3 &&
+ mMaintenanceHatches.size() == 1 && !mMufflerHatches.isEmpty();
}
@Override
@@ -347,4 +327,9 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_Mu
this.excessProjectedEU %= adjustedEUt;
return adjustedBurnTime;
}
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(STRUCTURE_PIECE_MAIN, stackSize, hintsOnly, 1, 4, 0);
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java
index c9de809b58..072f54e4af 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java
@@ -1,33 +1,63 @@
package gregtech.common.tileentities.machines.multi;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import gregtech.api.GregTech_API;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
-import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
-import org.lwjgl.input.Keyboard;
import java.util.ArrayList;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_GLOW;
import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages;
-
-public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_MultiBlockBase {
-
- private final int CASING_INDEX = 176;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
+
+public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_LargeChemicalReactor> {
+ private static final int CASING_INDEX = 176;
+ private static final String STRUCTURE_PIECE_MAIN = "main";
+ private static final IStructureDefinition<GT_MetaTileEntity_LargeChemicalReactor> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_LargeChemicalReactor>builder()
+ .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{
+ {"ccc", "cxc", "ccc"},
+ {"c~c", "xPx", "cxc"},
+ {"ccc", "cxc", "ccc"},
+ }))
+ .addElement('P', ofBlock(GregTech_API.sBlockCasings8, 1))
+ .addElement('c', ofChain(
+ ofHatchAdder(GT_MetaTileEntity_LargeChemicalReactor::addInputToMachineList, CASING_INDEX, 1),
+ ofHatchAdder(GT_MetaTileEntity_LargeChemicalReactor::addOutputToMachineList, CASING_INDEX, 1),
+ ofHatchAdder(GT_MetaTileEntity_LargeChemicalReactor::addMaintenanceToMachineList, CASING_INDEX, 1),
+ ofHatchAdder(GT_MetaTileEntity_LargeChemicalReactor::addEnergyInputToMachineList, CASING_INDEX, 1),
+ onElementPass(GT_MetaTileEntity_LargeChemicalReactor::onCasingAdded, ofBlock(GregTech_API.sBlockCasings8, 0))
+ ))
+ .addElement('x', ofChain(
+ ofHatchAdder(GT_MetaTileEntity_LargeChemicalReactor::addInputToMachineList, CASING_INDEX, 1),
+ ofHatchAdder(GT_MetaTileEntity_LargeChemicalReactor::addOutputToMachineList, CASING_INDEX, 1),
+ ofHatchAdder(GT_MetaTileEntity_LargeChemicalReactor::addMaintenanceToMachineList, CASING_INDEX, 1),
+ ofHatchAdder(GT_MetaTileEntity_LargeChemicalReactor::addEnergyInputToMachineList, CASING_INDEX, 1),
+ onElementPass(GT_MetaTileEntity_LargeChemicalReactor::onCoilAdded, ofBlock(GregTech_API.sBlockCasings5, 0)),
+ onElementPass(GT_MetaTileEntity_LargeChemicalReactor::onCasingAdded, ofBlock(GregTech_API.sBlockCasings8, 0))
+ ))
+ .build();
+
+ private int mCasingAmount;
+ private int mCoilAmount;
public GT_MetaTileEntity_LargeChemicalReactor(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -43,7 +73,7 @@ public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_Mu
}
@Override
- public String[] getDescription() {
+ public GT_Multiblock_Tooltip_Builder createTooltip() {
final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
tt.addMachineType("Chemical Reactor")
.addInfo("Controller block for the Large Chemical Reactor")
@@ -63,11 +93,7 @@ public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_Mu
.addOutputHatch("Any casing")
.addStructureInfo("You can have multiple hatches/busses")
.toolTipFinisher("Gregtech");
- if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
- return tt.getStructureInformation();
- } else {
- return tt.getInformation();
- }
+ return tt;
}
@Override
@@ -76,12 +102,12 @@ public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_Mu
if (aSide == aFacing) {
if (aActive) return new ITexture[]{
casingTexturePages[1][48],
- TextureFactory.of(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE),
- TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW).glow().build()};
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE).extFacing().build(),
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW).extFacing().glow().build()};
return new ITexture[]{
casingTexturePages[1][48],
- TextureFactory.of(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR),
- TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_GLOW).glow().build()};
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR).extFacing().build(),
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_GLOW).extFacing().glow().build()};
}
return new ITexture[]{casingTexturePages[1][48]};
}
@@ -162,56 +188,25 @@ public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_Mu
}
@Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- int casingAmount = 0;
- boolean hasHeatingCoil = false;
- // x=width, z=depth, y=height
- for (int x = -1 + xDir; x <= xDir + 1; x++) {
- for (int z = -1 + zDir; z <= zDir + 1; z++) {
- for (int y = -1; y <= 1; y++) {
- if (x == 0 && y == 0 && z == 0) {
- continue;
- }
- IGregTechTileEntity tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(x, y, z);
- Block block = aBaseMetaTileEntity.getBlockOffset(x, y, z);
- int centerCoords = 0;
- if (x == xDir) {
- centerCoords++;
- }
- if (y == 0) {
- centerCoords++;
- }
- if (z == zDir) {
- centerCoords++;
- }
- if (centerCoords == 3) {
- if (block == GregTech_API.sBlockCasings8 && aBaseMetaTileEntity.getMetaIDOffset(x, y, z) == 1) {
- continue;
- } else {
- return false;
- }
- }
- if (centerCoords == 2 && block == GregTech_API.sBlockCasings5 && aBaseMetaTileEntity.getMetaIDOffset(x, y, z) == 0) {
- hasHeatingCoil = true;
- continue;
- }
- if (!addInputToMachineList(tileEntity, CASING_INDEX) && !addOutputToMachineList(tileEntity, CASING_INDEX)
- && !addMaintenanceToMachineList(tileEntity, CASING_INDEX)
- && !addEnergyInputToMachineList(tileEntity, CASING_INDEX)) {
- if (block == GregTech_API.sBlockCasings8 && aBaseMetaTileEntity.getMetaIDOffset(x, y, z) == 0) {
- casingAmount++;
- } else {
- return false;
- }
- }
+ public IStructureDefinition<GT_MetaTileEntity_LargeChemicalReactor> getStructureDefinition() {
+ return STRUCTURE_DEFINITION;
+ }
- }
- }
+ private void onCasingAdded() {
+ mCasingAmount++;
+ }
- }
- return casingAmount >= 8 && hasHeatingCoil && !mEnergyHatches.isEmpty() && !mMaintenanceHatches.isEmpty();
+ private void onCoilAdded() {
+ mCoilAmount++;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mCasingAmount = 0;
+ mCoilAmount = 0;
+ return checkPiece(STRUCTURE_PIECE_MAIN, 1, 1, 0) &&
+ mCasingAmount >= 8 && mCoilAmount == 1 &&
+ !mEnergyHatches.isEmpty() && mMaintenanceHatches.size() == 1;
}
@Override
@@ -234,4 +229,8 @@ public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_Mu
return false;
}
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(STRUCTURE_PIECE_MAIN, stackSize, hintsOnly, 1, 1, 0);
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java
index 88a01dc310..214e0648c2 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java
@@ -33,7 +33,7 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return new ITexture[]{MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? TextureFactory.of(LARGETURBINE_SS_ACTIVE5) : TextureFactory.of(LARGETURBINE_SS5) : casingTexturePages[0][58]};
+ return new ITexture[]{MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? TextureFactory.builder().addIcon(LARGETURBINE_SS_ACTIVE5).extFacing().build() : TextureFactory.builder().addIcon(LARGETURBINE_SS5).extFacing().build() : casingTexturePages[0][58]};
}
@Override
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java
index 6a0074539d..0d22271a34 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java
@@ -38,7 +38,7 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return new ITexture[]{MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? TextureFactory.of(LARGETURBINE_TI_ACTIVE5) : TextureFactory.of(LARGETURBINE_TI5) : casingTexturePages[0][59]};
+ return new ITexture[]{MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? TextureFactory.builder().addIcon(LARGETURBINE_TI_ACTIVE5).extFacing().build() : TextureFactory.builder().addIcon(LARGETURBINE_TI5).extFacing().build() : casingTexturePages[0][59]};
}
@Override
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java
index 094e7c20f9..efc3ecaea3 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java
@@ -40,7 +40,7 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return new ITexture[]{MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? TextureFactory.of(LARGETURBINE_TU_ACTIVE5) : TextureFactory.of(Textures.BlockIcons.LARGETURBINE_TU5) : casingTexturePages[0][60]};
+ return new ITexture[]{MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? TextureFactory.builder().addIcon(LARGETURBINE_TU_ACTIVE5).extFacing().build() : TextureFactory.builder().addIcon(Textures.BlockIcons.LARGETURBINE_TU5).extFacing().build() : casingTexturePages[0][60]};
}
@Override
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java
index 49bffa1e7e..8990ad3324 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java
@@ -41,7 +41,7 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return new ITexture[]{MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? TextureFactory.of(LARGETURBINE_ST_ACTIVE5) : TextureFactory.of(LARGETURBINE_ST5) : casingTexturePages[0][57]};
+ return new ITexture[]{MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? TextureFactory.builder().addIcon(LARGETURBINE_ST_ACTIVE5).extFacing().build() : TextureFactory.builder().addIcon(LARGETURBINE_ST5).extFacing().build() : casingTexturePages[0][57]};
}
@Override
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java
index 58d9a24f80..20ef0fa6e7 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java
@@ -4,6 +4,7 @@ import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import gregtech.api.GregTech_API;
+import gregtech.api.enums.HeatingCoilLevel;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -175,7 +176,7 @@ public class GT_MetaTileEntity_MultiFurnace extends GT_MetaTileEntity_AbstractMu
replaceDeprecatedCoils(aBaseMetaTileEntity);
- setCoilLevel(null);
+ setCoilLevel(HeatingCoilLevel.None);
if (!checkPiece(STRUCTURE_PIECE_MAIN, 1, 2, 0))
return false;
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java
index 0a0088246b..e4f96db248 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java
@@ -1,43 +1,73 @@
package gregtech.common.tileentities.machines.multi;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import gregtech.api.GregTech_API;
import gregtech.api.enums.HeatingCoilLevel;
import gregtech.api.enums.Materials;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
-import gregtech.api.interfaces.IHeatingCoil;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
-import org.apache.commons.lang3.mutable.MutableInt;
-import org.lwjgl.input.Keyboard;
import java.util.ArrayList;
-import java.util.BitSet;
+import java.util.List;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_GLOW;
import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages;
+import static gregtech.api.util.GT_StructureUtility.ofCoil;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
-public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_MultiBlockBase {
- private ForgeDirection orientation;
- private int controllerX, controllerZ;
-
+public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_OilCracker> {
private static final byte CASING_INDEX = 49;
+ private static final String STRUCTURE_PIECE_MAIN = "main";
+ private static final IStructureDefinition<GT_MetaTileEntity_OilCracker> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_OilCracker>builder()
+ .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{
+ {"lcmcr", "lcmcr", "lcmcr"},
+ {"lc~cr", "l---r", "lcmcr"},
+ {"lcmcr", "lcmcr", "lcmcr"},
+ }))
+ .addElement('c', ofCoil(GT_MetaTileEntity_OilCracker::setCoilLevel, GT_MetaTileEntity_OilCracker::getCoilLevel))
+ .addElement('l', ofChain(
+ ofHatchAdder(GT_MetaTileEntity_OilCracker::addLeftHatchToMachineList, CASING_INDEX, 2),
+ onElementPass(GT_MetaTileEntity_OilCracker::onCasingAdded, ofBlock(GregTech_API.sBlockCasings4, 2))
+ ))
+ .addElement('r', ofChain(
+ ofHatchAdder(GT_MetaTileEntity_OilCracker::addRightHatchToMachineList, CASING_INDEX, 2),
+ onElementPass(GT_MetaTileEntity_OilCracker::onCasingAdded, ofBlock(GregTech_API.sBlockCasings4, 3))
+ ))
+ .addElement('m', ofChain(
+ ofHatchAdder(GT_MetaTileEntity_OilCracker::addMiddleInputToMachineList, CASING_INDEX, 1),
+ ofHatchAdder(GT_MetaTileEntity_OilCracker::addEnergyInputToMachineList, CASING_INDEX, 1),
+ ofHatchAdder(GT_MetaTileEntity_OilCracker::addMaintenanceToMachineList, CASING_INDEX, 1),
+ onElementPass(GT_MetaTileEntity_OilCracker::onCasingAdded, ofBlock(GregTech_API.sBlockCasings4, 1))
+ ))
+ .build();
private HeatingCoilLevel heatLevel;
+ protected final List<GT_MetaTileEntity_Hatch_Input> mMiddleInputHatches = new ArrayList<>();
+ // 0 -> left, 1 -> right, any other -> not found
+ protected int mInputOnSide;
+ protected int mOutputOnSide;
+ protected int mCasingAmount;
public GT_MetaTileEntity_OilCracker(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -48,7 +78,7 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_MultiBlockBa
}
@Override
- public String[] getDescription() {
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
tt.addMachineType("Cracker")
.addInfo("Controller block for the Oil Cracking Unit")
@@ -68,19 +98,18 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_MultiBlockBa
.addOutputHatch("Any left/right side casing")
.addStructureInfo("Input/Output Hatches must be on opposite sides!")
.toolTipFinisher("Gregtech");
- if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) return tt.getInformation();
- return tt.getStructureInformation();
+ return tt;
}
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if (aSide == aFacing) {
if (aActive) return new ITexture[]{casingTexturePages[0][CASING_INDEX],
- TextureFactory.of(OVERLAY_FRONT_OIL_CRACKER_ACTIVE),
- TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW).glow().build()};
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE).extFacing().build(),
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW).extFacing().glow().build()};
return new ITexture[]{casingTexturePages[0][CASING_INDEX],
- TextureFactory.of(OVERLAY_FRONT_OIL_CRACKER),
- TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_GLOW).glow().build()};
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER).extFacing().build(),
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_GLOW).extFacing().glow().build()};
}
return new ITexture[]{casingTexturePages[0][CASING_INDEX]};
}
@@ -129,141 +158,97 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_MultiBlockBa
return false;
}
- private boolean coilsNotPresent(IGregTechTileEntity aBaseMetaTileEntity, int x , int y, int z) {
-
- Block coil = aBaseMetaTileEntity.getBlockOffset(x, y, z);
-
- if (!(coil instanceof IHeatingCoil))
- return true;
-
- IHeatingCoil heatingCoil = (IHeatingCoil) coil;
- byte meta = aBaseMetaTileEntity.getMetaIDOffset(x, y, z);
- HeatingCoilLevel heatLevel = heatingCoil.getCoilHeat(meta);
- if (heatLevel == HeatingCoilLevel.None)
- return true;
-
- if (this.heatLevel == HeatingCoilLevel.None)
- this.heatLevel = heatLevel;
-
- return this.heatLevel != heatLevel;
+ @Override
+ public IStructureDefinition<GT_MetaTileEntity_OilCracker> getStructureDefinition() {
+ return STRUCTURE_DEFINITION;
}
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- this.heatLevel = HeatingCoilLevel.None;
- this.orientation = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing());
- this.controllerX = aBaseMetaTileEntity.getXCoord();
- this.controllerZ = aBaseMetaTileEntity.getZCoord();
- int xDir = this.orientation.offsetX;
- int zDir = this.orientation.offsetZ;
- MutableInt amount = new MutableInt(0);
- replaceDeprecatedCoils(aBaseMetaTileEntity);
- BitSet flags = new BitSet(4);
-
- for (int depth = -1; depth < 2; depth++)
- for (int height = -1; height < 2; height++)
- for (int slice = -2; slice < 3; slice++)
- if (xDir == 0) {
- if (isStructureBroken(xDir, zDir, slice, height, depth, aBaseMetaTileEntity, amount, flags))
- return false;
- } else {
- if (isStructureBroken(xDir, zDir, depth, height, slice, aBaseMetaTileEntity, amount, flags))
- return false;
- }
-
- if(checkInputOutputBroken(flags))
- return false;
+ public HeatingCoilLevel getCoilLevel() {
+ return heatLevel;
+ }
- return amount.intValue() >= 18;
+ public void setCoilLevel(HeatingCoilLevel aCoilLevel) {
+ heatLevel = aCoilLevel;
}
- private boolean checkInputOutputBroken(BitSet flags){
- if (flags.get(0) && flags.get(2)) //input and output on side 1
- return true;
- if (flags.get(1) && flags.get(3)) //input and output on side 2
- return true;
- if (flags.get(1) && flags.get(2)) //input on both sides
- return true;
- return flags.get(2) && flags.get(3); //output on both sides
+ private boolean addMiddleInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
+ GT_MetaTileEntity_Hatch_Input tHatch = (GT_MetaTileEntity_Hatch_Input) aMetaTileEntity;
+ tHatch.updateTexture(aBaseCasingIndex);
+ tHatch.mRecipeMap = getRecipeMap();
+ return mMiddleInputHatches.add(tHatch);
+ }
+ return false;
}
- private boolean isStructureBroken(
- int xDir,
- int zDir,
- int a,
- int b,
- int c,
- IGregTechTileEntity aBaseMetaTileEntity,
- MutableInt amount,
- BitSet flags) {
- if (b == 0 && c == 0 && (a == -1 || a == 0 || a == 1))
- return false;
- if (a == 1 || a == -1) {
- return coilsNotPresent(aBaseMetaTileEntity, xDir + a, b, c + zDir);
+ private boolean addLeftHatchToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
+ if (mInputOnSide == 1)
+ return false;
+ mInputOnSide = 0;
+ mOutputOnSide = 1;
+ GT_MetaTileEntity_Hatch_Input tHatch = (GT_MetaTileEntity_Hatch_Input) aMetaTileEntity;
+ tHatch.updateTexture(aBaseCasingIndex);
+ tHatch.mRecipeMap = getRecipeMap();
+ return mInputHatches.add(tHatch);
}
- else if (a == 2 || a == -2) {
- return checkEndsBroken(xDir, zDir, a, b, c, aBaseMetaTileEntity, amount, flags);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) {
+ if (mOutputOnSide == 1)
+ return false;
+ mInputOnSide = 1;
+ mOutputOnSide = 0;
+ GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aMetaTileEntity;
+ tHatch.updateTexture(aBaseCasingIndex);
+ return mOutputHatches.add(tHatch);
}
- else if (a == 0)
- return checkMiddleBroken(xDir, zDir, a, b, c, aBaseMetaTileEntity, amount);
-
return false;
}
- private boolean checkEndsBroken(
- int xDir,
- int zDir,
- int a,
- int b,
- int c,
- IGregTechTileEntity aBaseMetaTileEntity,
- MutableInt amount,
- BitSet flags
- ){
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + c, b, a + zDir);
- if (addInputToMachineList(tTileEntity, CASING_INDEX))
- if (a == -2)
- flags.set(0); //input on side 1
- else
- flags.set(1); //input on side 2
- else if (addOutputToMachineList(tTileEntity, CASING_INDEX))
- if (a == -2)
- flags.set(2); //output on side 1
- else
- flags.set(3); //output on side 2
- else if (!addEnergyInputToMachineList(tTileEntity, CASING_INDEX))
- if (!addMaintenanceToMachineList(tTileEntity, CASING_INDEX)) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + c, b, a + zDir) != GregTech_API.sBlockCasings4)
- return true;
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + c, b, a + zDir) != 1)
- return true;
- amount.increment();
- }
+ private boolean addRightHatchToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
+ if (mInputOnSide == 0)
+ return false;
+ mInputOnSide = 1;
+ mOutputOnSide = 0;
+ GT_MetaTileEntity_Hatch_Input tHatch = (GT_MetaTileEntity_Hatch_Input) aMetaTileEntity;
+ tHatch.updateTexture(aBaseCasingIndex);
+ tHatch.mRecipeMap = getRecipeMap();
+ return mInputHatches.add(tHatch);
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) {
+ if (mOutputOnSide == 0)
+ return false;
+ mInputOnSide = 0;
+ mOutputOnSide = 1;
+ GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aMetaTileEntity;
+ tHatch.updateTexture(aBaseCasingIndex);
+ return mOutputHatches.add(tHatch);
+ }
return false;
}
- private boolean checkMiddleBroken( int xDir,
- int zDir,
- int a,
- int b,
- int c,
- IGregTechTileEntity aBaseMetaTileEntity,
- MutableInt amount){
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + c, b, a + zDir);
- if (addMaintenanceToMachineList(tTileEntity, CASING_INDEX))
- return false;
- if (addInputToMachineList(tTileEntity, CASING_INDEX))
- return false;
- if (addEnergyInputToMachineList(tTileEntity, CASING_INDEX))
- return false;
- if ((xDir + c) == 0 && b == 0 && (a + zDir) == 0)
- return false;
- if (aBaseMetaTileEntity.getBlockOffset(xDir + c, b, a + zDir) != GregTech_API.sBlockCasings4)
- return true;
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + c, b, a + zDir) != 1)
- return true;
- amount.increment();
- return false;
+ private void onCasingAdded() {
+ mCasingAmount++;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ setCoilLevel(HeatingCoilLevel.None);
+ mCasingAmount = 0;
+ mMiddleInputHatches.clear();
+ mInputOnSide = -1;
+ mOutputOnSide = -1;
+ replaceDeprecatedCoils(aBaseMetaTileEntity);
+ return checkPiece(STRUCTURE_PIECE_MAIN, 2, 1, 0) && mInputOnSide != -1 && mOutputOnSide != -1 && mCasingAmount >= 18;
}
@Override
@@ -332,20 +317,23 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_MultiBlockBa
for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) {
tHatch.mRecipeMap = getRecipeMap();
if (isValidMetaTileEntity(tHatch) && tHatch.getFillableStack() != null) {
+ rList.add(tHatch.getFillableStack());
+ }
+ }
+ for (GT_MetaTileEntity_Hatch_Input tHatch : mMiddleInputHatches) {
+ tHatch.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tHatch) && tHatch.getFillableStack() != null) {
FluidStack tStack = tHatch.getFillableStack();
if (tStack.isFluidEqual(GT_ModHandler.getSteam(1000)) || tStack.isFluidEqual(Materials.Hydrogen.getGas(1000))) {
- if (isHatchInMiddleRing(tHatch))
- rList.add(tStack);
- } else if (!isHatchInMiddleRing(tHatch))
rList.add(tStack);
+ }
}
}
return rList;
}
- private boolean isHatchInMiddleRing(GT_MetaTileEntity_Hatch_Input inputHatch){
- if (orientation == ForgeDirection.NORTH || orientation == ForgeDirection.SOUTH)
- return inputHatch.getBaseMetaTileEntity().getXCoord() == this.controllerX;
- return inputHatch.getBaseMetaTileEntity().getZCoord() == this.controllerZ;
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(STRUCTURE_PIECE_MAIN, stackSize, hintsOnly, 2, 1, 0);
}
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill1.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill1.java
index 73d8131fed..610c21e89b 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill1.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill1.java
@@ -4,6 +4,7 @@ import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
public class GT_MetaTileEntity_OilDrill1 extends GT_MetaTileEntity_OilDrillBase {
public GT_MetaTileEntity_OilDrill1(int aID, String aName, String aNameRegional) {
@@ -15,8 +16,8 @@ public class GT_MetaTileEntity_OilDrill1 extends GT_MetaTileEntity_OilDrillBase
}
@Override
- public String[] getDescription() {
- return getDescriptionInternal("I");
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ return createTooltip("I");
}
@Override
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill2.java
index 9d36b340d3..eab1ebf614 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill2.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill2.java
@@ -4,6 +4,7 @@ import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
public class GT_MetaTileEntity_OilDrill2 extends GT_MetaTileEntity_OilDrillBase {
public GT_MetaTileEntity_OilDrill2(int aID, String aName, String aNameRegional) {
@@ -15,8 +16,8 @@ public class GT_MetaTileEntity_OilDrill2 extends GT_MetaTileEntity_OilDrillBase
}
@Override
- public String[] getDescription() {
- return getDescriptionInternal("II");
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ return createTooltip("II");
}
@Override
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill3.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill3.java
index 8ebc658406..738f60544b 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill3.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill3.java
@@ -4,6 +4,7 @@ import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
public class GT_MetaTileEntity_OilDrill3 extends GT_MetaTileEntity_OilDrillBase {
public GT_MetaTileEntity_OilDrill3(int aID, String aName, String aNameRegional) {
@@ -15,8 +16,8 @@ public class GT_MetaTileEntity_OilDrill3 extends GT_MetaTileEntity_OilDrillBase
}
@Override
- public String[] getDescription() {
- return getDescriptionInternal("III");
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ return createTooltip("III");
}
@Override
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java
index 44fb734534..554e5dfd63 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java
@@ -19,7 +19,6 @@ import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.chunk.Chunk;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
-import org.lwjgl.input.Keyboard;
import java.util.ArrayList;
@@ -52,12 +51,12 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D
if (aSide == aFacing) {
if (aActive) return new ITexture[]{
getCasingTextureForId(casingTextureIndex),
- TextureFactory.of(OVERLAY_FRONT_OIL_DRILL_ACTIVE),
- TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_DRILL_ACTIVE_GLOW).glow().build()};
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_DRILL_ACTIVE).extFacing().build(),
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_DRILL_ACTIVE_GLOW).extFacing().glow().build()};
return new ITexture[]{
getCasingTextureForId(casingTextureIndex),
- TextureFactory.of(OVERLAY_FRONT_OIL_DRILL),
- TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_DRILL_GLOW).glow().build()};
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_DRILL).extFacing().build(),
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_DRILL_GLOW).extFacing().glow().build()};
}
return new ITexture[]{getCasingTextureForId(casingTextureIndex)};
}
@@ -77,7 +76,7 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D
chunkRangeConfig = aNBT.getInteger("chunkRangeConfig");
}
- protected String[] getDescriptionInternal(String tierSuffix) {
+ protected GT_Multiblock_Tooltip_Builder createTooltip(String tierSuffix) {
String casings = getCasingBlockItem().get(0).getDisplayName();
final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
@@ -98,11 +97,7 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D
.addInputBus("Mining Pipes or Circuits, optional, any base casing")
.addOutputHatch("Any base casing")
.toolTipFinisher("Gregtech");
- if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
- return tt.getStructureInformation();
- } else {
- return tt.getInformation();
- }
+ return tt;
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java
index d23ce2edd0..ac3e40c5f5 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java
@@ -4,6 +4,7 @@ import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
public class GT_MetaTileEntity_OreDrillingPlant1 extends GT_MetaTileEntity_OreDrillingPlantBase {
public GT_MetaTileEntity_OreDrillingPlant1(int aID, String aName, String aNameRegional) {
@@ -17,8 +18,8 @@ public class GT_MetaTileEntity_OreDrillingPlant1 extends GT_MetaTileEntity_OreDr
}
@Override
- public String[] getDescription() {
- return getDescriptionInternal("I");
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ return createTooltip("I");
}
@Override
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant2.java
index db7c4cd9e7..bf9c628911 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant2.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant2.java
@@ -4,6 +4,7 @@ import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
public class GT_MetaTileEntity_OreDrillingPlant2 extends GT_MetaTileEntity_OreDrillingPlantBase {
public GT_MetaTileEntity_OreDrillingPlant2(int aID, String aName, String aNameRegional) {
@@ -17,8 +18,8 @@ public class GT_MetaTileEntity_OreDrillingPlant2 extends GT_MetaTileEntity_OreDr
}
@Override
- public String[] getDescription() {
- return getDescriptionInternal("II");
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ return createTooltip("II");
}
@Override
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant3.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant3.java
index b7053a8ebd..411bbef3a7 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant3.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant3.java
@@ -4,6 +4,7 @@ import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
public class GT_MetaTileEntity_OreDrillingPlant3 extends GT_MetaTileEntity_OreDrillingPlantBase {
public GT_MetaTileEntity_OreDrillingPlant3(int aID, String aName, String aNameRegional) {
@@ -17,8 +18,8 @@ public class GT_MetaTileEntity_OreDrillingPlant3 extends GT_MetaTileEntity_OreDr
}
@Override
- public String[] getDescription() {
- return getDescriptionInternal("III");
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ return createTooltip("III");
}
@Override
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant4.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant4.java
index db86b963ca..d7daea327c 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant4.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant4.java
@@ -4,6 +4,7 @@ import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
public class GT_MetaTileEntity_OreDrillingPlant4 extends GT_MetaTileEntity_OreDrillingPlantBase {
public GT_MetaTileEntity_OreDrillingPlant4(int aID, String aName, String aNameRegional) {
@@ -17,8 +18,8 @@ public class GT_MetaTileEntity_OreDrillingPlant4 extends GT_MetaTileEntity_OreDr
}
@Override
- public String[] getDescription() {
- return getDescriptionInternal("IV");
+ protected GT_Multiblock_Tooltip_Builder createTooltip() {
+ return createTooltip("IV");
}
@Override
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java
index 224f1de557..5b4444cec3 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java
@@ -332,7 +332,7 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile
protected abstract int getBaseProgressTime();
- protected String[] getDescriptionInternal(String tierSuffix) {
+ protected GT_Multiblock_Tooltip_Builder createTooltip(String tierSuffix) {
String casings = getCasingBlockItem().get(0).getDisplayName();
final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
@@ -356,11 +356,7 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile
.addInputHatch("Drilling Fluid, any base casing")
.addOutputBus("Any base casing")
.toolTipFinisher("Gregtech");
- if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
- return tt.getInformation();
- } else {
- return tt.getStructureInformation();
- }
+ return tt;
}
@Override