aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/goodgenerator/blocks/tileEntity/UniversalChemicalFuelEngine.java
diff options
context:
space:
mode:
authorJason Mitchell <mitchej@gmail.com>2023-01-28 18:39:10 -0800
committerJason Mitchell <mitchej@gmail.com>2023-01-28 18:39:10 -0800
commitb846f1dc3a502d157ecf871e2a4a1ff49915f871 (patch)
tree4a86feaaddd8d00d32f7cc093736d02be92bf358 /src/main/java/goodgenerator/blocks/tileEntity/UniversalChemicalFuelEngine.java
parent3194d4cbab82e336ecb82b5a2dc80153ed9b1b81 (diff)
downloadGT5-Unofficial-b846f1dc3a502d157ecf871e2a4a1ff49915f871.tar.gz
GT5-Unofficial-b846f1dc3a502d157ecf871e2a4a1ff49915f871.tar.bz2
GT5-Unofficial-b846f1dc3a502d157ecf871e2a4a1ff49915f871.zip
[ci skip] spotlessApply with the new settings
Diffstat (limited to 'src/main/java/goodgenerator/blocks/tileEntity/UniversalChemicalFuelEngine.java')
-rw-r--r--src/main/java/goodgenerator/blocks/tileEntity/UniversalChemicalFuelEngine.java143
1 files changed, 60 insertions, 83 deletions
diff --git a/src/main/java/goodgenerator/blocks/tileEntity/UniversalChemicalFuelEngine.java b/src/main/java/goodgenerator/blocks/tileEntity/UniversalChemicalFuelEngine.java
index a5b3dd4158..ff2c4266ec 100644
--- a/src/main/java/goodgenerator/blocks/tileEntity/UniversalChemicalFuelEngine.java
+++ b/src/main/java/goodgenerator/blocks/tileEntity/UniversalChemicalFuelEngine.java
@@ -6,12 +6,23 @@ import static goodgenerator.util.DescTextLocalization.BLUE_PRINT_INFO;
import static gregtech.api.enums.Textures.BlockIcons.*;
import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
+
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti;
import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+
import goodgenerator.blocks.tileEntity.base.GT_MetaTileEntity_TooltipMultiBlockBase_EM;
import goodgenerator.crossmod.LoadedList;
import goodgenerator.loader.Loaders;
@@ -27,14 +38,6 @@ import gregtech.api.util.GTPP_Recipe;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraftforge.fluids.FluidRegistry;
-import net.minecraftforge.fluids.FluidStack;
public class UniversalChemicalFuelEngine extends GT_MetaTileEntity_TooltipMultiBlockBase_EM
implements IConstructable, ISurvivalConstructable {
@@ -115,47 +118,38 @@ public class UniversalChemicalFuelEngine extends GT_MetaTileEntity_TooltipMultiB
@Override
public IStructureDefinition<UniversalChemicalFuelEngine> getStructure_EM() {
if (multiDefinition == null) {
- multiDefinition = StructureDefinition.<UniversalChemicalFuelEngine>builder()
- .addShape(mName, transpose(new String[][] {
- {"TTTTT", "TTMMT", "TTMMT", "TTMMT", "TTMMT", "TTMMT", "TTMMT", "TTMMT", "TTTTT"},
- {"TTTTT", "SPCCI-", "SPCCI-", "SPCCI-", "SPCCI-", "SPCCI-", "SPCCI-", "SPCCI-", "TTTTT"},
- {"TT~TT", "SPGGI-", "SPGGI-", "SPGGI-", "SPGGI-", "SPGGI-", "SPGGI-", "SPGGI-", "TTETT"},
- {"TTWTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT"}
- }))
+ multiDefinition = StructureDefinition.<UniversalChemicalFuelEngine>builder().addShape(
+ mName,
+ transpose(
+ new String[][] {
+ { "TTTTT", "TTMMT", "TTMMT", "TTMMT", "TTMMT", "TTMMT", "TTMMT", "TTMMT", "TTTTT" },
+ { "TTTTT", "SPCCI-", "SPCCI-", "SPCCI-", "SPCCI-", "SPCCI-", "SPCCI-", "SPCCI-",
+ "TTTTT" },
+ { "TT~TT", "SPGGI-", "SPGGI-", "SPGGI-", "SPGGI-", "SPGGI-", "SPGGI-", "SPGGI-",
+ "TTETT" },
+ { "TTWTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT",
+ "TTTTT" } }))
.addElement('T', ofBlock(GregTech_API.sBlockCasings4, 2))
.addElement(
'W',
- buildHatchAdder(UniversalChemicalFuelEngine.class)
- .atLeast(GT_HatchElement.Maintenance)
- .casingIndex(50)
- .dot(1)
- .build())
+ buildHatchAdder(UniversalChemicalFuelEngine.class).atLeast(GT_HatchElement.Maintenance)
+ .casingIndex(50).dot(1).build())
.addElement(
'M',
- buildHatchAdder(UniversalChemicalFuelEngine.class)
- .atLeast(GT_HatchElement.Muffler)
- .casingIndex(50)
- .dot(2)
- .build())
+ buildHatchAdder(UniversalChemicalFuelEngine.class).atLeast(GT_HatchElement.Muffler)
+ .casingIndex(50).dot(2).build())
.addElement(
'S',
- buildHatchAdder(UniversalChemicalFuelEngine.class)
- .atLeast(GT_HatchElement.InputHatch)
- .casingIndex(50)
- .dot(3)
- .build())
+ buildHatchAdder(UniversalChemicalFuelEngine.class).atLeast(GT_HatchElement.InputHatch)
+ .casingIndex(50).dot(3).build())
.addElement(
'E',
- buildHatchAdder(UniversalChemicalFuelEngine.class)
- .atLeast(GT_HatchElement.Dynamo)
- .casingIndex(50)
- .dot(4)
- .build())
+ buildHatchAdder(UniversalChemicalFuelEngine.class).atLeast(GT_HatchElement.Dynamo)
+ .casingIndex(50).dot(4).build())
.addElement('P', ofBlock(GregTech_API.sBlockCasings2, 14))
.addElement('C', ofBlock(Loaders.titaniumPlatedCylinder, 0))
.addElement('G', ofBlock(GregTech_API.sBlockCasings2, 4))
- .addElement('I', ofBlock(GregTech_API.sBlockCasings4, 13))
- .build();
+ .addElement('I', ofBlock(GregTech_API.sBlockCasings4, 13)).build();
}
return multiDefinition;
}
@@ -188,26 +182,23 @@ public class UniversalChemicalFuelEngine extends GT_MetaTileEntity_TooltipMultiB
@Override
protected GT_Multiblock_Tooltip_Builder createTooltip() {
final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType("Chemical Engine")
- .addInfo("Controller block for the Chemical Engine")
- .addInfo("BURNING BURNING BURNING")
- .addInfo("Use combustible liquid to generate power.")
+ tt.addMachineType("Chemical Engine").addInfo("Controller block for the Chemical Engine")
+ .addInfo("BURNING BURNING BURNING").addInfo("Use combustible liquid to generate power.")
.addInfo("You need to supply Combustion Promoter to keep it running.")
.addInfo("This engine will consume all the fuel and combustion promoter in the hatch every second.")
.addInfo("The efficiency is determined by the proportion of Combustion Promoter to fuel.")
.addInfo("The proportion is bigger, and the efficiency will be higher.")
.addInfo("It creates sqrt(Current Output Power) pollution every second")
- .addInfo("If you forget to supply Combustion Promoter, this engine will swallow all the fuel "
- + EnumChatFormatting.YELLOW + "without outputting energy" + EnumChatFormatting.GRAY + ".")
- .addInfo("The efficiency is up to 150%.")
- .addInfo("The structure is too complex!")
- .addInfo(BLUE_PRINT_INFO)
- .addSeparator()
- .beginStructureBlock(5, 4, 9, false)
- .addMaintenanceHatch("Hint block with dot 1")
- .addMufflerHatch("Hint block with dot 2")
- .addInputHatch("Hint block with dot 3")
- .addDynamoHatch("Hint block with dot 4")
+ .addInfo(
+ "If you forget to supply Combustion Promoter, this engine will swallow all the fuel "
+ + EnumChatFormatting.YELLOW
+ + "without outputting energy"
+ + EnumChatFormatting.GRAY
+ + ".")
+ .addInfo("The efficiency is up to 150%.").addInfo("The structure is too complex!")
+ .addInfo(BLUE_PRINT_INFO).addSeparator().beginStructureBlock(5, 4, 9, false)
+ .addMaintenanceHatch("Hint block with dot 1").addMufflerHatch("Hint block with dot 2")
+ .addInputHatch("Hint block with dot 3").addDynamoHatch("Hint block with dot 4")
.toolTipFinisher("Good Generator");
return tt;
}
@@ -292,9 +283,14 @@ public class UniversalChemicalFuelEngine extends GT_MetaTileEntity_TooltipMultiB
public String[] getInfoData() {
String[] info = super.getInfoData();
info[4] = "Probably makes: " + EnumChatFormatting.RED + this.lEUt + EnumChatFormatting.RESET + " EU/t";
- info[6] = "Problems: " + EnumChatFormatting.RED + (this.getIdealStatus() - this.getRepairStatus())
- + EnumChatFormatting.RESET + " Efficiency: " + EnumChatFormatting.YELLOW + tEff / 100D
- + EnumChatFormatting.RESET + " %";
+ info[6] = "Problems: " + EnumChatFormatting.RED
+ + (this.getIdealStatus() - this.getRepairStatus())
+ + EnumChatFormatting.RESET
+ + " Efficiency: "
+ + EnumChatFormatting.YELLOW
+ + tEff / 100D
+ + EnumChatFormatting.RESET
+ + " %";
return info;
}
@@ -303,15 +299,13 @@ public class UniversalChemicalFuelEngine extends GT_MetaTileEntity_TooltipMultiB
if (!mDynamoHatches.isEmpty()) {
GT_MetaTileEntity_Hatch_Dynamo tHatch = mDynamoHatches.get(0);
if (tHatch.maxEUOutput() * tHatch.maxAmperesOut() >= exEU) {
- tHatch.setEUVar(Math.min(
- tHatch.maxEUStore(), tHatch.getBaseMetaTileEntity().getStoredEU() + exEU));
+ tHatch.setEUVar(Math.min(tHatch.maxEUStore(), tHatch.getBaseMetaTileEntity().getStoredEU() + exEU));
} else tHatch.doExplosion(tHatch.maxEUOutput());
}
if (!eDynamoMulti.isEmpty()) {
GT_MetaTileEntity_Hatch_DynamoMulti tHatch = eDynamoMulti.get(0);
if (tHatch.maxEUOutput() * tHatch.maxAmperesOut() >= exEU) {
- tHatch.setEUVar(Math.min(
- tHatch.maxEUStore(), tHatch.getBaseMetaTileEntity().getStoredEU() + exEU));
+ tHatch.setEUVar(Math.min(tHatch.maxEUStore(), tHatch.getBaseMetaTileEntity().getStoredEU() + exEU));
} else tHatch.doExplosion(tHatch.maxEUOutput());
}
}
@@ -357,33 +351,16 @@ public class UniversalChemicalFuelEngine extends GT_MetaTileEntity_TooltipMultiB
}
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- boolean aActive,
- boolean aRedstone) {
+ 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][50],
+ if (aActive) return new ITexture[] { casingTexturePages[0][50],
TextureFactory.of(OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE),
- TextureFactory.builder()
- .addIcon(OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE_GLOW)
- .glow()
- .build()
- };
- return new ITexture[] {
- casingTexturePages[0][50],
- TextureFactory.of(OVERLAY_FRONT_DIESEL_ENGINE),
- TextureFactory.builder()
- .addIcon(OVERLAY_FRONT_DIESEL_ENGINE_GLOW)
- .glow()
- .build()
- };
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE_GLOW).glow().build() };
+ return new ITexture[] { casingTexturePages[0][50], TextureFactory.of(OVERLAY_FRONT_DIESEL_ENGINE),
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_DIESEL_ENGINE_GLOW).glow().build() };
}
- return new ITexture[] {casingTexturePages[0][50]};
+ return new ITexture[] { casingTexturePages[0][50] };
}
@Override