aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/goodgenerator/blocks/tileEntity/base
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/goodgenerator/blocks/tileEntity/base')
-rw-r--r--src/main/java/goodgenerator/blocks/tileEntity/base/GT_MetaTileEntity_LargeTurbineBase.java219
-rw-r--r--src/main/java/goodgenerator/blocks/tileEntity/base/GT_MetaTileEntity_TooltipMultiBlockBase_EM.java2
-rw-r--r--src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java419
-rw-r--r--src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputerPP.java7
4 files changed, 332 insertions, 315 deletions
diff --git a/src/main/java/goodgenerator/blocks/tileEntity/base/GT_MetaTileEntity_LargeTurbineBase.java b/src/main/java/goodgenerator/blocks/tileEntity/base/GT_MetaTileEntity_LargeTurbineBase.java
index 0ccd83d059..3df71aa25a 100644
--- a/src/main/java/goodgenerator/blocks/tileEntity/base/GT_MetaTileEntity_LargeTurbineBase.java
+++ b/src/main/java/goodgenerator/blocks/tileEntity/base/GT_MetaTileEntity_LargeTurbineBase.java
@@ -38,7 +38,7 @@ import gregtech.api.util.GT_Utility;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
public abstract class GT_MetaTileEntity_LargeTurbineBase extends
- GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_LargeTurbineBase> implements ISurvivalConstructable {
+ GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_LargeTurbineBase> implements ISurvivalConstructable {
private static final String STRUCTURE_PIECE_MAIN = "main";
private static final ClassValue<IStructureDefinition<GT_MetaTileEntity_LargeTurbineBase>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GT_MetaTileEntity_LargeTurbineBase>>() {
@@ -46,32 +46,32 @@ public abstract class GT_MetaTileEntity_LargeTurbineBase extends
@Override
protected IStructureDefinition<GT_MetaTileEntity_LargeTurbineBase> computeValue(Class<?> type) {
return StructureDefinition.<GT_MetaTileEntity_LargeTurbineBase>builder()
- .addShape(
- STRUCTURE_PIECE_MAIN,
- transpose(
- new String[][] { { " ", "xxxxx", "xxxxx", "xxxxx", "xxxxx", },
- { " --- ", "xcccx", "xchcx", "xchcx", "xcccx", },
- { " --- ", "xc~cx", "xh-hx", "xh-hx", "xcdcx", },
- { " --- ", "xcccx", "xchcx", "xchcx", "xcccx", },
- { " ", "xxxxx", "xxxxx", "xxxxx", "xxxxx", }, }))
- .addElement('c', lazy(t -> ofBlock(t.getCasingBlock(), t.getCasingMeta())))
- .addElement('d', lazy(t -> Dynamo.newAny(t.getCasingTextureIndex(), 1)))
- .addElement(
- 'h',
- lazy(
- t -> buildHatchAdder(GT_MetaTileEntity_LargeTurbineBase.class)
- .atLeast(Maintenance, InputHatch, OutputHatch, OutputBus, InputBus, Muffler)
- .casingIndex(t.getCasingTextureIndex()).dot(2)
- .buildAndChain(t.getCasingBlock(), t.getCasingMeta())))
- .addElement(
- 'x',
- (IStructureElementCheckOnly<GT_MetaTileEntity_LargeTurbineBase>) (aContext, aWorld, aX, aY,
- aZ) -> {
- TileEntity tTile = aWorld.getTileEntity(aX, aY, aZ);
- return !(tTile instanceof IGregTechTileEntity) || !(((IGregTechTileEntity) tTile)
- .getMetaTileEntity() instanceof GT_MetaTileEntity_LargeTurbineBase);
- })
- .build();
+ .addShape(
+ STRUCTURE_PIECE_MAIN,
+ transpose(
+ new String[][] { { " ", "xxxxx", "xxxxx", "xxxxx", "xxxxx", },
+ { " --- ", "xcccx", "xchcx", "xchcx", "xcccx", },
+ { " --- ", "xc~cx", "xh-hx", "xh-hx", "xcdcx", },
+ { " --- ", "xcccx", "xchcx", "xchcx", "xcccx", },
+ { " ", "xxxxx", "xxxxx", "xxxxx", "xxxxx", }, }))
+ .addElement('c', lazy(t -> ofBlock(t.getCasingBlock(), t.getCasingMeta())))
+ .addElement('d', lazy(t -> Dynamo.newAny(t.getCasingTextureIndex(), 1)))
+ .addElement(
+ 'h',
+ lazy(
+ t -> buildHatchAdder(GT_MetaTileEntity_LargeTurbineBase.class)
+ .atLeast(Maintenance, InputHatch, OutputHatch, OutputBus, InputBus, Muffler)
+ .casingIndex(t.getCasingTextureIndex())
+ .dot(2)
+ .buildAndChain(t.getCasingBlock(), t.getCasingMeta())))
+ .addElement(
+ 'x',
+ (IStructureElementCheckOnly<GT_MetaTileEntity_LargeTurbineBase>) (aContext, aWorld, aX, aY, aZ) -> {
+ TileEntity tTile = aWorld.getTileEntity(aX, aY, aZ);
+ return !(tTile instanceof IGregTechTileEntity) || !(((IGregTechTileEntity) tTile)
+ .getMetaTileEntity() instanceof GT_MetaTileEntity_LargeTurbineBase);
+ })
+ .build();
}
};
@@ -105,7 +105,7 @@ public abstract class GT_MetaTileEntity_LargeTurbineBase extends
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
maxPower = 0;
if (checkPiece(STRUCTURE_PIECE_MAIN, 2, 2, 1) && mMaintenanceHatches.size() == 1
- && mMufflerHatches.isEmpty() == (getPollutionPerTick(null) == 0)) {
+ && mMufflerHatches.isEmpty() == (getPollutionPerTick(null) == 0)) {
maxPower = getMaximumOutput();
return true;
}
@@ -121,9 +121,9 @@ public abstract class GT_MetaTileEntity_LargeTurbineBase extends
@Override
public boolean addToMachineList(IGregTechTileEntity tTileEntity, int aBaseCasingIndex) {
return addMaintenanceToMachineList(tTileEntity, getCasingTextureIndex())
- || addInputToMachineList(tTileEntity, getCasingTextureIndex())
- || addOutputToMachineList(tTileEntity, getCasingTextureIndex())
- || addMufflerToMachineList(tTileEntity, getCasingTextureIndex());
+ || addInputToMachineList(tTileEntity, getCasingTextureIndex())
+ || addOutputToMachineList(tTileEntity, getCasingTextureIndex())
+ || addMufflerToMachineList(tTileEntity, getCasingTextureIndex());
}
@Override
@@ -140,29 +140,31 @@ public abstract class GT_MetaTileEntity_LargeTurbineBase extends
public @NotNull CheckRecipeResult checkProcessing() {
ItemStack controllerSlot = getControllerSlot();
if ((counter & 7) == 0
- && (controllerSlot == null || !(controllerSlot.getItem() instanceof GT_MetaGenerated_Tool)
- || controllerSlot.getItemDamage() < 170
- || controllerSlot.getItemDamage() > 179)) {
+ && (controllerSlot == null || !(controllerSlot.getItem() instanceof GT_MetaGenerated_Tool)
+ || controllerSlot.getItemDamage() < 170
+ || controllerSlot.getItemDamage() > 179)) {
stopMachine();
return CheckRecipeResultRegistry.NO_TURBINE_FOUND;
}
ArrayList<FluidStack> tFluids = getStoredFluids();
if (tFluids.size() > 0) {
if (baseEff == 0 || optFlow == 0
- || counter >= 512
- || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()
- || this.getBaseMetaTileEntity().hasInventoryBeenModified()) {
+ || counter >= 512
+ || this.getBaseMetaTileEntity()
+ .hasWorkJustBeenEnabled()
+ || this.getBaseMetaTileEntity()
+ .hasInventoryBeenModified()) {
counter = 0;
baseEff = GT_Utility.safeInt(
- (long) ((5F + ((GT_MetaGenerated_Tool) controllerSlot.getItem())
- .getToolCombatDamage(controllerSlot)) * 1000F));
+ (long) ((5F
+ + ((GT_MetaGenerated_Tool) controllerSlot.getItem()).getToolCombatDamage(controllerSlot))
+ * 1000F));
optFlow = GT_Utility.safeInt(
- (long) Math.max(
- Float.MIN_NORMAL,
- ((GT_MetaGenerated_Tool) controllerSlot.getItem()).getToolStats(controllerSlot)
- .getSpeedMultiplier()
- * GT_MetaGenerated_Tool.getPrimaryMaterial(controllerSlot).mToolSpeed
- * 50));
+ (long) Math.max(
+ Float.MIN_NORMAL,
+ ((GT_MetaGenerated_Tool) controllerSlot.getItem()).getToolStats(controllerSlot)
+ .getSpeedMultiplier() * GT_MetaGenerated_Tool.getPrimaryMaterial(controllerSlot).mToolSpeed
+ * 50));
if (optFlow <= 0 || baseEff <= 0) {
stopMachine(); // in case the turbine got removed
return CheckRecipeResultRegistry.NO_FUEL_FOUND;
@@ -240,83 +242,84 @@ public abstract class GT_MetaTileEntity_LargeTurbineBase extends
}
String tRunning = mMaxProgresstime > 0
- ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.running.true")
- + EnumChatFormatting.RESET
- : EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.running.false")
- + EnumChatFormatting.RESET;
+ ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.running.true")
+ + EnumChatFormatting.RESET
+ : EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.running.false")
+ + EnumChatFormatting.RESET;
String tMaintainance = getIdealStatus() == getRepairStatus()
- ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.maintenance.false")
- + EnumChatFormatting.RESET
- : EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.maintenance.true")
- + EnumChatFormatting.RESET;
+ ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.maintenance.false")
+ + EnumChatFormatting.RESET
+ : EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.maintenance.true")
+ + EnumChatFormatting.RESET;
int tDura = 0;
if (mInventory[1] != null && mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) {
tDura = GT_Utility.safeInt(
- (long) (100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1])
- * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1])) + 1));
+ (long) (100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1])
+ * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1])) + 1));
}
long storedEnergy = 0;
long maxEnergy = 0;
for (GT_MetaTileEntity_Hatch_Dynamo tHatch : filterValidMTEs(mDynamoHatches)) {
- storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU();
- maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity();
+ storedEnergy += tHatch.getBaseMetaTileEntity()
+ .getStoredEU();
+ maxEnergy += tHatch.getBaseMetaTileEntity()
+ .getEUCapacity();
}
String[] ret = new String[] {
- // 8 Lines available for information panels
- tRunning + ": "
- + EnumChatFormatting.RED
- + GT_Utility.formatNumbers(mEUt)
- + EnumChatFormatting.RESET
- + " EU/t", /* 1 */
- tMaintainance, /* 2 */
- StatCollector.translateToLocal("GT5U.turbine.efficiency") + ": "
- + EnumChatFormatting.YELLOW
- + (mEfficiency / 100F)
- + EnumChatFormatting.RESET
- + "%", /* 2 */
- StatCollector.translateToLocal("GT5U.multiblock.energy") + ": "
- + EnumChatFormatting.GREEN
- + GT_Utility.formatNumbers(storedEnergy)
- + EnumChatFormatting.RESET
- + " EU / "
- + /* 3 */ EnumChatFormatting.YELLOW
- + GT_Utility.formatNumbers(maxEnergy)
- + EnumChatFormatting.RESET
- + " EU",
- StatCollector.translateToLocal("GT5U.turbine.flow") + ": "
- + EnumChatFormatting.YELLOW
- + GT_Utility.formatNumbers(GT_Utility.safeInt((long) realOptFlow))
- + EnumChatFormatting.RESET
- + " L/t"
- + /* 4 */ EnumChatFormatting.YELLOW
- + " ("
- + (looseFit ? StatCollector.translateToLocal("GT5U.turbine.loose")
- : StatCollector.translateToLocal("GT5U.turbine.tight"))
- + ")", /* 5 */
- StatCollector.translateToLocal("GT5U.turbine.fuel") + ": "
- + EnumChatFormatting.GOLD
- + GT_Utility.formatNumbers(storedFluid)
- + EnumChatFormatting.RESET
- + "L", /* 6 */
- StatCollector.translateToLocal("GT5U.turbine.dmg") + ": "
- + EnumChatFormatting.RED
- + tDura
- + EnumChatFormatting.RESET
- + "%", /* 7 */
- StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": "
- + EnumChatFormatting.GREEN
- + mPollutionReduction
- + EnumChatFormatting.RESET
- + " %" /* 8 */
+ // 8 Lines available for information panels
+ tRunning + ": "
+ + EnumChatFormatting.RED
+ + GT_Utility.formatNumbers(mEUt)
+ + EnumChatFormatting.RESET
+ + " EU/t", /* 1 */
+ tMaintainance, /* 2 */
+ StatCollector.translateToLocal("GT5U.turbine.efficiency") + ": "
+ + EnumChatFormatting.YELLOW
+ + (mEfficiency / 100F)
+ + EnumChatFormatting.RESET
+ + "%", /* 2 */
+ StatCollector.translateToLocal("GT5U.multiblock.energy") + ": "
+ + EnumChatFormatting.GREEN
+ + GT_Utility.formatNumbers(storedEnergy)
+ + EnumChatFormatting.RESET
+ + " EU / "
+ + /* 3 */ EnumChatFormatting.YELLOW
+ + GT_Utility.formatNumbers(maxEnergy)
+ + EnumChatFormatting.RESET
+ + " EU",
+ StatCollector.translateToLocal("GT5U.turbine.flow") + ": "
+ + EnumChatFormatting.YELLOW
+ + GT_Utility.formatNumbers(GT_Utility.safeInt((long) realOptFlow))
+ + EnumChatFormatting.RESET
+ + " L/t"
+ + /* 4 */ EnumChatFormatting.YELLOW
+ + " ("
+ + (looseFit ? StatCollector.translateToLocal("GT5U.turbine.loose")
+ : StatCollector.translateToLocal("GT5U.turbine.tight"))
+ + ")", /* 5 */
+ StatCollector.translateToLocal("GT5U.turbine.fuel") + ": "
+ + EnumChatFormatting.GOLD
+ + GT_Utility.formatNumbers(storedFluid)
+ + EnumChatFormatting.RESET
+ + "L", /* 6 */
+ StatCollector.translateToLocal(
+ "GT5U.turbine.dmg") + ": " + EnumChatFormatting.RED + tDura + EnumChatFormatting.RESET + "%", /* 7 */
+ StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": "
+ + EnumChatFormatting.GREEN
+ + mPollutionReduction
+ + EnumChatFormatting.RESET
+ + " %" /* 8 */
};
- if (!this.getClass().getName().contains("Steam"))
+ if (!this.getClass()
+ .getName()
+ .contains("Steam"))
ret[4] = StatCollector.translateToLocal("GT5U.turbine.flow") + ": "
- + EnumChatFormatting.YELLOW
- + GT_Utility.safeInt((long) realOptFlow)
- + EnumChatFormatting.RESET
- + " L/t";
+ + EnumChatFormatting.YELLOW
+ + GT_Utility.safeInt((long) realOptFlow)
+ + EnumChatFormatting.RESET
+ + " L/t";
return ret;
}
diff --git a/src/main/java/goodgenerator/blocks/tileEntity/base/GT_MetaTileEntity_TooltipMultiBlockBase_EM.java b/src/main/java/goodgenerator/blocks/tileEntity/base/GT_MetaTileEntity_TooltipMultiBlockBase_EM.java
index 70d92540e4..010dc1db88 100644
--- a/src/main/java/goodgenerator/blocks/tileEntity/base/GT_MetaTileEntity_TooltipMultiBlockBase_EM.java
+++ b/src/main/java/goodgenerator/blocks/tileEntity/base/GT_MetaTileEntity_TooltipMultiBlockBase_EM.java
@@ -13,7 +13,7 @@ import gregtech.api.interfaces.ISecondaryDescribable;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
public abstract class GT_MetaTileEntity_TooltipMultiBlockBase_EM extends GT_MetaTileEntity_MultiblockBase_EM
- implements ISecondaryDescribable {
+ implements ISecondaryDescribable {
private static final Map<Integer, GT_Multiblock_Tooltip_Builder> tooltips = new ConcurrentHashMap<>();
diff --git a/src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java b/src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java
index 5d90368122..5608d19ae4 100644
--- a/src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java
+++ b/src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java
@@ -66,7 +66,7 @@ import gregtech.api.util.GT_Utility;
import gregtech.common.tileentities.machines.IDualInputHatch;
public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMultiBlockBase_EM
- implements IConstructable, ISurvivalConstructable, IOverclockDescriptionProvider {
+ implements IConstructable, ISurvivalConstructable, IOverclockDescriptionProvider {
public static final String MAIN_NAME = "largeFusion";
public static final int M = 1_000_000;
@@ -79,41 +79,50 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti
@Override
protected IStructureDefinition<LargeFusionComputer> computeValue(Class<?> type) {
return StructureDefinition.<LargeFusionComputer>builder()
- .addShape(MAIN_NAME, transpose(new String[][] { L0, L1, L2, L3, L2, L1, L0 }))
- .addElement('H', lazy(x -> ofBlock(x.getCoilBlock(), x.getCoilMeta())))
- .addElement('C', lazy(x -> ofBlock(x.getCasingBlock(), x.getCasingMeta())))
- .addElement('B', lazy(x -> ofBlock(x.getGlassBlock(), x.getGlassMeta())))
- .addElement(
- 'I',
- lazy(
- x -> GT_HatchElementBuilder.<LargeFusionComputer>builder()
- .atLeast(
- GT_HatchElement.InputHatch.or(GT_HatchElement.InputBus),
- GT_HatchElement.OutputHatch)
- .adder(LargeFusionComputer::addFluidIO).casingIndex(x.textureIndex()).dot(1)
- .hatchItemFilterAnd(
- x2 -> filterByMTETier(x2.hatchTier(), Integer.MAX_VALUE))
- .buildAndChain(x.getGlassBlock(), x.getGlassMeta())))
- .addElement(
- 'E',
- lazy(
- x -> GT_HatchElementBuilder.<LargeFusionComputer>builder()
- .anyOf(HatchElement.EnergyMulti.or(GT_HatchElement.Energy))
- .adder(LargeFusionComputer::addEnergyInjector).casingIndex(x.textureIndex())
- .hatchItemFilterAnd(
- x2 -> filterByMTETier(x2.hatchTier(), Integer.MAX_VALUE))
- .dot(2).buildAndChain(x.getCasingBlock(), x.getCasingMeta())))
- .addElement('F', lazy(x -> ofFrame(x.getFrameBox()))).build();
+ .addShape(MAIN_NAME, transpose(new String[][] { L0, L1, L2, L3, L2, L1, L0 }))
+ .addElement('H', lazy(x -> ofBlock(x.getCoilBlock(), x.getCoilMeta())))
+ .addElement('C', lazy(x -> ofBlock(x.getCasingBlock(), x.getCasingMeta())))
+ .addElement('B', lazy(x -> ofBlock(x.getGlassBlock(), x.getGlassMeta())))
+ .addElement(
+ 'I',
+ lazy(
+ x -> GT_HatchElementBuilder.<LargeFusionComputer>builder()
+ .atLeast(
+ GT_HatchElement.InputHatch.or(GT_HatchElement.InputBus),
+ GT_HatchElement.OutputHatch)
+ .adder(LargeFusionComputer::addFluidIO)
+ .casingIndex(x.textureIndex())
+ .dot(1)
+ .hatchItemFilterAnd(x2 -> filterByMTETier(x2.hatchTier(), Integer.MAX_VALUE))
+ .buildAndChain(x.getGlassBlock(), x.getGlassMeta())))
+ .addElement(
+ 'E',
+ lazy(
+ x -> GT_HatchElementBuilder.<LargeFusionComputer>builder()
+ .anyOf(HatchElement.EnergyMulti.or(GT_HatchElement.Energy))
+ .adder(LargeFusionComputer::addEnergyInjector)
+ .casingIndex(x.textureIndex())
+ .hatchItemFilterAnd(x2 -> filterByMTETier(x2.hatchTier(), Integer.MAX_VALUE))
+ .dot(2)
+ .buildAndChain(x.getCasingBlock(), x.getCasingMeta())))
+ .addElement('F', lazy(x -> ofFrame(x.getFrameBox())))
+ .build();
}
};
static {
Textures.BlockIcons.setCasingTextureForId(
- 52,
- TextureFactory.of(
- TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW).extFacing().build(),
- TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW).extFacing().glow()
- .build()));
+ 52,
+ TextureFactory.of(
+ TextureFactory.builder()
+ .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW)
+ .extFacing()
+ .build(),
+ TextureFactory.builder()
+ .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW)
+ .extFacing()
+ .glow()
+ .build()));
}
public LargeFusionComputer(String name) {
@@ -195,8 +204,8 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti
public boolean checkMachine_EM(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
this.eEnergyMulti.clear();
if (structureCheck_EM(MAIN_NAME, 23, 3, 40) && mInputHatches.size() + mDualInputHatches.size() != 0
- && !mOutputHatches.isEmpty()
- && (mEnergyHatches.size() + eEnergyMulti.size()) != 0) {
+ && !mOutputHatches.isEmpty()
+ && (mEnergyHatches.size() + eEnergyMulti.size()) != 0) {
fixAllIssue();
return true;
}
@@ -236,32 +245,32 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti
int offX = aBaseMetaTileEntity.getFrontFacing().offsetX;
int offZ = aBaseMetaTileEntity.getFrontFacing().offsetZ;
GT_ChunkManager.requestChunkLoad(
- (TileEntity) aBaseMetaTileEntity,
- new ChunkCoordIntPair(getChunkX() + offX, getChunkZ() + offZ));
+ (TileEntity) aBaseMetaTileEntity,
+ new ChunkCoordIntPair(getChunkX() + offX, getChunkZ() + offZ));
GT_ChunkManager.requestChunkLoad(
- (TileEntity) aBaseMetaTileEntity,
- new ChunkCoordIntPair(getChunkX() + 1 + offX, getChunkZ() + 1 + offZ));
+ (TileEntity) aBaseMetaTileEntity,
+ new ChunkCoordIntPair(getChunkX() + 1 + offX, getChunkZ() + 1 + offZ));
GT_ChunkManager.requestChunkLoad(
- (TileEntity) aBaseMetaTileEntity,
- new ChunkCoordIntPair(getChunkX() + 1 + offX, getChunkZ() + offZ));
+ (TileEntity) aBaseMetaTileEntity,
+ new ChunkCoordIntPair(getChunkX() + 1 + offX, getChunkZ() + offZ));
GT_ChunkManager.requestChunkLoad(
- (TileEntity) aBaseMetaTileEntity,
- new ChunkCoordIntPair(getChunkX() + 1 + offX, getChunkZ() - 1 + offZ));
+ (TileEntity) aBaseMetaTileEntity,
+ new ChunkCoordIntPair(getChunkX() + 1 + offX, getChunkZ() - 1 + offZ));
GT_ChunkManager.requestChunkLoad(
- (TileEntity) aBaseMetaTileEntity,
- new ChunkCoordIntPair(getChunkX() - 1 + offX, getChunkZ() + 1 + offZ));
+ (TileEntity) aBaseMetaTileEntity,
+ new ChunkCoordIntPair(getChunkX() - 1 + offX, getChunkZ() + 1 + offZ));
GT_ChunkManager.requestChunkLoad(
- (TileEntity) aBaseMetaTileEntity,
- new ChunkCoordIntPair(getChunkX() - 1 + offX, getChunkZ() + offZ));
+ (TileEntity) aBaseMetaTileEntity,
+ new ChunkCoordIntPair(getChunkX() - 1 + offX, getChunkZ() + offZ));
GT_ChunkManager.requestChunkLoad(
- (TileEntity) aBaseMetaTileEntity,
- new ChunkCoordIntPair(getChunkX() - 1 + offX, getChunkZ() - 1 + offZ));
+ (TileEntity) aBaseMetaTileEntity,
+ new ChunkCoordIntPair(getChunkX() - 1 + offX, getChunkZ() - 1 + offZ));
GT_ChunkManager.requestChunkLoad(
- (TileEntity) aBaseMetaTileEntity,
- new ChunkCoordIntPair(getChunkX() + offX, getChunkZ() + 1 + offZ));
+ (TileEntity) aBaseMetaTileEntity,
+ new ChunkCoordIntPair(getChunkX() + offX, getChunkZ() + 1 + offZ));
GT_ChunkManager.requestChunkLoad(
- (TileEntity) aBaseMetaTileEntity,
- new ChunkCoordIntPair(getChunkX() + offX, getChunkZ() - 1 + offZ));
+ (TileEntity) aBaseMetaTileEntity,
+ new ChunkCoordIntPair(getChunkX() + offX, getChunkZ() - 1 + offZ));
this.isLoadedChunk = true;
}
@@ -276,8 +285,8 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti
mUpdated = false;
}
if (--mUpdate == 0 || --mStartUpCheck == 0
- || cyclicUpdate_EM()
- || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) {
+ || cyclicUpdate_EM()
+ || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) {
if (mUpdate <= -1000) {
mUpdate = 5000;
}
@@ -294,23 +303,24 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti
for (GT_MetaTileEntity_Hatch hatch : filterValidMTEs(hatches)) {
long consumableEnergy = Math.min(hatch.getEUVar(), energyLimit);
long receivedEnergy = Math
- .min(consumableEnergy, maxEUStore() - aBaseMetaTileEntity.getStoredEU());
+ .min(consumableEnergy, maxEUStore() - aBaseMetaTileEntity.getStoredEU());
if (receivedEnergy > 0) {
- hatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(receivedEnergy, false);
+ hatch.getBaseMetaTileEntity()
+ .decreaseStoredEnergyUnits(receivedEnergy, false);
aBaseMetaTileEntity.increaseStoredEnergyUnits(receivedEnergy, true);
}
}
if (mMaxProgresstime > 0) {
- this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(-lEUt, true);
+ this.getBaseMetaTileEntity()
+ .decreaseStoredEnergyUnits(-lEUt, true);
if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime) {
if (mOutputItems != null)
for (ItemStack tStack : mOutputItems) if (tStack != null) addOutput(tStack);
if (mOutputFluids != null)
for (FluidStack tStack : mOutputFluids) if (tStack != null) addOutput(tStack);
- mEfficiency = Math.max(
- 0,
- Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1])));
+ mEfficiency = Math
+ .max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1])));
mOutputItems = null;
mOutputFluids = null;
mProgresstime = 0;
@@ -321,19 +331,18 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti
}
} else {
if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()
- || aBaseMetaTileEntity.hasInventoryBeenModified()) {
+ || aBaseMetaTileEntity.hasInventoryBeenModified()) {
turnCasingActive(mMaxProgresstime > 0);
if (aBaseMetaTileEntity.isAllowedToWork()) {
if (checkRecipe()) {
if (aBaseMetaTileEntity.getStoredEU()
- < this.mLastRecipe.mSpecialValue + this.lEUt) {
+ < this.mLastRecipe.mSpecialValue + this.lEUt) {
mMaxProgresstime = 0;
turnCasingActive(false);
criticalStopMachine();
}
- getBaseMetaTileEntity().decreaseStoredEnergyUnits(
- this.mLastRecipe.mSpecialValue + this.lEUt,
- false);
+ getBaseMetaTileEntity()
+ .decreaseStoredEnergyUnits(this.mLastRecipe.mSpecialValue + this.lEUt, false);
}
}
if (mMaxProgresstime <= 0) mEfficiency = Math.max(0, mEfficiency - 1000);
@@ -346,7 +355,7 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti
}
}
aBaseMetaTileEntity
- .setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mMachine ? 0 : 64));
+ .setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mMachine ? 0 : 64));
aBaseMetaTileEntity.setActive(mMaxProgresstime > 0);
} else {
soundMagic(getActivitySound());
@@ -391,12 +400,16 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing,
- int colorIndex, boolean aActive, boolean aRedstone) {
- if (side == facing)
- return new ITexture[] { TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS).extFacing().build(),
- getTextureOverlay() };
+ int colorIndex, boolean aActive, boolean aRedstone) {
+ if (side == facing) return new ITexture[] { TextureFactory.builder()
+ .addIcon(MACHINE_CASING_FUSION_GLASS)
+ .extFacing()
+ .build(), getTextureOverlay() };
if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(52) };
- return new ITexture[] { TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS).extFacing().build() };
+ return new ITexture[] { TextureFactory.builder()
+ .addIcon(MACHINE_CASING_FUSION_GLASS)
+ .extFacing()
+ .build() };
}
@Override
@@ -565,29 +578,29 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti
if (mMaxProgresstime > 0) plasmaOut = (double) mOutputFluids[0].amount / mMaxProgresstime;
return new String[] { EnumChatFormatting.BLUE + "Fusion Reactor MK " + EnumChatFormatting.RESET + tier,
- StatCollector.translateToLocal("scanner.info.UX.0") + ": "
- + EnumChatFormatting.LIGHT_PURPLE
- + GT_Utility.formatNumbers(this.para)
- + EnumChatFormatting.RESET,
- StatCollector.translateToLocal("GT5U.fusion.req") + ": "
- + EnumChatFormatting.RED
- + GT_Utility.formatNumbers(-lEUt)
- + EnumChatFormatting.RESET
- + "EU/t",
- StatCollector.translateToLocal("GT5U.multiblock.energy") + ": "
- + EnumChatFormatting.GREEN
- + GT_Utility.formatNumbers(baseMetaTileEntity != null ? baseMetaTileEntity.getStoredEU() : 0)
- + EnumChatFormatting.RESET
- + " EU / "
- + EnumChatFormatting.YELLOW
- + GT_Utility.formatNumbers(maxEUStore())
- + EnumChatFormatting.RESET
- + " EU",
- StatCollector.translateToLocal("GT5U.fusion.plasma") + ": "
- + EnumChatFormatting.YELLOW
- + GT_Utility.formatNumbers(plasmaOut)
- + EnumChatFormatting.RESET
- + "L/t" };
+ StatCollector.translateToLocal("scanner.info.UX.0") + ": "
+ + EnumChatFormatting.LIGHT_PURPLE
+ + GT_Utility.formatNumbers(this.para)
+ + EnumChatFormatting.RESET,
+ StatCollector.translateToLocal("GT5U.fusion.req") + ": "
+ + EnumChatFormatting.RED
+ + GT_Utility.formatNumbers(-lEUt)
+ + EnumChatFormatting.RESET
+ + "EU/t",
+ StatCollector.translateToLocal("GT5U.multiblock.energy") + ": "
+ + EnumChatFormatting.GREEN
+ + GT_Utility.formatNumbers(baseMetaTileEntity != null ? baseMetaTileEntity.getStoredEU() : 0)
+ + EnumChatFormatting.RESET
+ + " EU / "
+ + EnumChatFormatting.YELLOW
+ + GT_Utility.formatNumbers(maxEUStore())
+ + EnumChatFormatting.RESET
+ + " EU",
+ StatCollector.translateToLocal("GT5U.fusion.plasma") + ": "
+ + EnumChatFormatting.YELLOW
+ + GT_Utility.formatNumbers(plasmaOut)
+ + EnumChatFormatting.RESET
+ + "L/t" };
}
protected long energyStorageCache;
@@ -598,123 +611,123 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti
super.drawTexts(screenElements, inventorySlot);
screenElements
- .widget(
- new TextWidget()
- .setStringSupplier(
- () -> StatCollector.translateToLocal("gui.LargeFusion.0") + " "
- + numberFormat.format(energyStorageCache)
- + " EU")
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0))
- .widget(new FakeSyncWidget.LongSyncer(this::maxEUStore, val -> energyStorageCache = val))
- .widget(
- new TextWidget()
- .setStringSupplier(
- () -> StatCollector.translateToLocal("gui.LargeFusion.1") + " "
- + numberFormat.format(getEUVar())
- + " EU")
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0))
- .widget(new FakeSyncWidget.LongSyncer(this::getEUVar, this::setEUVar));
+ .widget(
+ new TextWidget()
+ .setStringSupplier(
+ () -> StatCollector.translateToLocal("gui.LargeFusion.0") + " "
+ + numberFormat.format(energyStorageCache)
+ + " EU")
+ .setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0))
+ .widget(new FakeSyncWidget.LongSyncer(this::maxEUStore, val -> energyStorageCache = val))
+ .widget(
+ new TextWidget()
+ .setStringSupplier(
+ () -> StatCollector.translateToLocal("gui.LargeFusion.1") + " "
+ + numberFormat.format(getEUVar())
+ + " EU")
+ .setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0))
+ .widget(new FakeSyncWidget.LongSyncer(this::getEUVar, this::setEUVar));
}
public static final String[] L0 = { " ",
- " ", " FCCCCCF ",
- " FCIBICF ", " FCCCCCF ",
- " ", " ",
- " ", " ",
- " ", " ",
- " ", " ",
- " ", " ",
- " ", " ",
- " ", " ",
- " ", " FFF FFF ",
- " CCC CCC ", " CIC CIC ",
- " CBC CBC ", " CIC CIC ",
- " CCC CCC ", " FFF FFF ",
- " ", " ",
- " ", " ",
- " ", " ",
- " ", " ",
- " ", " ",
- " ", " ",
- " ", " ",