aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/metatileentity/implementations
diff options
context:
space:
mode:
authorRaven Szewczyk <git@eigenraven.me>2023-04-10 17:49:16 +0100
committerRaven Szewczyk <git@eigenraven.me>2023-04-10 17:49:16 +0100
commit8ac58626bd4caa9e49f58acc6b97ac031f6c2107 (patch)
tree0a8c7b737f1f2607fa6875309f4c6a5c2b8b3331 /src/main/java/gregtech/api/metatileentity/implementations
parentd795cf740c3b48b602d3bfb708ed9e6c492ad37d (diff)
downloadGT5-Unofficial-8ac58626bd4caa9e49f58acc6b97ac031f6c2107.tar.gz
GT5-Unofficial-8ac58626bd4caa9e49f58acc6b97ac031f6c2107.tar.bz2
GT5-Unofficial-8ac58626bd4caa9e49f58acc6b97ac031f6c2107.zip
Update spotless config to 0.2.2
Diffstat (limited to 'src/main/java/gregtech/api/metatileentity/implementations')
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java275
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java299
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java31
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java170
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java177
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java55
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull.java16
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull_NonElectric.java8
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java624
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java171
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java446
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Steel.java64
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java134
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java214
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_CubicMultiBlockBase.java42
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_EnhancedMultiBlockBase.java188
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ExtendedPowerMultiBlockBase.java112
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch.java12
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java28
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Dynamo.java14
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy.java18
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Input.java44
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java56
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java121
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java51
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_MultiInput.java63
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java275
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java58
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java779
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SpecialFilter.java144
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java22
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TooltipMultiBlockBase.java4
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java166
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Dynamo.java10
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Hatch.java12
35 files changed, 2318 insertions, 2585 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java
index ee610d2631..132c48e77d 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java
@@ -57,9 +57,9 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
public final long mCableLossPerMeter, mAmperage, mVoltage;
public final boolean mInsulated, mCanShock;
public int mTransferredAmperage = 0, mTransferredAmperageLast20 = 0, mTransferredAmperageLast20OK = 0,
- mTransferredAmperageOK = 0;
+ mTransferredAmperageOK = 0;
public long mTransferredVoltageLast20 = 0, mTransferredVoltage = 0, mTransferredVoltageLast20OK = 0,
- mTransferredVoltageOK = 0;
+ mTransferredVoltageOK = 0;
public long mRestRF;
public int mOverheat;
public static short mMaxOverheat = (short) (GT_Mod.gregtechproxy.mWireHeatingTicks * 100);
@@ -68,7 +68,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
private long lastWorldTick;
public GT_MetaPipeEntity_Cable(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial,
- long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
+ long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
super(aID, aName, aNameRegional, 0);
mThickNess = aThickNess;
mMaterial = aMaterial;
@@ -80,7 +80,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
}
public GT_MetaPipeEntity_Cable(String aName, float aThickNess, Materials aMaterial, long aCableLossPerMeter,
- long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
+ long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
super(aName, 0);
mThickNess = aThickNess;
mMaterial = aMaterial;
@@ -99,77 +99,76 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
@Override
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaPipeEntity_Cable(
- mName,
- mThickNess,
- mMaterial,
- mCableLossPerMeter,
- mAmperage,
- mVoltage,
- mInsulated,
- mCanShock);
+ mName,
+ mThickNess,
+ mMaterial,
+ mCableLossPerMeter,
+ mAmperage,
+ mVoltage,
+ mInsulated,
+ mCanShock);
}
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections,
- byte aColorIndex, boolean aConnected, boolean aRedstone) {
+ byte aColorIndex, boolean aConnected, boolean aRedstone) {
if (!mInsulated) return new ITexture[] { TextureFactory.of(
- mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) };
+ mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) };
if (aConnected) {
float tThickNess = getThickNess();
if (tThickNess < 0.124F) return new ITexture[] { TextureFactory.of(
- Textures.BlockIcons.INSULATION_FULL,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
+ Textures.BlockIcons.INSULATION_FULL,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
if (tThickNess < 0.374F) // 0.375 x1
return new ITexture[] {
- TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa),
- TextureFactory.of(
- Textures.BlockIcons.INSULATION_TINY,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
+ TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa),
+ TextureFactory.of(
+ Textures.BlockIcons.INSULATION_TINY,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
if (tThickNess < 0.499F) // 0.500 x2
return new ITexture[] {
- TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa),
- TextureFactory.of(
- Textures.BlockIcons.INSULATION_SMALL,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
+ TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa),
+ TextureFactory.of(
+ Textures.BlockIcons.INSULATION_SMALL,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
if (tThickNess < 0.624F) // 0.625 x4
return new ITexture[] {
- TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa),
- TextureFactory.of(
- Textures.BlockIcons.INSULATION_MEDIUM,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
+ TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa),
+ TextureFactory.of(
+ Textures.BlockIcons.INSULATION_MEDIUM,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
if (tThickNess < 0.749F) // 0.750 x8
return new ITexture[] {
- TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa),
- TextureFactory.of(
- Textures.BlockIcons.INSULATION_MEDIUM_PLUS,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
+ TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa),
+ TextureFactory.of(
+ Textures.BlockIcons.INSULATION_MEDIUM_PLUS,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
if (tThickNess < 0.874F) // 0.825 x12
return new ITexture[] {
- TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa),
- TextureFactory.of(
- Textures.BlockIcons.INSULATION_LARGE,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
- return new ITexture[] {
TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa),
TextureFactory.of(
- Textures.BlockIcons.INSULATION_HUGE,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
+ Textures.BlockIcons.INSULATION_LARGE,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
+ return new ITexture[] {
+ TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa),
+ TextureFactory.of(
+ Textures.BlockIcons.INSULATION_HUGE,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
}
- return new ITexture[] { TextureFactory.of(
- Textures.BlockIcons.INSULATION_FULL,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
+ return new ITexture[] { TextureFactory
+ .of(Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
}
@Override
public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) {
if (mCanShock && (((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0
- && aEntity instanceof EntityLivingBase
- && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity))
+ && aEntity instanceof EntityLivingBase
+ && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity))
GT_Utility.applyElectricityDamage(
- (EntityLivingBase) aEntity,
- mTransferredVoltageLast20,
- mTransferredAmperageLast20);
+ (EntityLivingBase) aEntity,
+ mTransferredVoltageLast20,
+ mTransferredAmperageLast20);
}
@Override
@@ -206,8 +205,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
if (!isConnectedAtSide(aSide) && aSide != 6) return 0;
if (!getBaseMetaTileEntity().getCoverInfoAtSide(aSide)
- .letsEnergyIn())
- return 0;
+ .letsEnergyIn()) return 0;
final HashSet<TileEntity> nul = null;
return transferElectricity(aSide, aVoltage, aAmperage, nul);
}
@@ -215,7 +213,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
@Override
@Deprecated
public long transferElectricity(byte aSide, long aVoltage, long aAmperage,
- ArrayList<TileEntity> aAlreadyPassedTileEntityList) {
+ ArrayList<TileEntity> aAlreadyPassedTileEntityList) {
return transferElectricity(aSide, aVoltage, aAmperage, new HashSet<>(aAlreadyPassedTileEntityList));
}
@@ -247,10 +245,9 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
if (aBaseMetaTileEntity.isServerSide()) {
lastAmperage = new int[16];
lastWorldTick = aBaseMetaTileEntity.getWorld()
- .getTotalWorldTime()
- - 1; // sets initial value -1 since it is
- // in the same tick as first on post
- // tick
+ .getTotalWorldTime() - 1; // sets initial value -1 since it is
+ // in the same tick as first on post
+ // tick
}
}
@@ -258,16 +255,16 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
super.onPostTick(aBaseMetaTileEntity, aTick);
if (aTick % 20 == 0 && aBaseMetaTileEntity.isServerSide()
- && (!GT_Mod.gregtechproxy.gt6Cable || mCheckConnections)) {
+ && (!GT_Mod.gregtechproxy.gt6Cable || mCheckConnections)) {
checkConnections();
}
}
@Override
public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
- float aZ) {
+ float aZ) {
if (GT_Mod.gregtechproxy.gt6Cable
- && GT_ModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) {
+ && GT_ModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) {
if (isConnectedAtSide(aWrenchingSide)) {
disconnect(aWrenchingSide);
GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("215", "Disconnected"));
@@ -282,9 +279,9 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
@Override
public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
- float aZ) {
+ float aZ) {
if (GT_Mod.gregtechproxy.gt6Cable
- && GT_ModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) {
+ && GT_ModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) {
if (isConnectedAtSide(aWrenchingSide)) {
disconnect(aWrenchingSide);
GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("215", "Disconnected"));
@@ -299,25 +296,25 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
@Override
public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable,
- ICoverable aTileEntity) {
+ ICoverable aTileEntity) {
return coverBehavior.letsEnergyIn(aSide, aCoverID, aCoverVariable, aTileEntity);
}
@Override
public boolean letsOut(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable,
- ICoverable aTileEntity) {
+ ICoverable aTileEntity) {
return coverBehavior.letsEnergyOut(aSide, aCoverID, aCoverVariable, aTileEntity);
}
@Override
public boolean letsIn(GT_CoverBehaviorBase<?> coverBehavior, byte aSide, int aCoverID,
- ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ ISerializableObject aCoverVariable, ICoverable aTileEntity) {
return coverBehavior.letsEnergyIn(aSide, aCoverID, aCoverVariable, aTileEntity);
}
@Override
public boolean letsOut(GT_CoverBehaviorBase<?> coverBehavior, byte aSide, int aCoverID,
- ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ ISerializableObject aCoverVariable, ICoverable aTileEntity) {
return coverBehavior.letsEnergyOut(aSide, aCoverID, aCoverVariable, aTileEntity);
}
@@ -340,8 +337,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
// GT Machine handling
if ((tTileEntity instanceof IEnergyConnected) && (((IEnergyConnected) tTileEntity).inputEnergyFrom(tSide, false)
- || ((IEnergyConnected) tTileEntity).outputsEnergyTo(tSide, false)))
- return true;
+ || ((IEnergyConnected) tTileEntity).outputsEnergyTo(tSide, false))) return true;
// Solar Panel Compat
if (coverBehavior instanceof GT_Cover_SolarPanel) return true;
@@ -353,7 +349,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
// AE2-p2p Compat
if (GT_Mod.gregtechproxy.mAE2Integration) {
if (tTileEntity instanceof appeng.tile.powersink.IC2
- && ((appeng.tile.powersink.IC2) tTileEntity).acceptsEnergyFrom((TileEntity) baseMetaTile, tDir))
+ && ((appeng.tile.powersink.IC2) tTileEntity).acceptsEnergyFrom((TileEntity) baseMetaTile, tDir))
return true;
}
@@ -364,17 +360,16 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
if (tTileEntity instanceof IReactorChamber)
ic2Energy = (TileEntity) ((IReactorChamber) tTileEntity).getReactor();
else ic2Energy = (tTileEntity == null || tTileEntity instanceof IEnergyTile || EnergyNet.instance == null)
- ? tTileEntity
- : EnergyNet.instance.getTileEntity(
- tTileEntity.getWorldObj(),
- tTileEntity.xCoord,
- tTileEntity.yCoord,
- tTileEntity.zCoord);
+ ? tTileEntity
+ : EnergyNet.instance.getTileEntity(
+ tTileEntity.getWorldObj(),
+ tTileEntity.xCoord,
+ tTileEntity.yCoord,
+ tTileEntity.zCoord);
// IC2 Sink Compat
if ((ic2Energy instanceof IEnergySink)
- && ((IEnergySink) ic2Energy).acceptsEnergyFrom((TileEntity) baseMetaTile, tDir))
- return true;
+ && ((IEnergySink) ic2Energy).acceptsEnergyFrom((TileEntity) baseMetaTile, tDir)) return true;
// IC2 Source Compat
if (GT_Mod.gregtechproxy.ic2EnergySourceCompat && (ic2Energy instanceof IEnergySource)) {
@@ -385,12 +380,11 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
}
// RF Output Compat
if (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver
- && ((IEnergyReceiver) tTileEntity).canConnectEnergy(tDir))
- return true;
+ && ((IEnergyReceiver) tTileEntity).canConnectEnergy(tDir)) return true;
// RF Input Compat
return GregTech_API.mInputRF && (tTileEntity instanceof IEnergyEmitter
- && ((IEnergyEmitter) tTileEntity).emitsEnergyTo((TileEntity) baseMetaTile, tDir));
+ && ((IEnergyEmitter) tTileEntity).emitsEnergyTo((TileEntity) baseMetaTile, tDir));
}
@Override
@@ -412,24 +406,24 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
@Override
public String[] getDescription() {
return new String[] {
- StatCollector.translateToLocal("GT5U.item.cable.max_voltage") + ": %%%"
- + EnumChatFormatting.GREEN
- + GT_Utility.formatNumbers(mVoltage)
- + " ("
- + GT_Utility.getColoredTierNameFromVoltage(mVoltage)
- + EnumChatFormatting.GREEN
- + ")"
- + EnumChatFormatting.GRAY,
- StatCollector.translateToLocal("GT5U.item.cable.max_amperage") + ": %%%"
- + EnumChatFormatting.YELLOW
- + GT_Utility.formatNumbers(mAmperage)
- + EnumChatFormatting.GRAY,
- StatCollector.translateToLocal("GT5U.item.cable.loss") + ": %%%"
- + EnumChatFormatting.RED
- + GT_Utility.formatNumbers(mCableLossPerMeter)
- + EnumChatFormatting.GRAY
- + "%%% "
- + StatCollector.translateToLocal("GT5U.item.cable.eu_volt") };
+ StatCollector.translateToLocal("GT5U.item.cable.max_voltage") + ": %%%"
+ + EnumChatFormatting.GREEN
+ + GT_Utility.formatNumbers(mVoltage)
+ + " ("
+ + GT_Utility.getColoredTierNameFromVoltage(mVoltage)
+ + EnumChatFormatting.GREEN
+ + ")"
+ + EnumChatFormatting.GRAY,
+ StatCollector.translateToLocal("GT5U.item.cable.max_amperage") + ": %%%"
+ + EnumChatFormatting.YELLOW
+ + GT_Utility.formatNumbers(mAmperage)
+ + EnumChatFormatting.GRAY,
+ StatCollector.translateToLocal("GT5U.item.cable.loss") + ": %%%"
+ + EnumChatFormatting.RED
+ + GT_Utility.formatNumbers(mCableLossPerMeter)
+ + EnumChatFormatting.GRAY
+ + "%%% "
+ + StatCollector.translateToLocal("GT5U.item.cable.eu_volt") };
}
@Override
@@ -466,38 +460,38 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
volts = path.getVoltage(this);
}
return new String[] {
- // EnumChatFormatting.BLUE + mName + EnumChatFormatting.RESET,
- "Heat: " + EnumChatFormatting.RED
- + GT_Utility.formatNumbers(mOverheat)
- + EnumChatFormatting.RESET
- + " / "
- + EnumChatFormatting.YELLOW
- + GT_Utility.formatNumbers(mMaxOverheat)
- + EnumChatFormatting.RESET,
- "Max Load (1t):",
- EnumChatFormatting.GREEN + GT_Utility.formatNumbers(amps)
- + EnumChatFormatting.RESET
- + " A / "
- + EnumChatFormatting.YELLOW
- + GT_Utility.formatNumbers(mAmperage)
- + EnumChatFormatting.RESET
- + " A",
- "Max EU/p (1t):",
- EnumChatFormatting.GREEN + GT_Utility.formatNumbers(volts)
- + EnumChatFormatting.RESET
- + " EU / "
- + EnumChatFormatting.YELLOW
- + GT_Utility.formatNumbers(mVoltage)
- + EnumChatFormatting.RESET
- + " EU",
- "Max Load (20t): " + EnumChatFormatting.GREEN
- + GT_Utility.formatNumbers(mTransferredAmperageLast20OK)
- + EnumChatFormatting.RESET
- + " A",
- "Max EU/p (20t): " + EnumChatFormatting.GREEN
- + GT_Utility.formatNumbers(mTransferredVoltageLast20OK)
- + EnumChatFormatting.RESET
- + " EU" };
+ // EnumChatFormatting.BLUE + mName + EnumChatFormatting.RESET,
+ "Heat: " + EnumChatFormatting.RED
+ + GT_Utility.formatNumbers(mOverheat)
+ + EnumChatFormatting.RESET
+ + " / "
+ + EnumChatFormatting.YELLOW
+ + GT_Utility.formatNumbers(mMaxOverheat)
+ + EnumChatFormatting.RESET,
+ "Max Load (1t):",
+ EnumChatFormatting.GREEN + GT_Utility.formatNumbers(amps)
+ + EnumChatFormatting.RESET
+ + " A / "
+ + EnumChatFormatting.YELLOW
+ + GT_Utility.formatNumbers(mAmperage)
+ + EnumChatFormatting.RESET
+ + " A",
+ "Max EU/p (1t):",
+ EnumChatFormatting.GREEN + GT_Utility.formatNumbers(volts)
+ + EnumChatFormatting.RESET
+ + " EU / "
+ + EnumChatFormatting.YELLOW
+ + GT_Utility.formatNumbers(mVoltage)
+ + EnumChatFormatting.RESET
+ + " EU",
+ "Max Load (20t): " + EnumChatFormatting.GREEN
+ + GT_Utility.formatNumbers(mTransferredAmperageLast20OK)
+ + EnumChatFormatting.RESET
+ + " A",
+ "Max EU/p (20t): " + EnumChatFormatting.GREEN
+ + GT_Utility.formatNumbers(mTransferredVoltageLast20OK)
+ + EnumChatFormatting.RESET
+ + " EU" };
}
@Override
@@ -549,18 +543,13 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
if ((tConn & (1 << ForgeDirection.WEST.ordinal())) != 0) tSide4 = 0f;
if ((tConn & (1 << ForgeDirection.EAST.ordinal())) != 0) tSide5 = 1f;
- return AxisAlignedBB.getBoundingBox(
- aX + tSide4,
- aY + tSide0,
- aZ + tSide2,
- aX + tSide5,
- aY + tSide1,
- aZ + tSide3);
+ return AxisAlignedBB
+ .getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3);
}
@Override
public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB,
- List<AxisAlignedBB> outputAABB, Entity collider) {
+ List<AxisAlignedBB> outputAABB, Entity collider) {
super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) {
final AxisAlignedBB aabb = getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
@@ -577,13 +566,13 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
for (byte aSide = 0; aSide < 6; aSide++) if (isConnectedAtSide(aSide)) {
final TileEntity tTileEntity = baseMeta.getTileEntityAtSide(aSide);
final TileEntity tEmitter = (tTileEntity == null || tTileEntity instanceof IEnergyTile
- || EnergyNet.instance == null)
- ? tTileEntity
- : EnergyNet.instance.getTileEntity(
- tTileEntity.getWorldObj(),
- tTileEntity.xCoord,
- tTileEntity.yCoord,
- tTileEntity.zCoord);
+ || EnergyNet.instance == null)
+ ? tTileEntity
+ : EnergyNet.instance.getTileEntity(
+ tTileEntity.getWorldObj(),
+ tTileEntity.xCoord,
+ tTileEntity.yCoord,
+ tTileEntity.zCoord);
if (tEmitter instanceof IEnergyEmitter) return true;
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java
index c8718d0e52..76c7f418e9 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java
@@ -55,12 +55,12 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
public byte mDisableInput = 0;
public GT_MetaPipeEntity_Fluid(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial,
- int aCapacity, int aHeatResistance, boolean aGasProof) {
+ int aCapacity, int aHeatResistance, boolean aGasProof) {
this(aID, aName, aNameRegional, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1);
}
public GT_MetaPipeEntity_Fluid(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial,
- int aCapacity, int aHeatResistance, boolean aGasProof, int aFluidTypes) {
+ int aCapacity, int aHeatResistance, boolean aGasProof, int aFluidTypes) {
super(aID, aName, aNameRegional, 0, false);
mThickNess = aThickNess;
mMaterial = aMaterial;
@@ -74,12 +74,12 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
@Deprecated
public GT_MetaPipeEntity_Fluid(String aName, float aThickNess, Materials aMaterial, int aCapacity,
- int aHeatResistance, boolean aGasProof) {
+ int aHeatResistance, boolean aGasProof) {
this(aName, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1);
}
public GT_MetaPipeEntity_Fluid(String aName, float aThickNess, Materials aMaterial, int aCapacity,
- int aHeatResistance, boolean aGasProof, int aFluidTypes) {
+ int aHeatResistance, boolean aGasProof, int aFluidTypes) {
super(aName, 0);
mThickNess = aThickNess;
mMaterial = aMaterial;
@@ -98,64 +98,64 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
@Override
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaPipeEntity_Fluid(
- mName,
- mThickNess,
- mMaterial,
- mCapacity,
- mHeatResistance,
- mGasProof,
- mPipeAmount);
+ mName,
+ mThickNess,
+ mMaterial,
+ mCapacity,
+ mHeatResistance,
+ mGasProof,
+ mPipeAmount);
}
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections,
- byte aColorIndex, boolean aConnected, boolean aRedstone) {
+ byte aColorIndex, boolean aConnected, boolean aRedstone) {
final float tThickNess = getThickNess();
if (mDisableInput == 0)
return new ITexture[] { aConnected ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex)
- : TextureFactory.of(
- mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex],
- Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) };
+ : TextureFactory.of(
+ mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) };
byte tMask = 0;
final byte[][] sRestrictionArray = { { 2, 3, 5, 4 }, { 2, 3, 4, 5 }, { 1, 0, 4, 5 }, { 1, 0, 4, 5 },
- { 1, 0, 2, 3 }, { 1, 0, 2, 3 } };
+ { 1, 0, 2, 3 }, { 1, 0, 2, 3 } };
if (aSide >= 0 && aSide < 6) {
for (byte i = 0; i < 4; i++) if (isInputDisabledAtSide(sRestrictionArray[aSide][i])) tMask |= 1 << i;
// Full block size renderer flips side 5 and 2 textures, flip restrictor textures to compensate
if (aSide == 5 || aSide == 2) if (tMask > 3 && tMask < 12) tMask = (byte) (tMask ^ 12);
}
return new ITexture[] { aConnected ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex)
- : TextureFactory.of(
- mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex],
- Dyes.getModulation(aColorIndex, mMaterial.mRGBa)),
- getRestrictorTexture(tMask) };
+ : TextureFactory.of(
+ mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa)),
+ getRestrictorTexture(tMask) };
}
protected static ITexture getBaseTexture(float aThickNess, int aPipeAmount, Materials aMaterial, byte aColorIndex) {
if (aPipeAmount >= 9) return TextureFactory.of(
- aMaterial.mIconSet.mTextures[OrePrefixes.pipeNonuple.mTextureIndex],
- Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ aMaterial.mIconSet.mTextures[OrePrefixes.pipeNonuple.mTextureIndex],
+ Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
if (aPipeAmount >= 4) return TextureFactory.of(
- aMaterial.mIconSet.mTextures[OrePrefixes.pipeQuadruple.mTextureIndex],
- Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ aMaterial.mIconSet.mTextures[OrePrefixes.pipeQuadruple.mTextureIndex],
+ Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
if (aThickNess < 0.124F) return TextureFactory.of(
- aMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex],
- Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ aMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex],
+ Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
if (aThickNess < 0.374F) return TextureFactory.of(
- aMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex],
- Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ aMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex],
+ Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
if (aThickNess < 0.499F) return TextureFactory.of(
- aMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex],
- Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ aMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex],
+ Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
if (aThickNess < 0.749F) return TextureFactory.of(
- aMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex],
- Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ aMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex],
+ Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
if (aThickNess < 0.874F) return TextureFactory.of(
- aMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex],
- Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ aMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex],
+ Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
return TextureFactory.of(
- aMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex],
- Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ aMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex],
+ Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
}
protected static ITexture getRestrictorTexture(byte aMask) {
@@ -244,22 +244,20 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
@Override
public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) {
if ((((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0
- && aEntity instanceof EntityLivingBase) {
+ && aEntity instanceof EntityLivingBase) {
for (FluidStack tFluid : mFluids) {
if (tFluid != null) {
final int tTemperature = tFluid.getFluid()
- .getTemperature(tFluid);
- if (tTemperature > 320 && !isCoverOnSide(
- (BaseMetaPipeEntity) getBaseMetaTileEntity(),
- (EntityLivingBase) aEntity)) {
+ .getTemperature(tFluid);
+ if (tTemperature > 320
+ && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) {
GT_Utility.applyHeatDamage((EntityLivingBase) aEntity, (tTemperature - 300) / 50.0F);
break;
- } else if (tTemperature < 260 && !isCoverOnSide(
- (BaseMetaPipeEntity) getBaseMetaTileEntity(),
- (EntityLivingBase) aEntity)) {
- GT_Utility.applyFrostDamage((EntityLivingBase) aEntity, (270 - tTemperature) / 25.0F);
- break;
- }
+ } else if (tTemperature < 260
+ && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) {
+ GT_Utility.applyFrostDamage((EntityLivingBase) aEntity, (270 - tTemperature) / 25.0F);
+ break;
+ }
}
}
}
@@ -300,55 +298,48 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
if (tFluid != null && tFluid.amount > 0) {
final int tTemperature = tFluid.getFluid()
- .getTemperature(tFluid);
+ .getTemperature(tFluid);
if (tTemperature > mHeatResistance) {
if (aBaseMetaTileEntity.getRandomNumber(100) == 0) {
// Poof
GT_Log.exp.println(
- "Set Pipe to Fire due to to low heat resistance at " + aBaseMetaTileEntity.getXCoord()
- + " | "
- + aBaseMetaTileEntity.getYCoord()
- + " | "
- + aBaseMetaTileEntity.getZCoord()
- + " DIMID: "
- + aBaseMetaTileEntity.getWorld().provider.dimensionId);
+ "Set Pipe to Fire due to to low heat resistance at " + aBaseMetaTileEntity.getXCoord()
+ + " | "
+ + aBaseMetaTileEntity.getYCoord()
+ + " | "
+ + aBaseMetaTileEntity.getZCoord()
+ + " DIMID: "
+ + aBaseMetaTileEntity.getWorld().provider.dimensionId);
aBaseMetaTileEntity.setToFire();
return true;
}
// Mmhmm, Fire
aBaseMetaTileEntity.setOnFire();
GT_Log.exp.println(
- "Set Blocks around Pipe to Fire due to to low heat resistance at "
- + aBaseMetaTileEntity.getXCoord()
- + " | "
- + aBaseMetaTileEntity.getYCoord()
- + " | "
- + aBaseMetaTileEntity.getZCoord()
- + " DIMID: "
- + aBaseMetaTileEntity.getWorld().provider.dimensionId);
+ "Set Blocks around Pipe to Fire due to to low heat resistance at " + aBaseMetaTileEntity.getXCoord()
+ + " | "
+ + aBaseMetaTileEntity.getYCoord()
+ + " | "
+ + aBaseMetaTileEntity.getZCoord()
+ + " DIMID: "
+ + aBaseMetaTileEntity.getWorld().provider.dimensionId);
}
if (!mGasProof && tFluid.getFluid()
- .isGaseous(tFluid)) {
+ .isGaseous(tFluid)) {
tFluid.amount -= 5;
sendSound((byte) 9);
if (tTemperature > 320) {
try {
for (EntityLivingBase tLiving : getBaseMetaTileEntity().getWorld()
- .getEntitiesWithinAABB(
- EntityLivingBase.class,
- AxisAlignedBB.getBoundingBox(
- getBaseMetaTileEntity().getXCoord()
- - 2,
- getBaseMetaTileEntity().getYCoord()
- - 2,
- getBaseMetaTileEntity().getZCoord()
- - 2,
- getBaseMetaTileEntity().getXCoord()
- + 3,
- getBaseMetaTileEntity().getYCoord()
- + 3,
- getBaseMetaTileEntity().getZCoord()
- + 3))) {
+ .getEntitiesWithinAABB(
+ EntityLivingBase.class,
+ AxisAlignedBB.getBoundingBox(
+ getBaseMetaTileEntity().getXCoord() - 2,
+ getBaseMetaTileEntity().getYCoord() - 2,
+ getBaseMetaTileEntity().getZCoord() - 2,
+ getBaseMetaTileEntity().getXCoord() + 3,
+ getBaseMetaTileEntity().getYCoord() + 3,
+ getBaseMetaTileEntity().getZCoord() + 3))) {
GT_Utility.applyHeatDamage(tLiving, (tTemperature - 300) / 25.0F);
}
} catch (Throwable e) {
@@ -357,21 +348,15 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
} else if (tTemperature < 260) {
try {
for (EntityLivingBase tLiving : getBaseMetaTileEntity().getWorld()
- .getEntitiesWithinAABB(
- EntityLivingBase.class,
- AxisAlignedBB.getBoundingBox(
- getBaseMetaTileEntity().getXCoord()
- - 2,
- getBaseMetaTileEntity().getYCoord()
- - 2,
- getBaseMetaTileEntity().getZCoord()
- - 2,
- getBaseMetaTileEntity().getXCoord()
- + 3,
- getBaseMetaTileEntity().getYCoord()
- + 3,
- getBaseMetaTileEntity().getZCoord()
- + 3))) {
+ .getEntitiesWithinAABB(
+ EntityLivingBase.class,
+ AxisAlignedBB.getBoundingBox(
+ getBaseMetaTileEntity().getXCoord() - 2,
+ getBaseMetaTileEntity().getYCoord() - 2,
+ getBaseMetaTileEntity().getZCoord() - 2,
+ getBaseMetaTileEntity().getXCoord() + 3,
+ getBaseMetaTileEntity().getYCoord() + 3,
+ getBaseMetaTileEntity().getZCoord() + 3))) {
GT_Utility.applyFrostDamage(tLiving, (270 - tTemperature) / 12.5F);
}
} catch (Throwable e) {
@@ -400,11 +385,11 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
final IGregTechTileEntity gTank = tTank instanceof IGregTechTileEntity ? (IGregTechTileEntity) tTank : null;
if (isConnectedAtSide(aSide) && tTank != null
- && (mLastReceivedFrom & (1 << aSide)) == 0
- && getBaseMetaTileEntity().getCoverInfoAtSide(aSide)
- .letsFluidOut(tFluid.getFluid())
- && (gTank == null || gTank.getCoverInfoAtSide(tSide)
- .letsFluidIn(tFluid.getFluid()))) {
+ && (mLastReceivedFrom & (1 << aSide)) == 0
+ && getBaseMetaTileEntity().getCoverInfoAtSide(aSide)
+ .letsFluidOut(tFluid.getFluid())
+ && (gTank == null || gTank.getCoverInfoAtSide(tSide)
+ .letsFluidIn(tFluid.getFluid()))) {
if (tTank.fill(ForgeDirection.getOrientation(tSide), tFluid, false) > 0) {
tTanks.add(new MutableTriple<>(tTank, ForgeDirection.getOrientation(tSide), 0));
}
@@ -436,10 +421,8 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
if (tEntry.right <= 0) continue;
- final int tFilledAmount = tEntry.left.fill(
- tEntry.middle,
- drainFromIndex(tEntry.right, false, index),
- false);
+ final int tFilledAmount = tEntry.left
+ .fill(tEntry.middle, drainFromIndex(tEntry.right, false, index), false);
if (tFilledAmount > 0) tEntry.left.fill(tEntry.middle, drainFromIndex(tFilledAmount, true, index), true);
@@ -449,7 +432,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
@Override
public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
- float aZ) {
+ float aZ) {
if (GT_Mod.gregtechproxy.gt6Pipe) {
final byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
final byte tMask = (byte) (1 << tSide);
@@ -477,25 +460,25 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
@Override
public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable,
- ICoverable aTileEntity) {
+ ICoverable aTileEntity) {
return coverBehavior.letsFluidIn(aSide, aCoverID, aCoverVariable, null, aTileEntity);
}
@Override
public boolean letsOut(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable,
- ICoverable aTileEntity) {
+ ICoverable aTileEntity) {
return coverBehavior.letsFluidOut(aSide, aCoverID, aCoverVariable, null, aTileEntity);
}
@Override
public boolean letsIn(GT_CoverBehaviorBase<?> coverBehavior, byte aSide, int aCoverID,
- ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ ISerializableObject aCoverVariable, ICoverable aTileEntity) {
return coverBehavior.letsFluidIn(aSide, aCoverID, aCoverVariable, null, aTileEntity);
}
@Override
public boolean letsOut(GT_CoverBehaviorBase<?> coverBehavior, byte aSide, int aCoverID,
- ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ ISerializableObject aCoverVariable, ICoverable aTileEntity) {
return coverBehavior.letsFluidOut(aSide, aCoverID, aCoverVariable, null, aTileEntity);
}
@@ -514,15 +497,15 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
if (tTileEntity == null) return false;
final byte tSide = (byte) ForgeDirection.getOrientation(aSide)
- .getOpposite()
- .ordinal();
+ .getOpposite()
+ .ordinal();
final IGregTechTileEntity baseMetaTile = getBaseMetaTileEntity();
if (baseMetaTile == null) return false;
final GT_CoverBehaviorBase<?> coverBehavior = baseMetaTile.getCoverBehaviorAtSideNew(aSide);
final IGregTechTileEntity gTileEntity = (tTileEntity instanceof IGregTechTileEntity)
- ? (IGregTechTileEntity) tTileEntity
- : null;
+ ? (IGregTechTileEntity) tTileEntity
+ : null;
if (coverBehavior instanceof GT_Cover_Drain || (GregTech_API.mTConstruct && isTConstructFaucet(tTileEntity)))
return true;
@@ -533,8 +516,8 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
final FluidTankInfo[] tInfo = fTileEntity.getTankInfo(ForgeDirection.getOrientation(tSide));
if (tInfo != null) {
return tInfo.length > 0 || (GregTech_API.mTranslocator && isTranslocator(tTileEntity))
- || gTileEntity != null
- && gTileEntity.getCoverBehaviorAtSideNew(tSide) instanceof GT_Cover_FluidRegulator;
+ || gTileEntity != null
+ && gTileEntity.getCoverBehaviorAtSideNew(tSide) instanceof GT_Cover_FluidRegulator;
}
}
return false;
@@ -565,18 +548,19 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
GT_Utility.doSoundAtClient(SoundResource.RANDOM_FIZZ, 5, 1.0F, aX, aY, aZ);
new ParticleEventBuilder().setIdentifier(ParticleFX.CLOUD)
- .setWorld(getBaseMetaTileEntity().getWorld())
- .<ParticleEventBuilder>times(
- 6,
- (x, i) -> x.setMotion(
- ForgeDirection.getOrientation(i).offsetX / 5.0,
- ForgeDirection.getOrientation(i).offsetY / 5.0,
- ForgeDirection.getOrientation(i).offsetZ / 5.0)
- .setPosition(
- aX - 0.5 + XSTR_INSTANCE.nextFloat(),
- aY - 0.5 + XSTR_INSTANCE.nextFloat(),
- aZ - 0.5 + XSTR_INSTANCE.nextFloat())
- .run());
+ .setWorld(getBaseMetaTileEntity().getWorld())
+ .<ParticleEventBuilder>times(
+ 6,
+ (x, i) -> x
+ .setMotion(
+ ForgeDirection.getOrientation(i).offsetX / 5.0,
+ ForgeDirection.getOrientation(i).offsetY / 5.0,
+ ForgeDirection.getOrientation(i).offsetZ / 5.0)
+ .setPosition(
+ aX - 0.5 + XSTR_INSTANCE.nextFloat(),
+ aY - 0.5 + XSTR_INSTANCE.nextFloat(),
+ aZ - 0.5 + XSTR_INSTANCE.nextFloat())
+ .run());
}
}
@@ -631,9 +615,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
@Override
public final int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
if (aFluid == null || aFluid.getFluid()
- .getID()
- <= 0)
- return 0;
+ .getID() <= 0) return 0;
int index = -1;
for (int i = 0; i < mPipeAmount; i++) {
@@ -641,10 +623,9 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
index = i;
break;
} else if ((mFluids[i] == null || mFluids[i].getFluid()
- .getID()
- <= 0) && index < 0) {
- index = i;
- }
+ .getID() <= 0) && index < 0) {
+ index = i;
+ }
}
return fill_default_intoIndex(aSide, aFluid, doFill, index);
@@ -653,13 +634,10 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
private int fill_default_intoIndex(ForgeDirection aSide, FluidStack aFluid, boolean doFill, int index) {
if (index < 0 || index >= mPipeAmount) return 0;
if (aFluid == null || aFluid.getFluid()
- .getID()
- <= 0)
- return 0;
+ .getID() <= 0) return 0;
if (mFluids[index] == null || mFluids[index].getFluid()
- .getID()
- <= 0) {
+ .getID() <= 0) {
if (aFluid.amount * mPipeAmount <= getCapacity()) {
if (doFill) {
mFluids[index] = aFluid.copy();
@@ -735,25 +713,25 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
public String[] getDescription() {
if (mPipeAmount == 1) {
return new String[] {
- EnumChatFormatting.BLUE + "Fluid Capacity: %%%"
- + GT_Utility.formatNumbers(mCapacity * 20L)
- + "%%% L/sec"
- + EnumChatFormatting.GRAY,
- EnumChatFormatting.RED + "Heat Limit: %%%"
- + GT_Utility.formatNumbers(mHeatResistance)
- + "%%% K"
- + EnumChatFormatting.GRAY };
+ EnumChatFormatting.BLUE + "Fluid Capacity: %%%"
+ + GT_Utility.formatNumbers(mCapacity * 20L)
+ + "%%% L/sec"
+ + EnumChatFormatting.GRAY,
+ EnumChatFormatting.RED + "Heat Limit: %%%"
+ + GT_Utility.formatNumbers(mHeatResistance)
+ + "%%% K"
+ + EnumChatFormatting.GRAY };
} else {
return new String[] {
- EnumChatFormatting.BLUE + "Fluid Capacity: %%%"
- + GT_Utility.formatNumbers(mCapacity * 20L)
- + "%%% L/sec"
- + EnumChatFormatting.GRAY,
- EnumChatFormatting.RED + "Heat Limit: %%%"
- + GT_Utility.formatNumbers(mHeatResistance)
- + "%%% K"
- + EnumChatFormatting.GRAY,
- EnumChatFormatting.AQUA + "Pipe Amount: %%%" + mPipeAmount + EnumChatFormatting.GRAY };
+ EnumChatFormatting.BLUE + "Fluid Capacity: %%%"
+ + GT_Utility.formatNumbers(mCapacity * 20L)
+ + "%%% L/sec"
+ + EnumChatFormatting.GRAY,
+ EnumChatFormatting.RED + "Heat Limit: %%%"
+ + GT_Utility.formatNumbers(mHeatResistance)
+ + "%%% K"
+ + EnumChatFormatting.GRAY,
+ EnumChatFormatting.AQUA + "Pipe Amount: %%%" + mPipeAmount + EnumChatFormatting.GRAY };
}
}
@@ -826,18 +804,13 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
if ((tConn & (1 << ForgeDirection.WEST.ordinal())) != 0) tSide4 = 0f;
if ((tConn & (1 << ForgeDirection.EAST.ordinal())) != 0) tSide5 = 1f;
- return AxisAlignedBB.getBoundingBox(
- aX + tSide4,
- aY + tSide0,
- aZ + tSide2,
- aX + tSide5,
- aY + tSide1,
- aZ + tSide3);
+ return AxisAlignedBB
+ .getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3);
}
@Override
public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB,
- List<AxisAlignedBB> outputAABB, Entity collider) {
+ List<AxisAlignedBB> outputAABB, Entity collider) {
super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) {
final AxisAlignedBB aabb = getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java
index 302155a186..9ccb43e733 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java
@@ -19,9 +19,8 @@ import gregtech.api.util.GT_OreDictUnificator;
public class GT_MetaPipeEntity_Frame extends MetaPipeEntity {
- private static final String localizedDescFormat = GT_LanguageManager.addStringLocalization(
- "gt.blockmachines.gt_frame.desc.format",
- "Just something you can put covers on.");
+ private static final String localizedDescFormat = GT_LanguageManager
+ .addStringLocalization("gt.blockmachines.gt_frame.desc.format", "Just something you can put covers on.");
public final Materials mMaterial;
public GT_MetaPipeEntity_Frame(int aID, String aName, String aNameRegional, Materials aMaterial) {
@@ -31,19 +30,19 @@ public class GT_MetaPipeEntity_Frame extends MetaPipeEntity {
GT_OreDictUnificator.registerOre(OrePrefixes.frameGt, aMaterial, getStackForm(1));
if (aMaterial.getProcessingMaterialTierEU() < TierEU.IV) {
GT_ModHandler.addCraftingRecipe(
- getStackForm(2),
- RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "SSS", "SwS", "SSS", 'S', OrePrefixes.stick.get(mMaterial) });
+ getStackForm(2),
+ RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] { "SSS", "SwS", "SSS", 'S', OrePrefixes.stick.get(mMaterial) });
}
if (!aMaterial.contains(SubTag.NO_RECIPES)) {
// Auto generate frame box recipe in an assembler.
RA.addAssemblerRecipe(
- GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 4),
- ItemList.Circuit_Integrated.getWithDamage(0, 4),
- getStackForm(1),
- 64,
- calculateRecipeEU(aMaterial, 7));
+ GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 4),
+ ItemList.Circuit_Integrated.getWithDamage(0, 4),
+ getStackForm(1),
+ 64,
+ calculateRecipeEU(aMaterial, 7));
}
}
@@ -64,10 +63,10 @@ public class GT_MetaPipeEntity_Frame extends MetaPipeEntity {
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections,
- byte aColorIndex, boolean aConnected, boolean aRedstone) {
+ byte aColorIndex, boolean aConnected, boolean aRedstone) {
return new ITexture[] { TextureFactory.of(
- mMaterial.mIconSet.mTextures[OrePrefixes.frameGt.mTextureIndex],
- Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) };
+ mMaterial.mIconSet.mTextures[OrePrefixes.frameGt.mTextureIndex],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) };
}
@Override
@@ -112,13 +111,13 @@ public class GT_MetaPipeEntity_Frame extends MetaPipeEntity {
@Override
public final boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide,
- ItemStack aStack) {
+ ItemStack aStack) {
return false;
}
@Override
public final boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide,
- ItemStack aStack) {
+ ItemStack aStack) {
return false;
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java
index 9e55aa94c7..f69170b83e 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java
@@ -52,7 +52,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
private int[] cacheSides;
public GT_MetaPipeEntity_Item(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial,
- int aInvSlotCount, int aStepSize, boolean aIsRestrictive, int aTickTime) {
+ int aInvSlotCount, int aStepSize, boolean aIsRestrictive, int aTickTime) {
super(aID, aName, aNameRegional, aInvSlotCount, false);
mIsRestrictive = aIsRestrictive;
mThickNess = aThickNess;
@@ -63,12 +63,12 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
}
public GT_MetaPipeEntity_Item(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial,
- int aInvSlotCount, int aStepSize, boolean aIsRestrictive) {
+ int aInvSlotCount, int aStepSize, boolean aIsRestrictive) {
this(aID, aName, aNameRegional, aThickNess, aMaterial, aInvSlotCount, aStepSize, aIsRestrictive, 20);
}
public GT_MetaPipeEntity_Item(String aName, float aThickNess, Materials aMaterial, int aInvSlotCount, int aStepSize,
- boolean aIsRestrictive, int aTickTime) {
+ boolean aIsRestrictive, int aTickTime) {
super(aName, aInvSlotCount);
mIsRestrictive = aIsRestrictive;
mThickNess = aThickNess;
@@ -85,87 +85,76 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
@Override
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaPipeEntity_Item(
- mName,
- mThickNess,
- mMaterial,
- mInventory.length,
- mStepSize,
- mIsRestrictive,
- mTickTime);
+ mName,
+ mThickNess,
+ mMaterial,
+ mInventory.length,
+ mStepSize,
+ mIsRestrictive,
+ mTickTime);
}
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections,
- byte aColorIndex, boolean aConnected, boolean aRedstone) {
+ byte aColorIndex, boolean aConnected, boolean aRedstone) {
if (mIsRestrictive) {
if (aConnected) {
float tThickNess = getThickNess();
- if (tThickNess < 0.124F)
- return new ITexture[] {
- TextureFactory.of(
- mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex],
- Dyes.getModulation(aColorIndex, mMaterial.mRGBa)),
- TextureFactory.of(PIPE_RESTRICTOR) };
+ if (tThickNess < 0.124F) return new ITexture[] { TextureFactory.of(
+ mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), TextureFactory.of(PIPE_RESTRICTOR) };
if (tThickNess < 0.374F) // 0.375
- return new ITexture[] {
- TextureFactory.of(
- mMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex],
- Dyes.getModulation(aColorIndex, mMaterial.mRGBa)),
- TextureFactory.of(PIPE_RESTRICTOR) };
+ return new ITexture[] { TextureFactory.of(
+ mMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), TextureFactory.of(PIPE_RESTRICTOR) };
if (tThickNess < 0.499F) // 0.500
- return new ITexture[] {
- TextureFactory.of(
- mMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex],
- Dyes.getModulation(aColorIndex, mMaterial.mRGBa)),
- TextureFactory.of(PIPE_RESTRICTOR) };
+ return new ITexture[] { TextureFactory.of(
+ mMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), TextureFactory.of(PIPE_RESTRICTOR) };
if (tThickNess < 0.749F) // 0.750
- return new ITexture[] {
- TextureFactory.of(
- mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex],
- Dyes.getModulation(aColorIndex, mMaterial.mRGBa)),
- TextureFactory.of(PIPE_RESTRICTOR) };
+ return new ITexture[] { TextureFactory.of(
+ mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), TextureFactory.of(PIPE_RESTRICTOR) };
if (tThickNess < 0.874F) // 0.825
- return new ITexture[] {
- TextureFactory.of(
- mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex],
- Dyes.getModulation(aColorIndex, mMaterial.mRGBa)),
- TextureFactory.of(PIPE_RESTRICTOR) };
- return new ITexture[] { TextureFactory.of(
- mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex],
+ return new ITexture[] { TextureFactory.of(
+ mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex],
Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), TextureFactory.of(PIPE_RESTRICTOR) };
+ return new ITexture[] { TextureFactory.of(
+ mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), TextureFactory.of(PIPE_RESTRICTOR) };
}
return new ITexture[] { TextureFactory.of(
- mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex],
- Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), TextureFactory.of(PIPE_RESTRICTOR) };
+ mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), TextureFactory.of(PIPE_RESTRICTOR) };
}
if (aConnected) {
float tThickNess = getThickNess();
if (tThickNess < 0.124F) return new ITexture[] { TextureFactory.of(
- mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex],
- Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) };
+ mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) };
if (tThickNess < 0.374F) // 0.375
return new ITexture[] { TextureFactory.of(
- mMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex],
- Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) };
+ mMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) };
if (tThickNess < 0.499F) // 0.500
return new ITexture[] { TextureFactory.of(
- mMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex],
- Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) };
+ mMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) };
if (tThickNess < 0.749F) // 0.750
return new ITexture[] { TextureFactory.of(
- mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex],
- Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) };
+ mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) };
if (tThickNess < 0.874F) // 0.825
return new ITexture[] { TextureFactory.of(
- mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex],
- Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) };
- return new ITexture[] { TextureFactory.of(
- mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex],
+ mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex],
Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) };
+ return new ITexture[] { TextureFactory.of(
+ mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) };
}
return new ITexture[] { TextureFactory.of(
- mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex],
- Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) };
+ mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) };
}
@Override
@@ -228,9 +217,10 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
for (boolean temp = true; temp && !isInventoryEmpty() && pipeCapacityCheck();) {
temp = false;
tPipeList.clear();
- for (IMetaTileEntityItemPipe tTileEntity : GT_Utility.sortMapByValuesAcending(
+ for (IMetaTileEntityItemPipe tTileEntity : GT_Utility
+ .sortMapByValuesAcending(
IMetaTileEntityItemPipe.Util.scanPipes(this, new HashMap<>(), 0, false, false))
- .keySet()) {
+ .keySet()) {
if (temp) break;
tPipeList.add(tTileEntity);
while (!temp && !isInventoryEmpty() && tTileEntity.sendItemStack(aBaseMetaTileEntity))
@@ -247,7 +237,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
@Override
public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
- float aZ) {
+ float aZ) {
if (GT_Mod.gregtechproxy.gt6Pipe) {
final byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
if (isConnectedAtSide(tSide)) {
@@ -263,25 +253,25 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
@Override
public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable,
- ICoverable aTileEntity) {
+ ICoverable aTileEntity) {
return coverBehavior.letsItemsIn(aSide, aCoverID, aCoverVariable, -1, aTileEntity);
}
@Override
public boolean letsOut(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable,
- ICoverable aTileEntity) {
+ ICoverable aTileEntity) {
return coverBehavior.letsItemsOut(aSide, aCoverID, aCoverVariable, -1, aTileEntity);
}
@Override
public boolean letsIn(GT_CoverBehaviorBase<?> coverBehavior, byte aSide, int aCoverID,
- ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ ISerializableObject aCoverVariable, ICoverable aTileEntity) {
return coverBehavior.letsItemsIn(aSide, aCoverID, aCoverVariable, -1, aTileEntity);
}
@Override
public boolean letsOut(GT_CoverBehaviorBase<?> coverBehavior, byte aSide, int aCoverID,
- ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ ISerializableObject aCoverVariable, ICoverable aTileEntity) {
return coverBehavior.letsItemsOut(aSide, aCoverID, aCoverVariable, -1, aTileEntity);
}
@@ -303,13 +293,12 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
boolean connectable = GT_Utility.isConnectableNonInventoryPipe(tTileEntity, tSide);
final IGregTechTileEntity gTileEntity = (tTileEntity instanceof IGregTechTileEntity)
- ? (IGregTechTileEntity) tTileEntity
- : null;
+ ? (IGregTechTileEntity) tTileEntity
+ : null;
if (gTileEntity != null) {
if (gTileEntity.getMetaTileEntity() == null) return false;
if (gTileEntity.getMetaTileEntity()
- .connectsToItemPipe(tSide))
- return true;
+ .connectsToItemPipe(tSide)) return true;
connectable = true;
}
@@ -346,7 +335,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
for (byte i : ALL_VALID_SIDES) {
tSide = (byte) ((i + tOffset) % 6);
if (isConnectedAtSide(tSide)
- && (isInventoryEmpty() || (tSide != mLastReceivedFrom || aSender != getBaseMetaTileEntity()))) {
+ && (isInventoryEmpty() || (tSide != mLastReceivedFrom || aSender != getBaseMetaTileEntity()))) {
if (insertItemStackIntoTileEntity(aSender, tSide)) return true;
}
}
@@ -357,23 +346,23 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
@Override
public boolean insertItemStackIntoTileEntity(Object aSender, byte aSide) {
if (getBaseMetaTileEntity().getCoverInfoAtSide(aSide)
- .letsItemsOut(-1)) {
+ .letsItemsOut(-1)) {
final TileEntity tInventory = getBaseMetaTileEntity().getTileEntityAtSide(aSide);
if (tInventory != null && !(tInventory instanceof BaseMetaPipeEntity)) {
if ((!(tInventory instanceof TileEntityHopper) && !(tInventory instanceof TileEntityDispenser))
- || getBaseMetaTileEntity().getMetaIDAtSide(aSide) != GT_Utility.getOppositeSide(aSide)) {
+ || getBaseMetaTileEntity().getMetaIDAtSide(aSide) != GT_Utility.getOppositeSide(aSide)) {
return GT_Utility.moveMultipleItemStacks(
- aSender,
- tInventory,
- (byte) 6,
- GT_Utility.getOppositeSide(aSide),
- null,
- false,
- (byte) 64,
- (byte) 1,
- (byte) 64,
- (byte) 1,
- 1) > 0;
+ aSender,
+ tInventory,
+ (byte) 6,
+ GT_Utility.getOppositeSide(aSide),
+ null,
+ false,
+ (byte) 64,
+ (byte) 1,
+ (byte) 64,
+ (byte) 1,
+ 1) > 0;
}
}
}
@@ -443,13 +432,13 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
@Override
public String[] getDescription() {
if (mTickTime == 20) return new String[] { "Item Capacity: %%%" + getMaxPipeCapacity() + "%%% Stacks/sec",
- "Routing Value: %%%" + GT_Utility.formatNumbers(mStepSize) };
+ "Routing Value: %%%" + GT_Utility.formatNumbers(mStepSize) };
else if (mTickTime % 20 == 0) return new String[] {
- "Item Capacity: %%%" + getMaxPipeCapacity() + "%%% Stacks/%%%" + (mTickTime / 20) + "%%% sec",
- "Routing Value: %%%" + GT_Utility.formatNumbers(mStepSize) };
+ "Item Capacity: %%%" + getMaxPipeCapacity() + "%%% Stacks/%%%" + (mTickTime / 20) + "%%% sec",
+ "Routing Value: %%%" + GT_Utility.formatNumbers(mStepSize) };
else return new String[] {
- "Item Capacity: %%%" + getMaxPipeCapacity() + "%%% Stacks/%%%" + mTickTime + "%%% ticks",
- "Routing Value: %%%" + GT_Utility.formatNumbers(mStepSize) };
+ "Item Capacity: %%%" + getMaxPipeCapacity() + "%%% Stacks/%%%" + mTickTime + "%%% ticks",
+ "Routing Value: %%%" + GT_Utility.formatNumbers(mStepSize) };
}
private boolean isInventoryEmpty() {
@@ -512,18 +501,13 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
if ((tConn & (1 << ForgeDirection.WEST.ordinal())) != 0) tSide4 = 0f;
if ((tConn & (1 << ForgeDirection.EAST.ordinal())) != 0) tSide5 = 1f;
- return AxisAlignedBB.getBoundingBox(
- aX + tSide4,
- aY + tSide0,
- aZ + tSide2,
- aX + tSide5,
- aY + tSide1,
- aZ + tSide3);
+ return AxisAlignedBB
+ .getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3);
}
@Override
public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB,
- List<AxisAlignedBB> outputAABB, Entity collider) {
+ List<AxisAlignedBB> outputAABB, Entity collider) {
super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) {
final AxisAlignedBB aabb = getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java
index bae070f6dd..ad6a730863 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java
@@ -39,7 +39,7 @@ import ic2.api.item.IElectricItem;
* Machine
*/
public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_TieredMachineBlock
- implements IAddUIWidgets {
+ implements IAddUIWidgets {
public boolean mCharge = false, mDecharge = false;
public int mBatteryCount = 0, mChargeableCount = 0;
@@ -48,17 +48,17 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
private long mMax = 0;
public GT_MetaTileEntity_BasicBatteryBuffer(int aID, String aName, String aNameRegional, int aTier,
- String aDescription, int aSlotCount) {
+ String aDescription, int aSlotCount) {
super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription);
}
public GT_MetaTileEntity_BasicBatteryBuffer(String aName, int aTier, String aDescription, ITexture[][][] aTextures,
- int aSlotCount) {
+ int aSlotCount) {
super(aName, aTier, aSlotCount, aDescription, aTextures);
}
public GT_MetaTileEntity_BasicBatteryBuffer(String aName, int aTier, String[] aDescription,
- ITexture[][][] aTextures, int aSlotCount) {
+ ITexture[][][] aTextures, int aSlotCount) {
super(aName, aTier, aSlotCount, aDescription, aTextures);
}
@@ -76,16 +76,16 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
for (byte i = -1; i < 16; i++) {
rTextures[0][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1] };
rTextures[1][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
- mInventory.length == 16 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_POWER[mTier]
- : mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]
- : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] };
+ mInventory.length == 16 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_POWER[mTier]
+ : mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]
+ : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] };
}
return rTextures;
}
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
- boolean aActive, boolean aRedstone) {
+ boolean aActive, boolean aRedstone) {
return mTextures[aSide == aFacing ? 1 : 0][aColorIndex + 1];
}
@@ -238,13 +238,13 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
@Override
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
if (GT_ModHandler.isElectricItem(aStack) && aStack.getUnlocalizedName()
- .startsWith("gt.metaitem.01.")) {
+ .startsWith("gt.metaitem.01.")) {
String name = aStack.getUnlocalizedName();
if (name.equals("gt.metaitem.01.32510") || name.equals("gt.metaitem.01.32511")
- || name.equals("gt.metaitem.01.32520")
- || name.equals("gt.metaitem.01.32521")
- || name.equals("gt.metaitem.01.32530")
- || name.equals("gt.metaitem.01.32531")) {
+ || name.equals("gt.metaitem.01.32520")
+ || name.equals("gt.metaitem.01.32521")
+ || name.equals("gt.metaitem.01.32530")
+ || name.equals("gt.metaitem.01.32531")) {
if (ic2.api.item.ElectricItem.manager.getCharge(aStack) == 0) {
return true;
}
@@ -313,16 +313,15 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
updateStorageInfo();
return new String[] { EnumChatFormatting.BLUE + getLocalName() + EnumChatFormatting.RESET, "Stored Items:",
- EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mStored)
- + EnumChatFormatting.RESET
- + " EU / "
- + EnumChatFormatting.YELLOW
- + GT_Utility.formatNumbers(mMax)
- + EnumChatFormatting.RESET
- + " EU",
- "Average input:", GT_Utility.formatNumbers(getBaseMetaTileEntity().getAverageElectricInput()) + " EU/t",
- "Average output:",
- GT_Utility.formatNumbers(getBaseMetaTileEntity().getAverageElectricOutput()) + " EU/t" };
+ EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mStored)
+ + EnumChatFormatting.RESET
+ + " EU / "
+ + EnumChatFormatting.YELLOW
+ + GT_Utility.formatNumbers(mMax)
+ + EnumChatFormatting.RESET
+ + " EU",
+ "Average input:", GT_Utility.formatNumbers(getBaseMetaTileEntity().getAverageElectricInput()) + " EU/t",
+ "Average output:", GT_Utility.formatNumbers(getBaseMetaTileEntity().getAverageElectricOutput()) + " EU/t" };
}
private void updateStorageInfo() {
@@ -336,31 +335,31 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
@Override
public void getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
- IWailaConfigHandler config) {
+ IWailaConfigHandler config) {
NBTTagCompound tag = accessor.getNBTData();
currenttip.add(
- StatCollector.translateToLocalFormatted(
- "GT5U.waila.energy.stored",
- GT_Utility.formatNumbers(tag.getLong("mStored")),
- GT_Utility.formatNumbers(tag.getLong("mMax"))));
+ StatCollector.translateToLocalFormatted(
+ "GT5U.waila.energy.stored",
+ GT_Utility.formatNumbers(tag.getLong("mStored")),
+ GT_Utility.formatNumbers(tag.getLong("mMax"))));
long avgIn = tag.getLong("AvgIn");
long avgOut = tag.getLong("AvgOut");
currenttip.add(
- StatCollector.translateToLocalFormatted(
- "GT5U.waila.energy.avg_in",
- GT_Utility.formatNumbers(avgIn),
- GT_Utility.getColoredTierNameFromVoltage(avgIn)));
+ StatCollector.translateToLocalFormatted(
+ "GT5U.waila.energy.avg_in",
+ GT_Utility.formatNumbers(avgIn),
+ GT_Utility.getColoredTierNameFromVoltage(avgIn)));
currenttip.add(
- StatCollector.translateToLocalFormatted(
- "GT5U.waila.energy.avg_out",
- GT_Utility.formatNumbers(avgOut),
- GT_Utility.getColoredTierNameFromVoltage(avgOut)));
+ StatCollector.translateToLocalFormatted(
+ "GT5U.waila.energy.avg_out",
+ GT_Utility.formatNumbers(avgOut),
+ GT_Utility.getColoredTierNameFromVoltage(avgOut)));
super.getWailaBody(itemStack, currenttip, accessor, config);
}
@Override
public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y,
- int z) {
+ int z) {
updateStorageInfo();
super.getWailaNBTData(player, tile, tag, world, x, y, z);
tag.setLong("mStored", mStored);
@@ -383,61 +382,61 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
switch (mInventory.length) {
case 4 -> builder.widget(
- SlotGroup.ofItemHandler(inventoryHandler, 2)
- .startFromSlot(0)
- .endAtSlot(3)
- .slotCreator(index -> new BaseSlot(inventoryHandler, index) {
-
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
- })
- .background(getGUITextureSet().getItemSlot())
- .build()
- .setPos(70, 25));
+ SlotGroup.ofItemHandler(inventoryHandler, 2)
+ .startFromSlot(0)
+ .endAtSlot(3)
+ .slotCreator(index -> new BaseSlot(inventoryHandler, index) {
+
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
+ })
+ .background(getGUITextureSet().getItemSlot())
+ .build()
+ .setPos(70, 25));
case 9 -> builder.widget(
- SlotGroup.ofItemHandler(inventoryHandler, 3)
- .startFromSlot(0)
- .endAtSlot(8)
- .slotCreator(index -> new BaseSlot(inventoryHandler, index) {
-
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
- })
- .background(getGUITextureSet().getItemSlot())
- .build()
- .setPos(61, 16));
+ SlotGroup.ofItemHandler(inventoryHandler, 3)
+ .startFromSlot(0)
+ .endAtSlot(8)
+ .slotCreator(index -> new BaseSlot(inventoryHandler, index) {
+
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
+ })
+ .background(getGUITextureSet().getItemSlot())
+ .build()
+ .setPos(61, 16));
case 16 -> builder.widget(
- SlotGroup.ofItemHandler(inventoryHandler, 4)
- .startFromSlot(0)
- .endAtSlot(15)
- .slotCreator(index -> new BaseSlot(inventoryHandler, index) {
-
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
- })
- .background(getGUITextureSet().getItemSlot())
- .build()
- .setPos(52, 7));
+ SlotGroup.ofItemHandler(inventoryHandler, 4)
+ .startFromSlot(0)
+ .endAtSlot(15)
+ .slotCreator(index -> new BaseSlot(inventoryHandler, index) {
+
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
+ })
+ .background(getGUITextureSet().getItemSlot())
+ .build()
+ .setPos(52, 7));
default -> builder.widget(
- SlotGroup.ofItemHandler(inventoryHandler, 1)
- .startFromSlot(0)
- .endAtSlot(0)
- .slotCreator(index -> new BaseSlot(inventoryHandler, index) {
-
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
- })
- .background(getGUITextureSet().getItemSlot())
- .build()
- .setPos(79, 34));
+ SlotGroup.ofItemHandler(inventoryHandler, 1)
+ .startFromSlot(0)
+ .endAtSlot(0)
+ .slotCreator(index -> new BaseSlot(inventoryHandler, index) {
+
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
+ })
+ .background(getGUITextureSet().getItemSlot())
+ .build()
+ .setPos(79, 34));
}
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java
index 182b25fb92..ef7242b420 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java
@@ -25,12 +25,12 @@ import gregtech.common.GT_Pollution;
public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity_BasicTank {
public GT_MetaTileEntity_BasicGenerator(int aID, String aName, String aNameRegional, int aTier, String aDescription,
- ITexture... aTextures) {
+ ITexture... aTextures) {
super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
}
public GT_MetaTileEntity_BasicGenerator(int aID, String aName, String aNameRegional, int aTier,
- String[] aDescription, ITexture... aTextures) {
+ String[] aDescription, ITexture... aTextures) {
super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
}
@@ -62,10 +62,9 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
- boolean aActive, boolean aRedstone) {
+ boolean aActive, boolean aRedstone) {
return mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0
- : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex
- + 1];
+ : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1];
}
@Override
@@ -214,21 +213,21 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity
if (mInventory[getStackDisplaySlot()] == null)
mInventory[getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1);
mInventory[getStackDisplaySlot()].setStackDisplayName(
- "Draining internal buffer: "
- + GT_Utility.formatNumbers(
- aBaseMetaTileEntity.getUniversalEnergyStored() - getMinimumStoredEU())
- + " EU");
+ "Draining internal buffer: "
+ + GT_Utility.formatNumbers(
+ aBaseMetaTileEntity.getUniversalEnergyStored() - getMinimumStoredEU())
+ + " EU");
}
} else {
long tFuelValue = getFuelValue(mFluid), tConsumed = consumedFluidPerOperation(mFluid);
if (tFuelValue > 0 && tConsumed > 0 && mFluid.amount >= tConsumed) {
long tFluidAmountToUse = Math.min(
- mFluid.amount / tConsumed,
- (maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue);
+ mFluid.amount / tConsumed,
+ (maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue);
// long tFluidAmountToUse = Math.min(mFluid.amount / tConsumed, (maxEUOutput() * 20 +
// getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue);//TODO CHECK
if (tFluidAmountToUse > 0
- && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) {
+ && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) {
// divided by two because this is called every 10 ticks, not 20
GT_Pollution.addPollution(getBaseMetaTileEntity(), getPollution() / 2);
mFluid.amount -= tFluidAmountToUse * tConsumed;
@@ -237,9 +236,9 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity
}
if (mInventory[getInputSlot()] != null
- && aBaseMetaTileEntity.getUniversalEnergyStored() < (maxEUOutput() * 20 + getMinimumStoredEU())
- && ((GT_Utility.getFluidForFilledItem(mInventory[getInputSlot()], true) != null)
- || solidFuelOverride(mInventory[getInputSlot()]))) {
+ && aBaseMetaTileEntity.getUniversalEnergyStored() < (maxEUOutput() * 20 + getMinimumStoredEU())
+ && ((GT_Utility.getFluidForFilledItem(mInventory[getInputSlot()], true) != null)
+ || solidFuelOverride(mInventory[getInputSlot()]))) {
long tFuelValue = getFuelValue(mInventory[getInputSlot()]);
if (tFuelValue <= 0) tFuelValue = getFuelValue(mInventory[getInputSlot()], true);
// System.out.println(" tFuelValue : " + tFuelValue );
@@ -256,8 +255,8 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity
}
if (aBaseMetaTileEntity.isServerSide()) aBaseMetaTileEntity.setActive(
- aBaseMetaTileEntity.isAllowedToWork()
- && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU());
+ aBaseMetaTileEntity.isAllowedToWork()
+ && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU());
}
/**
@@ -270,18 +269,18 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity
// if it is a gregtech Item, make sure its not a VOLUMETRIC_FLASK or any type of cell, else do vanilla checks
if (association != null) {
return !OrePrefixes.CELL_TYPES.contains(association.mPrefix)
- && !GT_Utility.areStacksEqual(ItemList.VOLUMETRIC_FLASK.get(1L), stack, true);
+ && !GT_Utility.areStacksEqual(ItemList.VOLUMETRIC_FLASK.get(1L), stack, true);
} else {
return stack != null && // when the stack is null its not a solid
- stack.getItem() != null && // when the item in the stack is null its not a solid
- !(stack.getItem() instanceof IFluidContainerItem) && // when the item is a fluid container its not a
- // solid...
- !(stack.getItem() instanceof IFluidHandler) && // when the item is a fluid handler its not a
- // solid...
- !stack.getItem()
- .getUnlocalizedName()
- .contains("bucket"); // since we cant really check for
- // buckets...
+ stack.getItem() != null && // when the item in the stack is null its not a solid
+ !(stack.getItem() instanceof IFluidContainerItem) && // when the item is a fluid container its not a
+ // solid...
+ !(stack.getItem() instanceof IFluidHandler) && // when the item is a fluid handler its not a
+ // solid...
+ !stack.getItem()
+ .getUnlocalizedName()
+ .contains("bucket"); // since we cant really check for
+ // buckets...
}
}
@@ -333,7 +332,7 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity
@Override
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && (getFuelValue(aStack, true) > 0
- || getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true), true) > 0);
+ || getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true), true) > 0);
}
@Override
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull.java
index cb9c670f05..ff1365a735 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull.java
@@ -13,22 +13,22 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
public class GT_MetaTileEntity_BasicHull extends GT_MetaTileEntity_BasicTank {
public GT_MetaTileEntity_BasicHull(int aID, String aName, String aNameRegional, int aTier, String aDescription,
- ITexture... aTextures) {
+ ITexture... aTextures) {
super(aID, aName, aNameRegional, aTier, 1, aDescription, aTextures);
}
public GT_MetaTileEntity_BasicHull(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount,
- String aDescription, ITexture... aTextures) {
+ String aDescription, ITexture... aTextures) {
super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures);
}
public GT_MetaTileEntity_BasicHull(String aName, int aTier, int aInvSlotCount, String aDescription,
- ITexture[][][] aTextures) {
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
public GT_MetaTileEntity_BasicHull(String aName, int aTier, int aInvSlotCount, String[] aDescription,
- ITexture[][][] aTextures) {
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
@@ -114,7 +114,7 @@ public class GT_MetaTileEntity_BasicHull extends GT_MetaTileEntity_BasicTank {
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
- boolean aConnected, boolean aRedstone) {
+ boolean aConnected, boolean aRedstone) {
return mTextures[Math.min(2, aSide) + (aSide == aFacing ? 3 : 0)][aColorIndex + 1];
}
@@ -126,11 +126,11 @@ public class GT_MetaTileEntity_BasicHull extends GT_MetaTileEntity_BasicTank {
rTextures[1][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1] };
rTextures[2][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1] };
rTextures[3][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] };
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] };
rTextures[4][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] };
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] };
rTextures[5][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] };
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] };
}
return rTextures;
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull_NonElectric.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull_NonElectric.java
index 1296d846af..c9b66e6baf 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull_NonElectric.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull_NonElectric.java
@@ -6,23 +6,23 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
public abstract class GT_MetaTileEntity_BasicHull_NonElectric extends GT_MetaTileEntity_BasicHull {
public GT_MetaTileEntity_BasicHull_NonElectric(int aID, String aName, String aNameRegional, int aTier,
- String aDescription) {
+ String aDescription) {
super(aID, aName, aNameRegional, aTier, aDescription);
}
public GT_MetaTileEntity_BasicHull_NonElectric(String aName, int aTier, String aDescription,
- ITexture[][][] aTextures) {
+ ITexture[][][] aTextures) {
super(aName, aTier, 1, aDescription, aTextures);
}
public GT_MetaTileEntity_BasicHull_NonElectric(String aName, int aTier, String[] aDescription,
- ITexture[][][] aTextures) {
+ ITexture[][][] aTextures) {
super(aName, aTier, 1, aDescription, aTextures);
}
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections,
- byte aColorIndex, boolean aConnected, boolean aRedstone) {
+ byte aColorIndex, boolean aConnected, boolean aRedstone) {
return mTextures[Math.min(2, aSide)][aColorIndex + 1];
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java
index 49b76b1579..4868200bf1 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java
@@ -87,19 +87,19 @@ import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_Cleanroom;
* Machine
*/
public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_BasicTank
- implements IConfigurationCircuitSupport, IAddGregtechLogo, IAddUIWidgets {
+ implements IConfigurationCircuitSupport, IAddGregtechLogo, IAddUIWidgets {
/**
* return values for checkRecipe()
*/
protected static final int DID_NOT_FIND_RECIPE = 0, FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1,
- FOUND_AND_SUCCESSFULLY_USED_RECIPE = 2;
+ FOUND_AND_SUCCESSFULLY_USED_RECIPE = 2;
public static final int OTHER_SLOT_COUNT = 5;
public final ItemStack[] mOutputItems;
public final int mInputSlotCount, mAmperage;
public boolean mAllowInputFromOutputSide = false, mFluidTransfer = false, mItemTransfer = false,
- mHasBeenUpdated = false, mStuttering = false, mCharge = false, mDecharge = false;
+ mHasBeenUpdated = false, mStuttering = false, mCharge = false, mDecharge = false;
public boolean mDisableFilter = true;
public boolean mDisableMultiStack = true;
public int mMainFacing = -1, mProgresstime = 0, mMaxProgresstime = 0, mEUt = 0, mOutputBlocked = 0;
@@ -124,16 +124,16 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
* SideFacingPipeInactive
*/
public GT_MetaTileEntity_BasicMachine(int aID, String aName, String aNameRegional, int aTier, int aAmperage,
- String aDescription, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName,
- ITexture... aOverlays) {
+ String aDescription, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName,
+ ITexture... aOverlays) {
super(
- aID,
- aName,
- aNameRegional,
- aTier,
- OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1,
- aDescription,
- aOverlays);
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1,
+ aDescription,
+ aOverlays);
mInputSlotCount = Math.max(0, aInputSlotCount);
mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)];
mAmperage = aAmperage;
@@ -143,16 +143,16 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
}
public GT_MetaTileEntity_BasicMachine(int aID, String aName, String aNameRegional, int aTier, int aAmperage,
- String[] aDescription, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName,
- ITexture... aOverlays) {
+ String[] aDescription, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName,
+ ITexture... aOverlays) {
super(
- aID,
- aName,
- aNameRegional,
- aTier,
- OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1,
- aDescription,
- aOverlays);
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1,
+ aDescription,
+ aOverlays);
mInputSlotCount = Math.max(0, aInputSlotCount);
mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)];
mAmperage = aAmperage;
@@ -162,7 +162,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
}
public GT_MetaTileEntity_BasicMachine(String aName, int aTier, int aAmperage, String aDescription,
- ITexture[][][] aTextures, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName) {
+ ITexture[][][] aTextures, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName) {
super(aName, aTier, OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, aDescription, aTextures);
mInputSlotCount = Math.max(0, aInputSlotCount);
mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)];
@@ -173,7 +173,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
}
public GT_MetaTileEntity_BasicMachine(String aName, int aTier, int aAmperage, String[] aDescription,
- ITexture[][][] aTextures, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName) {
+ ITexture[][][] aTextures, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName) {
super(aName, aTier, OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, aDescription, aTextures);
mInputSlotCount = Math.max(0, aInputSlotCount);
mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)];
@@ -236,7 +236,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
- boolean aActive, boolean aRedstone) {
+ boolean aActive, boolean aRedstone) {
final int textureIndex;
if (mMainFacing < 2) {
if (aSide == aFacing) {
@@ -293,8 +293,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
@Override
public boolean isValidSlot(int aIndex) {
return aIndex > 0 && super.isValidSlot(aIndex)
- && aIndex != getCircuitSlot()
- && aIndex != OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length;
+ && aIndex != getCircuitSlot()
+ && aIndex != OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length;
}
@Override
@@ -514,20 +514,20 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
@Override
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
return new GT_GUIContainer_BasicMachine(
- aPlayerInventory,
- aBaseMetaTileEntity,
- getLocalName(),
- mGUIName,
- GT_Utility.isStringValid(mNEIName) ? mNEIName
- : getRecipeList() != null ? getRecipeList().mUnlocalizedName : "");
+ aPlayerInventory,
+ aBaseMetaTileEntity,
+ getLocalName(),
+ mGUIName,
+ GT_Utility.isStringValid(mNEIName) ? mNEIName
+ : getRecipeList() != null ? getRecipeList().mUnlocalizedName : "");
}
@Override
public void initDefaultModes(NBTTagCompound aNBT) {
mMainFacing = -1;
if (!getBaseMetaTileEntity().getWorld().isRemote) {
- GT_ClientPreference tPreference = GT_Mod.gregtechproxy.getClientPreference(
- getBaseMetaTileEntity().getOwnerUuid());
+ GT_ClientPreference tPreference = GT_Mod.gregtechproxy
+ .getClientPreference(getBaseMetaTileEntity().getOwnerUuid());
if (tPreference != null) {
mDisableFilter = !tPreference.isSingleBlockInitialFilterEnabled();
mDisableMultiStack = !tPreference.isSingleBlockInitialMultiStackEnabled();
@@ -592,9 +592,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
if (mProgresstime < 0 || drainEnergyForProcess(mEUt)) {
if (++mProgresstime >= mMaxProgresstime) {
for (int i = 0; i < mOutputItems.length; i++)
- for (int j = 0; j < mOutputItems.length; j++) if (aBaseMetaTileEntity.addStackToSlot(
- getOutputSlot() + ((j + i) % mOutputItems.length),
- mOutputItems[i]))
+ for (int j = 0; j < mOutputItems.length; j++) if (aBaseMetaTileEntity
+ .addStackToSlot(getOutputSlot() + ((j + i) % mOutputItems.length), mOutputItems[i]))
break;
if (mOutputFluid != null)
if (getDrainableStack() == null) setDrainableStack(mOutputFluid.copy());
@@ -629,47 +628,45 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
boolean tRemovedOutputFluid = false;
if (doesAutoOutputFluids() && getDrainableStack() != null
- && aBaseMetaTileEntity.getFrontFacing() != mMainFacing
- && (tSucceeded || aTick % 20 == 0)) {
+ && aBaseMetaTileEntity.getFrontFacing() != mMainFacing
+ && (tSucceeded || aTick % 20 == 0)) {
IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide(aBaseMetaTileEntity.getFrontFacing());
if (tTank != null) {
FluidStack tDrained = drain(1000, false);
if (tDrained != null) {
- int tFilledAmount = tTank.fill(
- ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()),
- tDrained,
- false);
+ int tFilledAmount = tTank
+ .fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tDrained, false);
if (tFilledAmount > 0) tTank.fill(
- ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()),
- drain(tFilledAmount, true),
- true);
+ ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()),
+ drain(tFilledAmount, true),
+ true);
}
}
if (getDrainableStack() == null) tRemovedOutputFluid = true;
}
if (doesAutoOutput() && !isOutputEmpty()
- && aBaseMetaTileEntity.getFrontFacing() != mMainFacing
- && (tSucceeded || mOutputBlocked % 300 == 1
- || aBaseMetaTileEntity.hasInventoryBeenModified()
- || aTick % 600 == 0)) {
+ && aBaseMetaTileEntity.getFrontFacing() != mMainFacing
+ && (tSucceeded || mOutputBlocked % 300 == 1
+ || aBaseMetaTileEntity.hasInventoryBeenModified()
+ || aTick % 600 == 0)) {
TileEntity tTileEntity2 = aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getFrontFacing());
long tStoredEnergy = aBaseMetaTileEntity.getUniversalEnergyStored();
int tMaxStacks = (int) (tStoredEnergy / 64L);
if (tMaxStacks > mOutputItems.length) tMaxStacks = mOutputItems.length;
moveMultipleItemStacks(
- aBaseMetaTileEntity,
- tTileEntity2,
- aBaseMetaTileEntity.getFrontFacing(),
- aBaseMetaTileEntity.getBackFacing(),
- null,
- false,
- (byte) 64,
- (byte) 1,
- (byte) 64,
- (byte) 1,
- tMaxStacks);
+ aBaseMetaTileEntity,
+ tTileEntity2,
+ aBaseMetaTileEntity.getFrontFacing(),
+ aBaseMetaTileEntity.getBackFacing(),
+ null,
+ false,
+ (byte) 64,
+ (byte) 1,
+ (byte) 64,
+ (byte) 1,
+ tMaxStacks);
// for (int i = 0, tCosts = 1; i < mOutputItems.length && tCosts > 0 &&
// aBaseMetaTileEntity.isUniversalEnergyStored(128); i++) {
// tCosts = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, tTileEntity2,
@@ -684,11 +681,11 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
if (allowToCheckRecipe()) {
if (mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork()
- && (tRemovedOutputFluid || tSucceeded
- || aBaseMetaTileEntity.hasInventoryBeenModified()
- || aTick % 600 == 0
- || aBaseMetaTileEntity.hasWorkJustBeenEnabled())
- && hasEnoughEnergyToCheckRecipe()) {
+ && (tRemovedOutputFluid || tSucceeded
+ || aBaseMetaTileEntity.hasInventoryBeenModified()
+ || aTick % 600 == 0
+ || aBaseMetaTileEntity.hasWorkJustBeenEnabled())
+ && hasEnoughEnergyToCheckRecipe()) {
if (checkRecipe() == FOUND_AND_SUCCESSFULLY_USED_RECIPE) {
if (getSpecialSlot() != null && getSpecialSlot().stackSize <= 0)
mInventory[getSpecialSlotIndex()] = null;
@@ -755,10 +752,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
if (ItemList.Display_Fluid.isStackEqual(mInventory[tDisplayStackSlot], true, true))
mInventory[tDisplayStackSlot] = null;
} else {
- mInventory[tDisplayStackSlot] = GT_Utility.getFluidDisplayStack(
- getFillableStack(),
- true,
- !displaysStackSize());
+ mInventory[tDisplayStackSlot] = GT_Utility
+ .getFluidDisplayStack(getFillableStack(), true, !displaysStackSize());
}
}
}
@@ -803,7 +798,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
protected boolean canOutput(GT_Recipe aRecipe) {
return aRecipe != null && (aRecipe.mNeedsEmptyOutput ? isOutputEmpty() && getDrainableStack() == null
- : canOutput(aRecipe.getFluidOutput(0)) && canOutput(aRecipe.mOutputs));
+ : canOutput(aRecipe.getFluidOutput(0)) && canOutput(aRecipe.mOutputs));
}
protected boolean canOutput(ItemStack... aOutputs) {
@@ -811,11 +806,11 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
ItemStack[] tOutputSlots = getAllOutputs();
for (int i = 0; i < tOutputSlots.length && i < aOutputs.length; i++)
if (tOutputSlots[i] != null && aOutputs[i] != null
- && (!GT_Utility.areStacksEqual(tOutputSlots[i], aOutputs[i], false)
- || tOutputSlots[i].stackSize + aOutputs[i].stackSize > tOutputSlots[i].getMaxStackSize())) {
- mOutputBlocked++;
- return false;
- }
+ && (!GT_Utility.areStacksEqual(tOutputSlots[i], aOutputs[i], false)
+ || tOutputSlots[i].stackSize + aOutputs[i].stackSize > tOutputSlots[i].getMaxStackSize())) {
+ mOutputBlocked++;
+ return false;
+ }
return true;
}
@@ -929,29 +924,29 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
@Override
public String[] getInfoData() {
return new String[] { EnumChatFormatting.BLUE + mNEIName + EnumChatFormatting.RESET, "Progress:",
- EnumChatFormatting.GREEN + GT_Utility.formatNumbers((mProgresstime / 20))
- + EnumChatFormatting.RESET
- + " s / "
- + EnumChatFormatting.YELLOW
- + GT_Utility.formatNumbers(mMaxProgresstime / 20)
- + EnumChatFormatting.RESET
- + " s",
- "Stored Energy:",
- EnumChatFormatting.GREEN + GT_Utility.formatNumbers(getBaseMetaTileEntity().getStoredEU())
- + EnumChatFormatting.RESET
- + " EU / "
- + EnumChatFormatting.YELLOW
- + GT_Utility.formatNumbers(getBaseMetaTileEntity().getEUCapacity())
- + EnumChatFormatting.RESET
- + " EU",
- "Probably uses: " + EnumChatFormatting.RED
- + GT_Utility.formatNumbers(mEUt)
- + EnumChatFormatting.RESET
- + " EU/t at "
- + EnumChatFormatting.RED
- + GT_Utility.formatNumbers(mEUt == 0 ? 0 : mAmperage)
- + EnumChatFormatting.RESET
- + " A" };
+ EnumChatFormatting.GREEN + GT_Utility.formatNumbers((mProgresstime / 20))
+ + EnumChatFormatting.RESET
+ + " s / "
+ + EnumChatFormatting.YELLOW
+ + GT_Utility.formatNumbers(mMaxProgresstime / 20)
+ + EnumChatFormatting.RESET
+ + " s",
+ "Stored Energy:",
+ EnumChatFormatting.GREEN + GT_Utility.formatNumbers(getBaseMetaTileEntity().getStoredEU())
+ + EnumChatFormatting.RESET
+ + " EU / "
+ + EnumChatFormatting.YELLOW
+ + GT_Utility.formatNumbers(getBaseMetaTileEntity().getEUCapacity())
+ + EnumChatFormatting.RESET
+ + " EU",
+ "Probably uses: " + EnumChatFormatting.RED
+ + GT_Utility.formatNumbers(mEUt)
+ + EnumChatFormatting.RESET
+ + " EU/t at "
+ + EnumChatFormatting.RED
+ + GT_Utility.formatNumbers(mEUt == 0 ? 0 : mAmperage)
+ + EnumChatFormatting.RESET
+ + " A" };
}
@Override
@@ -965,29 +960,29 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
if (aPlayer.isSneaking()) {
mDisableFilter = !mDisableFilter;
GT_Utility.sendChatToPlayer(
- aPlayer,
- StatCollector.translateToLocal("GT5U.hatch.disableFilter." + mDisableFilter));
+ aPlayer,
+ StatCollector.translateToLocal("GT5U.hatch.disableFilter." + mDisableFilter));
} else {
mAllowInputFromOutputSide = !mAllowInputFromOutputSide;
GT_Utility.sendChatToPlayer(
- aPlayer,
- mAllowInputFromOutputSide ? GT_Utility.trans("095", "Input from Output Side allowed")
- : GT_Utility.trans("096", "Input from Output Side forbidden"));
+ aPlayer,
+ mAllowInputFromOutputSide ? GT_Utility.trans("095", "Input from Output Side allowed")
+ : GT_Utility.trans("096", "Input from Output Side forbidden"));
}
}
}
@Override
public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
- float aZ) {
+ float aZ) {
if (!aPlayer.isSneaking()) return false;
boolean click = super.onSolderingToolRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ);
if (click) return true;
if (aWrenchingSide != mMainFacing) return false;
mDisableMultiStack = !mDisableMultiStack;
GT_Utility.sendChatToPlayer(
- aPlayer,
- StatCollector.translateToLocal("GT5U.hatch.disableMultiStack." + mDisableMultiStack));
+ aPlayer,
+ StatCollector.translateToLocal("GT5U.hatch.disableMultiStack." + mDisableMultiStack));
return true;
}
@@ -996,10 +991,10 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
if (aSide != mMainFacing) return true;
GT_CoverBehaviorBase<?> tBehavior = GregTech_API.getCoverBehaviorNew(aCoverID.toStack());
return tBehavior.isGUIClickable(
- aSide,
- GT_Utility.stackToInt(aCoverID.toStack()),
- tBehavior.createDataObject(),
- getBaseMetaTileEntity());
+ aSide,
+ GT_Utility.stackToInt(aCoverID.toStack()),
+ tBehavior.createDataObject(),
+ getBaseMetaTileEntity());
}
@Override
@@ -1010,9 +1005,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
@Override
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
if (aSide == mMainFacing || aIndex < getInputSlot()
- || aIndex >= getInputSlot() + mInputSlotCount
- || (!mAllowInputFromOutputSide && aSide == aBaseMetaTileEntity.getFrontFacing()))
- return false;
+ || aIndex >= getInputSlot() + mInputSlotCount
+ || (!mAllowInputFromOutputSide && aSide == aBaseMetaTileEntity.getFrontFacing())) return false;
for (int i = getInputSlot(), j = i + mInputSlotCount; i < j; i++)
if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(aStack), mInventory[i]) && mDisableMultiStack)
return i == aIndex;
@@ -1025,7 +1019,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
* check for it anyway.
*/
protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide,
- ItemStack aStack) {
+ ItemStack aStack) {
return !mDisableMultiStack || mInventory[aIndex] == null;
}
@@ -1085,25 +1079,25 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
public static boolean isValidForLowGravity(GT_Recipe tRecipe, int dimId) {
return // TODO check or get a better solution
DimensionManager.getProvider(dimId)
- .getClass()
- .getName()
- .contains("Orbit")
- || DimensionManager.getProvider(dimId)
- .getClass()
- .getName()
- .endsWith("Space")
- || DimensionManager.getProvider(dimId)
- .getClass()
- .getName()
- .endsWith("Asteroids")
- || DimensionManager.getProvider(dimId)
- .getClass()
- .getName()
- .endsWith("SS")
- || DimensionManager.getProvider(dimId)
- .getClass()
- .getName()
- .contains("SpaceStation");
+ .getClass()
+ .getName()
+ .contains("Orbit")
+ || DimensionManager.getProvider(dimId)
+ .getClass()
+ .getName()
+ .endsWith("Space")
+ || DimensionManager.getProvider(dimId)
+ .getClass()
+ .getName()
+ .endsWith("Asteroids")
+ || DimensionManager.getProvider(dimId)
+ .getClass()
+ .getName()
+ .endsWith("SS")
+ || DimensionManager.getProvider(dimId)
+ .getClass()
+ .getName()
+ .contains("SpaceStation");
}
/**
@@ -1116,17 +1110,17 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
GT_Recipe_Map tMap = getRecipeList();
if (tMap == null) return DID_NOT_FIND_RECIPE;
GT_Recipe tRecipe = tMap.findRecipe(
- getBaseMetaTileEntity(),
- mLastRecipe,
- false,
- V[mTier],
- new FluidStack[] { getFillableStack() },
- getSpecialSlot(),
- getAllInputs());
+ getBaseMetaTileEntity(),
+ mLastRecipe,
+ false,
+ V[mTier],
+ new FluidStack[] { getFillableStack() },
+ getSpecialSlot(),
+ getAllInputs());
if (tRecipe == null) return DID_NOT_FIND_RECIPE;
if (GT_Mod.gregtechproxy.mLowGravProcessing && (tRecipe.mSpecialValue == -100 || tRecipe.mSpecialValue == -300)
- && !isValidForLowGravity(tRecipe, getBaseMetaTileEntity().getWorld().provider.dimensionId))
+ && !isValidForLowGravity(tRecipe, getBaseMetaTileEntity().getWorld().provider.dimensionId))
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe;
if (!canOutput(tRecipe)) {
@@ -1134,8 +1128,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
}
if (tRecipe.mSpecialValue == -200
- && (getCallbackBase() == null || !(getCallbackBase() instanceof GT_MetaTileEntity_Cleanroom)
- || ((GT_MetaTileEntity_Cleanroom) getCallbackBase()).mEfficiency == 0))
+ && (getCallbackBase() == null || !(getCallbackBase() instanceof GT_MetaTileEntity_Cleanroom)
+ || ((GT_MetaTileEntity_Cleanroom) getCallbackBase()).mEfficiency == 0))
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
if (!tRecipe.isRecipeInputEqual(true, new FluidStack[] { getFillableStack() }, getAllInputs()))
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
@@ -1145,14 +1139,14 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
if (tRecipe.mSpecialValue == -200 || tRecipe.mSpecialValue == -300)
for (int i = 0; i < mOutputItems.length; i++)
if (mOutputItems[i] != null && getBaseMetaTileEntity().getRandomNumber(10000)
- > ((GT_MetaTileEntity_Cleanroom) getCallbackBase()).mEfficiency) {
- if (debugCleanroom) {
- GT_Log.out.println(
- "BasicMachine: Voiding output due to efficiency failure. mEfficiency = "
- + ((GT_MetaTileEntity_Cleanroom) getCallbackBase()).mEfficiency);
- }
- mOutputItems[i] = null;
+ > ((GT_MetaTileEntity_Cleanroom) getCallbackBase()).mEfficiency) {
+ if (debugCleanroom) {
+ GT_Log.out.println(
+ "BasicMachine: Voiding output due to efficiency failure. mEfficiency = "
+ + ((GT_MetaTileEntity_Cleanroom) getCallbackBase()).mEfficiency);
}
+ mOutputItems[i] = null;
+ }
mOutputFluid = tRecipe.getFluidOutput(0);
if (!skipOC) {
calculateOverclockedNess(tRecipe);
@@ -1221,7 +1215,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
@Override
public void getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
- IWailaConfigHandler config) {
+ IWailaConfigHandler config) {
final NBTTagCompound tag = accessor.getNBTData();
if (tag.getBoolean("stutteringSingleBlock")) {
@@ -1232,41 +1226,41 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
int mEUt = tag.getInteger("eut");
if (mEUt > 0) {
currenttip.add(
- StatCollector.translateToLocalFormatted(
- "GT5U.waila.energy.use",
- GT_Utility.formatNumbers(mEUt),
- GT_Utility.getColoredTierNameFromVoltage(mEUt)));
+ StatCollector.translateToLocalFormatted(
+ "GT5U.waila.energy.use",
+ GT_Utility.formatNumbers(mEUt),
+ GT_Utility.getColoredTierNameFromVoltage(mEUt)));
} else if (mEUt < 0) {
currenttip.add(
- StatCollector.translateToLocalFormatted(
- "GT5U.waila.energy.produce",
- GT_Utility.formatNumbers(-mEUt),
- GT_Utility.getColoredTierNameFromVoltage(-mEUt)));
+ StatCollector.translateToLocalFormatted(
+ "GT5U.waila.energy.produce",
+ GT_Utility.formatNumbers(-mEUt),
+ GT_Utility.getColoredTierNameFromVoltage(-mEUt)));
}
}
currenttip.add(
- GT_Waila.getMachineProgressString(
- isActive,
- tag.getInteger("maxProgressSingleBlock"),
- tag.getInteger("progressSingleBlock")));
+ GT_Waila.getMachineProgressString(
+ isActive,
+ tag.getInteger("maxProgressSingleBlock"),
+ tag.getInteger("progressSingleBlock")));
}
currenttip.add(
- String.format(
- "Machine Facing: %s",
- ForgeDirection.getOrientation(tag.getInteger("mainFacingSingleBlock"))
- .name()));
+ String.format(
+ "Machine Facing: %s",
+ ForgeDirection.getOrientation(tag.getInteger("mainFacingSingleBlock"))
+ .name()));
currenttip.add(
- String.format(
- "Output Facing: %s",
- ForgeDirection.getOrientation(tag.getInteger("outputFacingSingleBlock"))
- .name()));
+ String.format(
+ "Output Facing: %s",
+ ForgeDirection.getOrientation(tag.getInteger("outputFacingSingleBlock"))
+ .name()));
}
@Override
public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y,
- int z) {
+ int z) {
super.getWailaNBTData(player, tile, tag, world, x, y, z);
tag.setInteger("progressSingleBlock", mProgresstime);
@@ -1310,9 +1304,9 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
getRecipeList().addGregTechLogoUI(builder, new Pos2d(0, 0));
} else {
builder.widget(
- new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo())
- .setSize(17, 17)
- .setPos(152, 63));
+ new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo())
+ .setSize(17, 17)
+ .setPos(152, 63));
}
}
@@ -1328,22 +1322,21 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
builder.widget(createChargerSlot(79, 62));
if (getRecipeList() != null) {
builder.widget(
- setNEITransferRect(
- createProgressBar(
- isSteampowered() ? getRecipeList().getProgressBarTextureSteam(getSteamVariant())
- : getRecipeList().getProgressBarTexture(),
- getRecipeList().getProgressBarImageSize(),
- getRecipeList().progressBarDirection,
- getRecipeList().progressBarPos,
- getRecipeList().progressBarSize),
- getRecipeList().mNEIName));
+ setNEITransferRect(
+ createProgressBar(
+ isSteampowered() ? getRecipeList().getProgressBarTextureSteam(getSteamVariant())
+ : getRecipeList().getProgressBarTexture(),
+ getRecipeList().getProgressBarImageSize(),
+ getRecipeList().progressBarDirection,
+ getRecipeList().progressBarPos,
+ getRecipeList().progressBarSize),
+ getRecipeList().mNEIName));
addProgressBarSpecialTextures(builder);
}
builder.widget(
- createErrorStatusArea(
- builder,
- isSteampowered() ? GT_UITextures.PICTURE_STALLED_STEAM
- : GT_UITextures.PICTURE_STALLED_ELECTRICITY));
+ createErrorStatusArea(
+ builder,
+ isSteampowered() ? GT_UITextures.PICTURE_STALLED_STEAM : GT_UITextures.PICTURE_STALLED_ELECTRICITY));
}
/**
@@ -1351,23 +1344,23 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
*/
protected void addIOSlots(ModularWindow.Builder builder) {
final boolean hasFluidInput = getRecipeList() != null ? (getRecipeList().hasFluidInputs())
- : (getCapacity() != 0);
+ : (getCapacity() != 0);
final boolean hasFluidOutput = getRecipeList() != null && getRecipeList().hasFluidOutputs();
UIHelper.forEachSlots(
- (i, backgrounds, pos) -> builder.widget(createItemInputSlot(i, backgrounds, pos)),
- (i, backgrounds, pos) -> builder.widget(createItemOutputSlot(i, backgrounds, pos)),
- (i, backgrounds, pos) -> builder.widget(createSpecialSlot(backgrounds, pos)),
- (i, backgrounds, pos) -> builder.widget(createFluidInputSlot(backgrounds, pos)),
- (i, backgrounds, pos) -> builder.widget(createFluidOutputSlot(backgrounds, pos)),
- getGUITextureSet().getItemSlot(),
- getGUITextureSet().getFluidSlot(),
- getRecipeList(),
- mInputSlotCount,
- mOutputItems.length,
- hasFluidInput ? 1 : 0,
- hasFluidOutput ? 1 : 0,
- getSteamVariant(),
- Pos2d.ZERO);
+ (i, backgrounds, pos) -> builder.widget(createItemInputSlot(i, backgrounds, pos)),
+ (i, backgrounds, pos) -> builder.widget(createItemOutputSlot(i, backgrounds, pos)),
+ (i, backgrounds, pos) -> builder.widget(createSpecialSlot(backgrounds, pos)),
+ (i, backgrounds, pos) -> builder.widget(createFluidInputSlot(backgrounds, pos)),
+ (i, backgrounds, pos) -> builder.widget(createFluidOutputSlot(backgrounds, pos)),
+ getGUITextureSet().getItemSlot(),
+ getGUITextureSet().getFluidSlot(),
+ getRecipeList(),
+ mInputSlotCount,
+ mOutputItems.length,
+ hasFluidInput ? 1 : 0,
+ hasFluidOutput ? 1 : 0,
+ getSteamVariant(),
+ Pos2d.ZERO);
}
/**
@@ -1375,8 +1368,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
*/
protected SlotWidget createItemInputSlot(int index, IDrawable[] backgrounds, Pos2d pos) {
return (SlotWidget) new SlotWidget(inventoryHandler, getInputSlot() + index).setAccess(true, true)
- .setBackground(backgrounds)
- .setPos(pos);
+ .setBackground(backgrounds)
+ .setPos(pos);
}
/**
@@ -1384,8 +1377,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
*/
protected SlotWidget createItemOutputSlot(int index, IDrawable[] backgrounds, Pos2d pos) {
return (SlotWidget) new SlotWidget(inventoryHandler, getOutputSlot() + index).setAccess(true, false)
- .setBackground(backgrounds)
- .setPos(pos);
+ .setBackground(backgrounds)
+ .setPos(pos);
}
/**
@@ -1393,71 +1386,57 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
*/
protected SlotWidget createSpecialSlot(IDrawable[] backgrounds, Pos2d pos) {
return (SlotWidget) new SlotWidget(inventoryHandler, getSpecialSlotIndex()).setAccess(true, true)
- .disableShiftInsert()
- .setGTTooltip(
- () -> mTooltipCache.getData(
- getRecipeList()
- != null
- && getRecipeList().usesSpecialSlot()
- ? SPECIAL_SLOT_TOOLTIP
- : UNUSED_SLOT_TOOLTIP))
- .setTooltipShowUpDelay(TOOLTIP_DELAY)
- .setBackground(backgrounds)
- .setPos(pos);
+ .disableShiftInsert()
+ .setGTTooltip(
+ () -> mTooltipCache.getData(
+ getRecipeList() != null && getRecipeList().usesSpecialSlot() ? SPECIAL_SLOT_TOOLTIP
+ : UNUSED_SLOT_TOOLTIP))
+ .setTooltipShowUpDelay(TOOLTIP_DELAY)
+ .setBackground(backgrounds)
+ .setPos(pos);
}
protected FluidDisplaySlotWidget createFluidInputSlot(IDrawable[] backgrounds, Pos2d pos) {
return (FluidDisplaySlotWidget) new FluidDisplaySlotWidget(
- inventoryHandler,
- OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length)
- .setFluidAccessConstructor(
- () -> constructFluidAccess(true))
- .setIHasFluidDisplay(this)
- .setCanDrain(true)
- .setCanFill(true)
- .setActionRealClick(
- FluidDisplaySlotWidget.Action.TRANSFER)
- .setBeforeRealClick((clickData, widget) -> {
- if (NetworkUtils.isClient()) {
- // propagate display item content to
- // actual fluid stored in this tank
- setFillableStack(
- GT_Utility.getFluidFromDisplayStack(
- widget.getMcSlot()
- .getStack()));
- }
- return true;
- })
- .setUpdateFluidDisplayItem(
- this::updateFluidInputDisplayItem)
- .setGTTooltip(
- () -> mTooltipCache.getData(
- FLUID_INPUT_TOOLTIP,
- GT_Utility.formatNumbers(
- getCapacity())))
- .setTooltipShowUpDelay(TOOLTIP_DELAY)
- .setBackground(backgrounds)
- .setPos(pos);
+ inventoryHandler,
+ OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length)
+ .setFluidAccessConstructor(() -> constructFluidAccess(true))
+ .setIHasFluidDisplay(this)
+ .setCanDrain(true)
+ .setCanFill(true)
+ .setActionRealClick(FluidDisplaySlotWidget.Action.TRANSFER)
+ .setBeforeRealClick((clickData, widget) -> {
+ if (NetworkUtils.isClient()) {
+ // propagate display item content to
+ // actual fluid stored in this tank
+ setFillableStack(
+ GT_Utility.getFluidFromDisplayStack(
+ widget.getMcSlot()
+ .getStack()));
+ }
+ return true;
+ })
+ .setUpdateFluidDisplayItem(this::updateFluidInputDisplayItem)
+ .setGTTooltip(() -> mTooltipCache.getData(FLUID_INPUT_TOOLTIP, GT_Utility.formatNumbers(getCapacity())))
+ .setTooltipShowUpDelay(TOOLTIP_DELAY)
+ .setBackground(backgrounds)
+ .setPos(pos);
}
protected FluidDisplaySlotWidget createFluidOutputSlot(IDrawable[] backgrounds, Pos2d pos) {
- return (FluidDisplaySlotWidget) createDrainableFluidSlot().setUpdateFluidDisplayItem(
- this::updateFluidOutputDisplayItem)
- .setGTTooltip(
- () -> mTooltipCache.getData(
- FLUID_OUTPUT_TOOLTIP,
- GT_Utility.formatNumbers(
- getCapacity())))
- .setTooltipShowUpDelay(TOOLTIP_DELAY)
- .setBackground(backgrounds)
- .setPos(pos);
+ return (FluidDisplaySlotWidget) createDrainableFluidSlot()
+ .setUpdateFluidDisplayItem(this::updateFluidOutputDisplayItem)
+ .setGTTooltip(() -> mTooltipCache.getData(FLUID_OUTPUT_TOOLTIP, GT_Utility.formatNumbers(getCapacity())))
+ .setTooltipShowUpDelay(TOOLTIP_DELAY)
+ .setBackground(backgrounds)
+ .setPos(pos);
}
@Override
protected SlotWidget createChargerSlot(int x, int y) {
if (isSteampowered()) {
- return (SlotWidget) createChargerSlot(x, y, UNUSED_SLOT_TOOLTIP, new String[0]).setBackground(
- getGUITextureSet().getItemSlot());
+ return (SlotWidget) createChargerSlot(x, y, UNUSED_SLOT_TOOLTIP, new String[0])
+ .setBackground(getGUITextureSet().getItemSlot());
} else {
return super.createChargerSlot(x, y);
}
@@ -1465,36 +1444,32 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
protected CycleButtonWidget createItemAutoOutputButton() {
return (CycleButtonWidget) new CycleButtonWidget().setToggle(() -> mItemTransfer, val -> mItemTransfer = val)
- .setStaticTexture(
- GT_UITextures.OVERLAY_BUTTON_AUTOOUTPUT_ITEM)
- .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE)
- .setGTTooltip(
- () -> mTooltipCache.getData(ITEM_TRANSFER_TOOLTIP))
- .setTooltipShowUpDelay(TOOLTIP_DELAY)
- .setPos(25, 62)
- .setSize(18, 18);
+ .setStaticTexture(GT_UITextures.OVERLAY_BUTTON_AUTOOUTPUT_ITEM)
+ .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE)
+ .setGTTooltip(() -> mTooltipCache.getData(ITEM_TRANSFER_TOOLTIP))
+ .setTooltipShowUpDelay(TOOLTIP_DELAY)
+ .setPos(25, 62)
+ .setSize(18, 18);
}
protected CycleButtonWidget createFluidAutoOutputButton() {
return (CycleButtonWidget) new CycleButtonWidget().setToggle(() -> mFluidTransfer, val -> mFluidTransfer = val)
- .setStaticTexture(
- GT_UITextures.OVERLAY_BUTTON_AUTOOUTPUT_FLUID)
- .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE)
- .setGTTooltip(
- () -> mTooltipCache.getData(FLUID_TRANSFER_TOOLTIP))
- .setTooltipShowUpDelay(TOOLTIP_DELAY)
- .setPos(7, 62)
- .setSize(18, 18);
+ .setStaticTexture(GT_UITextures.OVERLAY_BUTTON_AUTOOUTPUT_FLUID)
+ .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE)
+ .setGTTooltip(() -> mTooltipCache.getData(FLUID_TRANSFER_TOOLTIP))
+ .setTooltipShowUpDelay(TOOLTIP_DELAY)
+ .setPos(7, 62)
+ .setSize(18, 18);
}
protected ProgressBar createProgressBar(UITexture texture, int imageSize, ProgressBar.Direction direction,
- Pos2d pos, Size size) {
+ Pos2d pos, Size size) {
final ProgressBar ret = new ProgressBar();
ret.setProgress(() -> maxProgresstime() != 0 ? (float) getProgresstime() / maxProgresstime() : 0)
- .setTexture(texture, imageSize)
- .setDirection(direction)
- .setPos(pos)
- .setSize(size);
+ .setTexture(texture, imageSize)
+ .setDirection(direction)
+ .setPos(pos)
+ .setSize(size);
return ret;
}
@@ -1507,13 +1482,11 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
final Power powerInfo = getPower();
final String transferRectTooltip;
if (isSteampowered()) {
- transferRectTooltip = StatCollector.translateToLocalFormatted(
- NEI_TRANSFER_STEAM_TOOLTIP,
- powerInfo.getTierString());
+ transferRectTooltip = StatCollector
+ .translateToLocalFormatted(NEI_TRANSFER_STEAM_TOOLTIP, powerInfo.getTierString());
} else {
- transferRectTooltip = StatCollector.translateToLocalFormatted(
- NEI_TRANSFER_VOLTAGE_TOOLTIP,
- powerInfo.getTierString());
+ transferRectTooltip = StatCollector
+ .translateToLocalFormatted(NEI_TRANSFER_VOLTAGE_TOOLTIP, powerInfo.getTierString());
}
widget.setNEITransferRect(transferRectID, new Object[] { powerInfo }, transferRectTooltip);
}
@@ -1524,53 +1497,50 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
if (isSteampowered()) {
for (Pair<SteamTexture, Pair<Size, Pos2d>> specialTexture : getRecipeList().specialTexturesSteam) {
builder.widget(
- new DrawableWidget().setDrawable(
- specialTexture.getLeft()
- .get(getSteamVariant()))
- .setSize(
- specialTexture.getRight()
- .getLeft())
- .setPos(
- specialTexture.getRight()
- .getRight()));
+ new DrawableWidget().setDrawable(
+ specialTexture.getLeft()
+ .get(getSteamVariant()))
+ .setSize(
+ specialTexture.getRight()
+ .getLeft())
+ .setPos(
+ specialTexture.getRight()
+ .getRight()));
}
} else {
for (Pair<IDrawable, Pair<Size, Pos2d>> specialTexture : getRecipeList().specialTextures) {
builder.widget(
- new DrawableWidget().setDrawable(specialTexture.getLeft())
- .setSize(
- specialTexture.getRight()
- .getLeft())
- .setPos(
- specialTexture.getRight()
- .getRight()));
+ new DrawableWidget().setDrawable(specialTexture.getLeft())
+ .setSize(
+ specialTexture.getRight()
+ .getLeft())
+ .setPos(
+ specialTexture.getRight()
+ .getRight()));
}
}
}
protected DrawableWidget createErrorStatusArea(ModularWindow.Builder builder, IDrawable picture) {
return (DrawableWidget) new DrawableWidget().setDrawable(picture)
- .setTooltipShowUpDelay(TOOLTIP_DELAY)
- .setEnabled(
- widget -> !widget.getTooltip()
- .isEmpty())
- .dynamicTooltip(this::getErrorDescriptions)
- .dynamicTooltipShift(this::getErrorDescriptionsShift)
- .setPos(79, 44)
- .setSize(18, 18)
- .attachSyncer(
- new FakeSyncWidget.BooleanSyncer(
- () -> mStuttering,
- val -> mStuttering = val),
- builder,
- (widget, val) -> widget.notifyTooltipChange())
- .attachSyncer(
- new FakeSyncWidget.IntegerSyncer(
- () -> getBaseMetaTileEntity().getErrorDisplayID(),
- val -> getBaseMetaTileEntity().setErrorDisplayID(
- val)),
- builder,
- (widget, val) -> widget.notifyTooltipChange());
+ .setTooltipShowUpDelay(TOOLTIP_DELAY)
+ .setEnabled(
+ widget -> !widget.getTooltip()
+ .isEmpty())
+ .dynamicTooltip(this::getErrorDescriptions)
+ .dynamicTooltipShift(this::getErrorDescriptionsShift)
+ .setPos(79, 44)
+ .setSize(18, 18)
+ .attachSyncer(
+ new FakeSyncWidget.BooleanSyncer(() -> mStuttering, val -> mStuttering = val),
+ builder,
+ (widget, val) -> widget.notifyTooltipChange())
+ .attachSyncer(
+ new FakeSyncWidget.IntegerSyncer(
+ () -> getBaseMetaTileEntity().getErrorDisplayID(),
+ val -> getBaseMetaTileEntity().setErrorDisplayID(val)),
+ builder,
+ (widget, val) -> widget.notifyTooltipChange());
}
protected List<String> getErrorDescriptions() {
@@ -1591,8 +1561,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
}
if (mStuttering) {
return mTooltipCache.getData(
- STALLED_STUTTERING_TOOLTIP,
- StatCollector.translateToLocal(POWER_SOURCE_KEY + (isSteampowered() ? "steam" : "power")));
+ STALLED_STUTTERING_TOOLTIP,
+ StatCollector.translateToLocal(POWER_SOURCE_KEY + (isSteampowered() ? "steam" : "power")));
}
return null;
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java
index d2433e04e6..38fce53658 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java
@@ -44,27 +44,27 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE
public boolean mNeedsSteamVenting = false;
public GT_MetaTileEntity_BasicMachine_Bronze(int aID, String aName, String aNameRegional, String aDescription,
- int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) {
+ int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) {
super(
- aID,
- aName,
- aNameRegional,
- aHighPressure ? 2 : 1,
- 0,
- aDescription,
- aInputSlotCount,
- aOutputSlotCount,
- "",
- "");
+ aID,
+ aName,
+ aNameRegional,
+ aHighPressure ? 2 : 1,
+ 0,
+ aDescription,
+ aInputSlotCount,
+ aOutputSlotCount,
+ "",
+ "");
}
public GT_MetaTileEntity_BasicMachine_Bronze(String aName, String aDescription, ITexture[][][] aTextures,
- int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) {
+ int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) {
super(aName, aHighPressure ? 2 : 1, 0, aDescription, aTextures, aInputSlotCount, aOutputSlotCount, "", "");
}
public GT_MetaTileEntity_BasicMachine_Bronze(String aName, String[] aDescription, ITexture[][][] aTextures,
- int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) {
+ int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) {
super(aName, aHighPressure ? 2 : 1, 0, aDescription, aTextures, aInputSlotCount, aOutputSlotCount, "", "");
}
@@ -162,37 +162,25 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE
@Override
public boolean allowToCheckRecipe() {
if (mNeedsSteamVenting
- && getBaseMetaTileEntity().getCoverIDAtSide(getBaseMetaTileEntity().getFrontFacing()) == 0
- && !GT_Utility.hasBlockHitBox(
- getBaseMetaTileEntity().getWorld(),
- getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 1),
- getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 1),
- getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 1))) {
+ && getBaseMetaTileEntity().getCoverIDAtSide(getBaseMetaTileEntity().getFrontFacing()) == 0
+ && !GT_Utility.hasBlockHitBox(
+ getBaseMetaTileEntity().getWorld(),
+ getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 1),
+ getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 1),
+ getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 1))) {
sendSound((byte) 9);
mNeedsSteamVenting = false;
try {
for (EntityLivingBase tLiving : getBaseMetaTileEntity().getWorld()
- .getEntitiesWithinAABB(
- EntityLivingBase.class,
- AxisAlignedBB.getBoundingBox(
- getBaseMetaTileEntity().getOffsetX(
- getBaseMetaTileEntity().getFrontFacing(),
- 1),
- getBaseMetaTileEntity().getOffsetY(
- getBaseMetaTileEntity().getFrontFacing(),
- 1),
- getBaseMetaTileEntity().getOffsetZ(
- getBaseMetaTileEntity().getFrontFacing(),
- 1),
- getBaseMetaTileEntity().getOffsetX(
- getBaseMetaTileEntity().getFrontFacing(),
- 1) + 1,
- getBaseMetaTileEntity().getOffsetY(
- getBaseMetaTileEntity().getFrontFacing(),
- 1) + 1,
- getBaseMetaTileEntity().getOffsetZ(
- getBaseMetaTileEntity().getFrontFacing(),
- 1) + 1))) {
+ .getEntitiesWithinAABB(
+ EntityLivingBase.class,
+ AxisAlignedBB.getBoundingBox(
+ getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 1),
+ getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 1),
+ getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 1),
+ getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 1) + 1,
+ getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 1) + 1,
+ getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 1) + 1))) {
GT_Utility.applyHeatDamage(tLiving, getSteamDamage());
}
} catch (Throwable e) {
@@ -204,14 +192,10 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE
@Override
public int checkRecipe() {
- GT_Recipe tRecipe = getRecipeList().findRecipe(
- getBaseMetaTileEntity(),
- false,
- gregtech.api.enums.GT_Values.V[mTier],
- null,
- getAllInputs());
+ GT_Recipe tRecipe = getRecipeList()
+ .findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[mTier], null, getAllInputs());
if ((tRecipe != null) && (canOutput(tRecipe.mOutputs))
- && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) {
+ && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) {
this.mOutputItems[0] = tRecipe.getOutput(0);
calculateOverclockedNess(tRecipe);
return 2;
@@ -238,21 +222,19 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE
GT_Utility.doSoundAtClient(SoundResource.RANDOM_FIZZ, 5, 1.0F, aX, aY, aZ);
new ParticleEventBuilder().setIdentifier(ParticleFX.CLOUD)
- .setWorld(getBaseMetaTileEntity().getWorld())
- .setMotion(
- ForgeDirection.getOrientation(
- getBaseMetaTileEntity().getFrontFacing()).offsetX / 5.0,
- ForgeDirection.getOrientation(
- getBaseMetaTileEntity().getFrontFacing()).offsetY / 5.0,
- ForgeDirection.getOrientation(
- getBaseMetaTileEntity().getFrontFacing()).offsetZ / 5.0)
- .<ParticleEventBuilder>times(
- 8,
- x -> x.setPosition(
- aX - 0.5 + XSTR_INSTANCE.nextFloat(),
- aY - 0.5 + XSTR_INSTANCE.nextFloat(),
- aZ - 0.5 + XSTR_INSTANCE.nextFloat())
- .run());
+ .setWorld(getBaseMetaTileEntity().getWorld())
+ .setMotion(
+ ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()).offsetX / 5.0,
+ ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()).offsetY / 5.0,
+ ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()).offsetZ / 5.0)
+ .<ParticleEventBuilder>times(
+ 8,
+ x -> x
+ .setPosition(
+ aX - 0.5 + XSTR_INSTANCE.nextFloat(),
+ aY - 0.5 + XSTR_INSTANCE.nextFloat(),
+ aZ - 0.5 + XSTR_INSTANCE.nextFloat())
+ .run());
}
}
@@ -264,8 +246,7 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE
@Override
public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) {
return GregTech_API.getCoverBehaviorNew(aCoverID.toStack())
- .isSimpleCover()
- && super.allowCoverOnSide(aSide, aCoverID);
+ .isSimpleCover() && super.allowCoverOnSide(aSide, aCoverID);
}
public float getSteamDamage() {
@@ -275,99 +256,99 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE
@Override
public ITexture[] getSideFacingActive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
+ isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
}
@Override
public ITexture[] getSideFacingInactive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
+ isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
}
@Override
public ITexture[] getFrontFacingActive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
+ isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
}
@Override
public ITexture[] getFrontFacingInactive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
+ isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
}
@Override
public ITexture[] getTopFacingActive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_BRONZEBRICKS_TOP : MACHINE_BRONZE_TOP,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
+ isBricked() ? MACHINE_BRONZEBRICKS_TOP : MACHINE_BRONZE_TOP,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
}
@Override
public ITexture[] getTopFacingInactive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_BRONZEBRICKS_TOP : MACHINE_BRONZE_TOP,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
+ isBricked() ? MACHINE_BRONZEBRICKS_TOP : MACHINE_BRONZE_TOP,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
}
@Override
public ITexture[] getBottomFacingActive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_BRONZEBRICKS_BOTTOM : MACHINE_BRONZE_BOTTOM,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
+ isBricked() ? MACHINE_BRONZEBRICKS_BOTTOM : MACHINE_BRONZE_BOTTOM,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
}
@Override
public ITexture[] getBottomFacingInactive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_BRONZEBRICKS_BOTTOM : MACHINE_BRONZE_BOTTOM,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
+ isBricked() ? MACHINE_BRONZEBRICKS_BOTTOM : MACHINE_BRONZE_BOTTOM,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
}
@Override
public ITexture[] getBottomFacingPipeActive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_BRONZEBRICKS_BOTTOM : MACHINE_BRONZE_BOTTOM,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
+ isBricked() ? MACHINE_BRONZEBRICKS_BOTTOM : MACHINE_BRONZE_BOTTOM,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
}
@Override
public ITexture[] getBottomFacingPipeInactive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_BRONZEBRICKS_BOTTOM : MACHINE_BRONZE_BOTTOM,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
+ isBricked() ? MACHINE_BRONZEBRICKS_BOTTOM : MACHINE_BRONZE_BOTTOM,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
}
@Override
public ITexture[] getTopFacingPipeActive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_BRONZEBRICKS_TOP : MACHINE_BRONZE_TOP,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
+ isBricked() ? MACHINE_BRONZEBRICKS_TOP : MACHINE_BRONZE_TOP,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
}
@Override
public ITexture[] getTopFacingPipeInactive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_BRONZEBRICKS_TOP : MACHINE_BRONZE_TOP,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
+ isBricked() ? MACHINE_BRONZEBRICKS_TOP : MACHINE_BRONZE_TOP,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
}
@Override
public ITexture[] getSideFacingPipeActive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
+ isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
}
@Override
public ITexture[] getSideFacingPipeInactive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
+ isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
}
@Override
@@ -383,9 +364,9 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE
@Override
public void addGregTechLogo(ModularWindow.Builder builder) {
builder.widget(
- new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo())
- .setSize(17, 17)
- .setPos(152, 63));
+ new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo())
+ .setSize(17, 17)
+ .setPos(152, 63));
}
@Override
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java
index 70afd35f57..0dc019ae5c 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java
@@ -61,112 +61,93 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
private FallbackableUITexture progressBarTexture;
public GT_MetaTileEntity_BasicMachine_GT_Recipe(int aID, String aName, String aNameRegional, int aTier,
- String aDescription, GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity,
- int aGUIParameterA, int aGUIParameterB, String aGUIName, ResourceLocation aSound, boolean aSharedTank,
- boolean aRequiresFluidForFiltering, SpecialEffects aSpecialEffect, String aOverlays, Object[] aRecipe) {
+ String aDescription, GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity,
+ int aGUIParameterA, int aGUIParameterB, String aGUIName, ResourceLocation aSound, boolean aSharedTank,
+ boolean aRequiresFluidForFiltering, SpecialEffects aSpecialEffect, String aOverlays, Object[] aRecipe) {
super(
- aID,
- aName,
- aNameRegional,
- aTier,
- aRecipes.mAmperage,
- aDescription,
- aInputSlots,
- aOutputSlots,
- aGUIName,
- aRecipes.mNEIName,
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ aRecipes.mAmperage,
+ aDescription,
+ aInputSlots,
+ aOutputSlots,
+ aGUIName,
+ aRecipes.mNEIName,
+ TextureFactory.of(
TextureFactory.of(
- TextureFactory.of(
- new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
- + "/OVERLAY_SIDE_ACTIVE")),
- TextureFactory.builder()
- .addIcon(
- (new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
- + "/OVERLAY_SIDE_ACTIVE_GLOW")))
- .glow()
- .build()),
+ new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE_ACTIVE")),
+ TextureFactory.builder()
+ .addIcon(
+ (new CustomIcon(
+ "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE_ACTIVE_GLOW")))
+ .glow()
+ .build()),
+ TextureFactory.of(
+ TextureFactory
+ .of(new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE")),
+ TextureFactory.builder()
+ .addIcon(
+ (new CustomIcon(
+ "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE_GLOW")))
+ .glow()
+ .build()),
+ TextureFactory.of(
TextureFactory.of(
- TextureFactory.of(
- new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE")),
- TextureFactory.builder()
- .addIcon(
- (new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
- + "/OVERLAY_SIDE_GLOW")))
- .glow()
- .build()),
+ new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT_ACTIVE")),
+ TextureFactory.builder()
+ .addIcon(
+ (new CustomIcon(
+ "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT_ACTIVE_GLOW")))
+ .glow()
+ .build()),
+ TextureFactory.of(
+ TextureFactory
+ .of(new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT")),
+ TextureFactory.builder()
+ .addIcon(
+ (new CustomIcon(
+ "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT_GLOW")))
+ .glow()
+ .build()),
+ TextureFactory.of(
TextureFactory.of(
- TextureFactory.of(
- new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
- + "/OVERLAY_FRONT_ACTIVE")),
- TextureFactory.builder()
- .addIcon(
- (new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
- + "/OVERLAY_FRONT_ACTIVE_GLOW")))
- .glow()
- .build()),
+ new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP_ACTIVE")),
+ TextureFactory.builder()
+ .addIcon(
+ (new CustomIcon(
+ "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP_ACTIVE_GLOW")))
+ .glow()
+ .build()),
+ TextureFactory.of(
+ TextureFactory
+ .of(new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP")),
+ TextureFactory.builder()
+ .addIcon(
+ (new CustomIcon(
+ "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP_GLOW")))
+ .glow()
+ .build()),
+ TextureFactory.of(
TextureFactory.of(
- TextureFactory.of(
- new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT")),
- TextureFactory.builder()
- .addIcon(
- (new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
- + "/OVERLAY_FRONT_GLOW")))
- .glow()
- .build()),
- TextureFactory.of(
- TextureFactory.of(
- new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
- + "/OVERLAY_TOP_ACTIVE")),
- TextureFactory.builder()
- .addIcon(
- (new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
- + "/OVERLAY_TOP_ACTIVE_GLOW")))
- .glow()
- .build()),
- TextureFactory.of(
- TextureFactory.of(
- new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP")),
- TextureFactory.builder()
- .addIcon(
- (new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
- + "/OVERLAY_TOP_GLOW")))
- .glow()
- .build()),
- TextureFactory.of(
- TextureFactory.of(
- new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
- + "/OVERLAY_BOTTOM_ACTIVE")),
- TextureFactory.builder()
- .addIcon(
- (new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
- + "/OVERLAY_BOTTOM_ACTIVE_GLOW")))
- .glow()
- .build()),
- TextureFactory.of(
- TextureFactory.of(
- new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM")),
- TextureFactory.builder()
- .addIcon(
- (new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
- + "/OVERLAY_BOTTOM_GLOW")))
- .glow()
- .build()));
+ new CustomIcon(
+ "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM_ACTIVE")),
+ TextureFactory.builder()
+ .addIcon(
+ (new CustomIcon(
+ "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM_ACTIVE_GLOW")))
+ .glow()
+ .build()),
+ TextureFactory.of(
+ TextureFactory
+ .of(new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM")),
+ TextureFactory.builder()
+ .addIcon(
+ (new CustomIcon(
+ "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM_GLOW")))
+ .glow()
+ .build()));
this.mSharedTank = aSharedTank;
this.mTankCapacity = aTankCapacity;
this.mSpecialEffect = aSpecialEffect;
@@ -518,39 +499,39 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
}
if (!GT_ModHandler.addCraftingRecipe(
- getStackForm(1),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.BUFFERED
- | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE,
- aRecipe)) {
+ getStackForm(1),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.BUFFERED
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE,
+ aRecipe)) {
throw new IllegalArgumentException("INVALID CRAFTING RECIPE FOR: " + getStackForm(1).getDisplayName());
}
}
}
public GT_MetaTileEntity_BasicMachine_GT_Recipe(int aID, String aName, String aNameRegional, int aTier,
- String aDescription, GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity,
- int aGUIParameterA, int aGUIParameterB, String aGUIName, SoundResource aSound, boolean aSharedTank,
- boolean aRequiresFluidForFiltering, SpecialEffects aSpecialEffect, String aOverlays, Object[] aRecipe) {
+ String aDescription, GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity,
+ int aGUIParameterA, int aGUIParameterB, String aGUIName, SoundResource aSound, boolean aSharedTank,
+ boolean aRequiresFluidForFiltering, SpecialEffects aSpecialEffect, String aOverlays, Object[] aRecipe) {
this(
- aID,
- aName,
- aNameRegional,
- aTier,
- aDescription,
- aRecipes,
- aInputSlots,
- aOutputSlots,
- aTankCapacity,
- aGUIParameterA,
- aGUIParameterB,
- aGUIName,
- aSound.resourceLocation,
- aSharedTank,
- aRequiresFluidForFiltering,
- aSpecialEffect,
- aOverlays,
- aRecipe);
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ aDescription,
+ aRecipes,
+ aInputSlots,
+ aOutputSlots,
+ aTankCapacity,
+ aGUIParameterA,
+ aGUIParameterB,
+ aGUIName,
+ aSound.resourceLocation,
+ aSharedTank,
+ aRequiresFluidForFiltering,
+ aSpecialEffect,
+ aOverlays,
+ aRecipe);
}
/**
@@ -561,34 +542,34 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
*/
@Deprecated
public GT_MetaTileEntity_BasicMachine_GT_Recipe(int aID, String aName, String aNameRegional, int aTier,
- String aDescription, GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity,
- int aGUIParameterA, int aGUIParameterB, String aGUIName, String aSound, boolean aSharedTank,
- boolean aRequiresFluidForFiltering, int aSpecialEffect, String aOverlays, Object[] aRecipe) {
+ String aDescription, GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity,
+ int aGUIParameterA, int aGUIParameterB, String aGUIName, String aSound, boolean aSharedTank,
+ boolean aRequiresFluidForFiltering, int aSpecialEffect, String aOverlays, Object[] aRecipe) {
this(
- aID,
- aName,
- aNameRegional,
- aTier,
- aDescription,
- aRecipes,
- aInputSlots,
- aOutputSlots,
- aTankCapacity,
- aGUIParameterA,
- aGUIParameterB,
- aGUIName,
- new ResourceLocation(aSound),
- aSharedTank,
- aRequiresFluidForFiltering,
- SpecialEffects.fromId(aSpecialEffect),
- aOverlays,
- aRecipe);
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ aDescription,
+ aRecipes,
+ aInputSlots,
+ aOutputSlots,
+ aTankCapacity,
+ aGUIParameterA,
+ aGUIParameterB,
+ aGUIName,
+ new ResourceLocation(aSound),
+ aSharedTank,
+ aRequiresFluidForFiltering,
+ SpecialEffects.fromId(aSpecialEffect),
+ aOverlays,
+ aRecipe);
}
public GT_MetaTileEntity_BasicMachine_GT_Recipe(String aName, int aTier, String aDescription,
- GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage,
- int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName,
- String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) {
+ GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage,
+ int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName,
+ String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) {
super(aName, aTier, aAmperage, aDescription, aTextures, aInputSlots, aOutputSlots, aGUIName, aNEIName);
this.mSharedTank = aSharedTank;
this.mTankCapacity = aTankCapacity;
@@ -601,9 +582,9 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
}
public GT_MetaTileEntity_BasicMachine_GT_Recipe(String aName, int aTier, String[] aDescription,
- GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage,
- int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName,
- String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) {
+ GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage,
+ int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName,
+ String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) {
super(aName, aTier, aAmperage, aDescription, aTextures, aInputSlots, aOutputSlots, aGUIName, aNEIName);
this.mSharedTank = aSharedTank;
this.mTankCapacity = aTankCapacity;
@@ -618,23 +599,23 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
@Override
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaTileEntity_BasicMachine_GT_Recipe(
- this.mName,
- this.mTier,
- this.mDescriptionArray,
- this.mRecipes,
- this.mInputSlotCount,
- this.mOutputItems == null ? 0 : this.mOutputItems.length,
- this.mTankCapacity,
- this.mAmperage,
- this.mGUIParameterA,
- this.mGUIParameterB,
- this.mTextures,
- this.mGUIName,
- this.mNEIName,
- this.mSoundResourceLocation.toString(),
- this.mSharedTank,
- this.mRequiresFluidForFiltering,
- this.mSpecialEffect.ordinal()).setProgressBarTexture(this.progressBarTexture);
+ this.mName,
+ this.mTier,
+ this.mDescriptionArray,
+ this.mRecipes,
+ this.mInputSlotCount,
+ this.mOutputItems == null ? 0 : this.mOutputItems.length,
+ this.mTankCapacity,
+ this.mAmperage,
+ this.mGUIParameterA,
+ this.mGUIParameterB,
+ this.mTextures,
+ this.mGUIName,
+ this.mNEIName,
+ this.mSoundResourceLocation.toString(),
+ this.mSharedTank,
+ this.mRequiresFluidForFiltering,
+ this.mSpecialEffect.ordinal()).setProgressBarTexture(this.progressBarTexture);
}
public GT_MetaTileEntity_BasicMachine_GT_Recipe setProgressBarTexture(FallbackableUITexture progressBarTexture) {
@@ -644,7 +625,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
public GT_MetaTileEntity_BasicMachine_GT_Recipe setProgressBarTextureName(String name, UITexture fallback) {
return setProgressBarTexture(
- new FallbackableUITexture(UITexture.fullImage(GregTech.ID, "gui/progressbar/" + name), fallback));
+ new FallbackableUITexture(UITexture.fullImage(GregTech.ID, "gui/progressbar/" + name), fallback));
}
public GT_MetaTileEntity_BasicMachine_GT_Recipe setProgressBarTextureName(String name) {
@@ -659,19 +640,19 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
@Override
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
return new GT_GUIContainer_BasicMachine(
- aPlayerInventory,
- aBaseMetaTileEntity,
- this.getLocalName(),
- this.mGUIName,
- GT_Utility.isStringValid(this.mNEIName) ? this.mNEIName
- : this.getRecipeList() != null ? this.getRecipeList().mUnlocalizedName : "",
- this.mGUIParameterA,
- this.mGUIParameterB);
+ aPlayerInventory,
+ aBaseMetaTileEntity,
+ this.getLocalName(),
+ this.mGUIName,
+ GT_Utility.isStringValid(this.mNEIName) ? this.mNEIName
+ : this.getRecipeList() != null ? this.getRecipeList().mUnlocalizedName : "",
+ this.mGUIParameterA,
+ this.mGUIParameterB);
}
@Override
protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide,
- ItemStack aStack) {
+ ItemStack aStack) {
if (!super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack)) return false;
switch (this.mInputSlotCount) {
case 0 -> {
@@ -679,10 +660,28 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
}
case 1 -> {
if (this.getFillableStack() == null) return !this.mRequiresFluidForFiltering && this.getRecipeList()
- .containsInput(
- aStack);
+ .containsInput(aStack);
else return this.getRecipeList()
- .findRecipe(
+ .findRecipe(
+ this.getBaseMetaTileEntity(),
+ this.mLastRecipe,
+ true,
+ true,
+ V[this.mTier],
+ new FluidStack[] { this.getFillableStack() },
+ this.getSpecialSlot(),
+ appendSelectedCircuit(aStack))
+ != null;
+ }
+ case 2 -> {
+ return (!this.mRequiresFluidForFiltering || this.getFillableStack() != null)
+ && (((this.getInputAt(0) != null && this.getInputAt(1) != null)
+ || (this.getInputAt(0) == null && this.getInputAt(1) == null ? this.getRecipeList()
+ .containsInput(aStack)
+ : (this.getRecipeList()
+ .containsInput(aStack)
+ && this.getRecipeList()
+ .findRecipe(
this.getBaseMetaTileEntity(),
this.mLastRecipe,
true,
@@ -690,33 +689,14 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
V[this.mTier],
new FluidStack[] { this.getFillableStack() },
this.getSpecialSlot(),
- appendSelectedCircuit(aStack))
- != null;
- }
- case 2 -> {
- return (!this.mRequiresFluidForFiltering || this.getFillableStack() != null) && (((this.getInputAt(0)
- != null && this.getInputAt(1) != null)
- || (this.getInputAt(0) == null && this.getInputAt(1) == null ? this.getRecipeList()
- .containsInput(aStack)
- : (this.getRecipeList()
- .containsInput(aStack)
- && this.getRecipeList()
- .findRecipe(
- this.getBaseMetaTileEntity(),
- this.mLastRecipe,
- true,
- true,
- V[this.mTier],
- new FluidStack[] { this.getFillableStack() },
- this.getSpecialSlot(),
- aIndex == this.getInputSlot()
- ? appendSelectedCircuit(aStack, this.getInputAt(1))
- : appendSelectedCircuit(this.getInputAt(0), aStack))
- != null))));
+ aIndex == this.getInputSlot()
+ ? appendSelectedCircuit(aStack, this.getInputAt(1))
+ : appendSelectedCircuit(this.getInputAt(0), aStack))
+ != null))));
}
default -> {
int tID = this.getBaseMetaTileEntity()
- .getMetaTileID();
+ .getMetaTileID();
if (tID >= 211 && tID <= 218 || tID >= 1180 && tID <= 1187 || tID >= 10780 && tID <= 10786) { // assembler
// lv-iv;
// circuit
@@ -727,12 +707,11 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
// luv-uev
if (GT_Utility.isStackValid(aStack)) for (int oreID : OreDictionary.getOreIDs(aStack)) {
if (OreDictionary.getOreName(oreID)
- .startsWith("circuit"))
- return true;
+ .startsWith("circuit")) return true;
}
}
return this.getRecipeList()
- .containsInput(aStack);
+ .containsInput(aStack);
}
}
}
@@ -751,20 +730,17 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
case TOP_SMOKE -> {
final byte topFacing = (byte) ForgeDirection.UP.ordinal();
if (aBaseMetaTileEntity.getFrontFacing() != topFacing
- && aBaseMetaTileEntity.getCoverIDAtSide(topFacing) == 0
- && !aBaseMetaTileEntity.getOpacityAtSide(topFacing)) {
+ && aBaseMetaTileEntity.getCoverIDAtSide(topFacing) == 0
+ && !aBaseMetaTileEntity.getOpacityAtSide(topFacing)) {
new ParticleEventBuilder().setMotion(0.0D, 0.0D, 0.0D)
- .setIdentifier(ParticleFX.SMOKE)
- .setPosition(
- aBaseMetaTileEntity.getXCoord() + 0.8F
- - XSTR_INSTANCE.nextFloat() * 0.6F,
- aBaseMetaTileEntity.getYCoord() + 0.9F
- + XSTR_INSTANCE.nextFloat() * 0.2F,
- aBaseMetaTileEntity.getZCoord() + 0.8F
- - XSTR_INSTANCE.nextFloat() * 0.6F)
- .setWorld(aBaseMetaTileEntity.getWorld())
- .run();
+ .setIdentifier(ParticleFX.SMOKE)
+ .setPosition(
+ aBaseMetaTileEntity.getXCoord() + 0.8F - XSTR_INSTANCE.nextFloat() * 0.6F,
+ aBaseMetaTileEntity.getYCoord() + 0.9F + XSTR_INSTANCE.nextFloat() * 0.2F,
+ aBaseMetaTileEntity.getZCoord() + 0.8F - XSTR_INSTANCE.nextFloat() * 0.6F)
+ .setWorld(aBaseMetaTileEntity.getWorld())
+ .run();
}
}
default -> {}
@@ -790,7 +766,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
final byte mainFacing = (byte) this.mMainFacing;
if (mainFacing > 1 && aBaseMetaTileEntity.getCoverIDAtSide(mainFacing) == 0
- && !aBaseMetaTileEntity.getOpacityAtSide(mainFacing)) {
+ && !aBaseMetaTileEntity.getOpacityAtSide(mainFacing)) {
final double oX = aBaseMetaTileEntity.getXCoord();
final double oY = aBaseMetaTileEntity.getYCoord();
@@ -826,11 +802,10 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
}
ParticleEventBuilder particleEventBuilder = (new ParticleEventBuilder()).setMotion(mX, 0, mZ)
- .setPosition(x, y, z)
- .setWorld(
- getBaseMetaTileEntity().getWorld());
+ .setPosition(x, y, z)
+ .setWorld(getBaseMetaTileEntity().getWorld());
particleEventBuilder.setIdentifier(ParticleFX.LAVA)
- .run();
+ .run();
}
}
}
@@ -852,8 +827,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
super.startSoundLoop(aIndex, aX, aY, aZ);
if (aIndex == 1 && this.mSoundResourceLocation != null
- && GT_Utility.isStringValid(this.mSoundResourceLocation.getResourceDomain())
- && GT_Utility.isStringValid(this.mSoundResourceLocation.getResourcePath()))
+ && GT_Utility.isStringValid(this.mSoundResourceLocation.getResourceDomain())
+ && GT_Utility.isStringValid(this.mSoundResourceLocation.getResourcePath()))
GT_Utility.doSoundAtClient(this.mSoundResourceLocation, 100, 1.0F, aX, aY, aZ);
}
@@ -863,8 +838,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
// Added to throttle sounds. To reduce lag, this is on the server side so BlockUpdate packets aren't sent.
if (myMetaTileEntity.mTickTimer > (myMetaTileEntity.mLastSoundTick + ticksBetweenSounds)) {
if (this.mSoundResourceLocation != null
- && GT_Utility.isStringValid(this.mSoundResourceLocation.getResourceDomain())
- && GT_Utility.isStringValid(this.mSoundResourceLocation.getResourcePath()))
+ && GT_Utility.isStringValid(this.mSoundResourceLocation.getResourceDomain())
+ && GT_Utility.isStringValid(this.mSoundResourceLocation.getResourcePath()))
this.sendLoopStart((byte) 1);
// Does not have overflow protection, but they are longs.
myMetaTileEntity.mLastSoundTick = myMetaTileEntity.mTickTimer;
@@ -888,10 +863,9 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
@Override
protected ProgressBar createProgressBar(UITexture texture, int imageSize, ProgressBar.Direction direction,
- Pos2d pos, Size size) {
- return super.createProgressBar(texture, imageSize, direction, pos, size).setTexture(
- progressBarTexture.get(),
- mRecipes.getProgressBarImageSize());
+ Pos2d pos, Size size) {
+ return super.createProgressBar(texture, imageSize, direction, pos, size)
+ .setTexture(progressBarTexture.get(), mRecipes.getProgressBarImageSize());
}
public enum X {
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Steel.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Steel.java
index 3488ab25c1..8a8f63cdb9 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Steel.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Steel.java
@@ -23,20 +23,20 @@ import gregtech.common.power.SteamPower;
* Machine
*/
public abstract class GT_MetaTileEntity_BasicMachine_Steel extends GT_MetaTileEntity_BasicMachine_Bronze
- implements IGetTitleColor {
+ implements IGetTitleColor {
public GT_MetaTileEntity_BasicMachine_Steel(int aID, String aName, String aNameRegional, String aDescription,
- int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) {
+ int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) {
super(aID, aName, aNameRegional, aDescription, aInputSlotCount, aOutputSlotCount, aHighPressure);
}
public GT_MetaTileEntity_BasicMachine_Steel(String aName, String aDescription, ITexture[][][] aTextures,
- int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) {
+ int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) {
super(aName, aDescription, aTextures, aInputSlotCount, aOutputSlotCount, aHighPressure);
}
public GT_MetaTileEntity_BasicMachine_Steel(String aName, String[] aDescription, ITexture[][][] aTextures,
- int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) {
+ int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) {
super(aName, aDescription, aTextures, aInputSlotCount, aOutputSlotCount, aHighPressure);
}
@@ -48,99 +48,99 @@ public abstract class GT_MetaTileEntity_BasicMachine_Steel extends GT_MetaTileEn
@Override
public ITexture[] getSideFacingActive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
+ isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
}
@Override
public ITexture[] getSideFacingInactive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
+ isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
}
@Override
public ITexture[] getFrontFacingActive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
+ isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
}
@Override
public ITexture[] getFrontFacingInactive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
+ isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
}
@Override
public ITexture[] getTopFacingActive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_STEELBRICKS_TOP : MACHINE_STEEL_TOP,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
+ isBricked() ? MACHINE_STEELBRICKS_TOP : MACHINE_STEEL_TOP,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
}
@Override
public ITexture[] getTopFacingInactive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_STEELBRICKS_TOP : MACHINE_STEEL_TOP,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
+ isBricked() ? MACHINE_STEELBRICKS_TOP : MACHINE_STEEL_TOP,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
}
@Override
public ITexture[] getBottomFacingActive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_STEELBRICKS_BOTTOM : MACHINE_STEEL_BOTTOM,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
+ isBricked() ? MACHINE_STEELBRICKS_BOTTOM : MACHINE_STEEL_BOTTOM,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
}
@Override
public ITexture[] getBottomFacingInactive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_STEELBRICKS_BOTTOM : MACHINE_STEEL_BOTTOM,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
+ isBricked() ? MACHINE_STEELBRICKS_BOTTOM : MACHINE_STEEL_BOTTOM,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) };
}
@Override
public ITexture[] getBottomFacingPipeActive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_STEELBRICKS_BOTTOM : MACHINE_STEEL_BOTTOM,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
+ isBricked() ? MACHINE_STEELBRICKS_BOTTOM : MACHINE_STEEL_BOTTOM,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
}
@Override
public ITexture[] getBottomFacingPipeInactive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_STEELBRICKS_BOTTOM : MACHINE_STEEL_BOTTOM,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
+ isBricked() ? MACHINE_STEELBRICKS_BOTTOM : MACHINE_STEEL_BOTTOM,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
}
@Override
public ITexture[] getTopFacingPipeActive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_STEELBRICKS_TOP : MACHINE_STEEL_TOP,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
+ isBricked() ? MACHINE_STEELBRICKS_TOP : MACHINE_STEEL_TOP,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
}
@Override
public ITexture[] getTopFacingPipeInactive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_STEELBRICKS_TOP : MACHINE_STEEL_TOP,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
+ isBricked() ? MACHINE_STEELBRICKS_TOP : MACHINE_STEEL_TOP,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
}
@Override
public ITexture[] getSideFacingPipeActive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
+ isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
}
@Override
public ITexture[] getSideFacingPipeInactive(byte aColor) {
return new ITexture[] { TextureFactory.of(
- isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE,
- Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
+ isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
}
@Override
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java
index 193d654af6..7d4723d4f6 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java
@@ -32,7 +32,7 @@ import gregtech.common.gui.modularui.widget.FluidDisplaySlotWidget;
* This is the main construct for my generic Tanks. Filling and emptying behavior have to be implemented manually
*/
public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_TieredMachineBlock
- implements IHasFluidDisplayItem, IAddUIWidgets {
+ implements IHasFluidDisplayItem, IAddUIWidgets {
public FluidStack mFluid;
protected int mOpenerCount;
@@ -41,22 +41,22 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier
* @param aInvSlotCount should be 3
*/
public GT_MetaTileEntity_BasicTank(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount,
- String aDescription, ITexture... aTextures) {
+ String aDescription, ITexture... aTextures) {
super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures);
}
public GT_MetaTileEntity_BasicTank(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount,
- String[] aDescription, ITexture... aTextures) {
+ String[] aDescription, ITexture... aTextures) {
super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures);
}
public GT_MetaTileEntity_BasicTank(String aName, int aTier, int aInvSlotCount, String aDescription,
- ITexture[][][] aTextures) {
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
public GT_MetaTileEntity_BasicTank(String aName, int aTier, int aInvSlotCount, String[] aDescription,
- ITexture[][][] aTextures) {
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
@@ -184,9 +184,9 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier
if (getFillableStack() == null) {
if (isFluidInputAllowed(tFluid) && tFluid.amount <= getCapacity()) {
if (aBaseMetaTileEntity.addStackToSlot(
- getOutputSlot(),
- GT_Utility.getContainerForFilledItem(mInventory[getInputSlot()], true),
- 1)) {
+ getOutputSlot(),
+ GT_Utility.getContainerForFilledItem(mInventory[getInputSlot()], true),
+ 1)) {
setFillableStack(tFluid.copy());
this.onEmptyingContainerWhenEmpty();
aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1);
@@ -194,11 +194,11 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier
}
} else {
if (tFluid.isFluidEqual(getFillableStack())
- && ((long) tFluid.amount + getFillableStack().amount) <= (long) getCapacity()) {
+ && ((long) tFluid.amount + getFillableStack().amount) <= (long) getCapacity()) {
if (aBaseMetaTileEntity.addStackToSlot(
- getOutputSlot(),
- GT_Utility.getContainerForFilledItem(mInventory[getInputSlot()], true),
- 1)) {
+ getOutputSlot(),
+ GT_Utility.getContainerForFilledItem(mInventory[getInputSlot()], true),
+ 1)) {
getFillableStack().amount += tFluid.amount;
aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1);
}
@@ -208,11 +208,8 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier
}
if (doesFillContainers()) {
- ItemStack tOutput = GT_Utility.fillFluidContainer(
- getDrainableStack(),
- mInventory[getInputSlot()],
- false,
- true);
+ ItemStack tOutput = GT_Utility
+ .fillFluidContainer(getDrainableStack(), mInventory[getInputSlot()], false, true);
if (tOutput != null && aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), tOutput, 1)) {
FluidStack tFluid = GT_Utility.getFluidForFilledItem(tOutput, true);
aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1);
@@ -230,10 +227,8 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier
if (ItemList.Display_Fluid.isStackEqual(mInventory[getStackDisplaySlot()], true, true))
mInventory[getStackDisplaySlot()] = null;
} else {
- mInventory[getStackDisplaySlot()] = GT_Utility.getFluidDisplayStack(
- getDisplayedFluid(),
- true,
- !displaysStackSize());
+ mInventory[getStackDisplaySlot()] = GT_Utility
+ .getFluidDisplayStack(getDisplayedFluid(), true, !displaysStackSize());
}
}
}
@@ -251,13 +246,10 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier
@Override
public int fill(FluidStack aFluid, boolean doFill) {
if (aFluid == null || aFluid.getFluid()
- .getID()
- <= 0 || aFluid.amount <= 0 || !canTankBeFilled() || !isFluidInputAllowed(aFluid))
- return 0;
+ .getID() <= 0 || aFluid.amount <= 0 || !canTankBeFilled() || !isFluidInputAllowed(aFluid)) return 0;
if (getFillableStack() == null || getFillableStack().getFluid()
- .getID()
- <= 0) {
+ .getID() <= 0) {
if (aFluid.amount <= getCapacity()) {
if (doFill) {
setFillableStack(aFluid.copy());
@@ -320,7 +312,7 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier
if (getCapacity() <= 0 && !getBaseMetaTileEntity().hasSteamEngineUpgrade()) return new FluidTankInfo[] {};
if (isDrainableStackSeparate()) {
return new FluidTankInfo[] { new FluidTankInfo(getFillableStack(), getCapacity()),
- new FluidTankInfo(getDrainableStack(), getCapacity()) };
+ new FluidTankInfo(getDrainableStack(), getCapacity()) };
} else {
return new FluidTankInfo[] { new FluidTankInfo(this) };
}
@@ -343,56 +335,50 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier
@Override
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
builder.widget(
- new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK)
- .setPos(7, 16)
- .setSize(71, 45))
- .widget(
- new DrawableWidget().setDrawable(GT_UITextures.PICTURE_GAUGE)
- .setPos(79, 34)
- .setSize(18, 18))
- .widget(
- new SlotWidget(inventoryHandler, getInputSlot())
- .setBackground(
- getGUITextureSet().getItemSlot(),
- GT_UITextures.OVERLAY_SLOT_IN)
- .setPos(79, 16))
- .widget(
- new SlotWidget(inventoryHandler, getOutputSlot())
- .setBackground(
- getGUITextureSet().getItemSlot(),
- GT_UITextures.OVERLAY_SLOT_OUT)
- .setPos(79, 52))
- .widget(
- createDrainableFluidSlot().setBackground(GT_UITextures.TRANSPARENT)
- .setPos(58, 41))
- .widget(
- new TextWidget("Liquid Amount").setDefaultColor(COLOR_TEXT_WHITE.get())
- .setPos(10, 20))
- .widget(
- TextWidget.dynamicString(
- () -> GT_Utility.parseNumberToString(mFluid != null ? mFluid.amount : 0))
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setPos(10, 30));
+ new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK)
+ .setPos(7, 16)
+ .setSize(71, 45))
+ .widget(
+ new DrawableWidget().setDrawable(GT_UITextures.PICTURE_GAUGE)
+ .setPos(79, 34)
+ .setSize(18, 18))
+ .widget(
+ new SlotWidget(inventoryHandler, getInputSlot())
+ .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN)
+ .setPos(79, 16))
+ .widget(
+ new SlotWidget(inventoryHandler, getOutputSlot())
+ .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_OUT)
+ .setPos(79, 52))
+ .widget(
+ createDrainableFluidSlot().setBackground(GT_UITextures.TRANSPARENT)
+ .setPos(58, 41))
+ .widget(
+ new TextWidget("Liquid Amount").setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setPos(10, 20))
+ .widget(
+ TextWidget.dynamicString(() -> GT_Utility.parseNumberToString(mFluid != null ? mFluid.amount : 0))
+ .setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setPos(10, 30));
}
protected FluidDisplaySlotWidget createDrainableFluidSlot() {
- return new FluidDisplaySlotWidget(
- inventoryHandler,
- getStackDisplaySlot()).setFluidAccessConstructor(() -> constructFluidAccess(false))
- .setIHasFluidDisplay(this)
- .setCanDrain(true)
- .setCanFill(!isDrainableStackSeparate())
- .setActionRealClick(FluidDisplaySlotWidget.Action.TRANSFER)
- .setBeforeRealClick((clickData, widget) -> {
- if (NetworkUtils.isClient()) {
- // propagate display item content to actual fluid stored in this tank
- setDrainableStack(
- GT_Utility.getFluidFromDisplayStack(
- widget.getMcSlot()
- .getStack()));
- }
- return true;
- });
+ return new FluidDisplaySlotWidget(inventoryHandler, getStackDisplaySlot())
+ .setFluidAccessConstructor(() -> constructFluidAccess(false))
+ .setIHasFluidDisplay(this)
+ .setCanDrain(true)
+ .setCanFill(!isDrainableStackSeparate())
+ .setActionRealClick(FluidDisplaySlotWidget.Action.TRANSFER)
+ .setBeforeRealClick((clickData, widget) -> {
+ if (NetworkUtils.isClient()) {
+ // propagate display item content to actual fluid stored in this tank
+ setDrainableStack(
+ GT_Utility.getFluidFromDisplayStack(
+ widget.getMcSlot()
+ .getStack()));
+ }
+ return true;
+ });
}
protected IFluidAccess constructFluidAccess(boolean aIsFillableStack) {
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java
index 1b451f3108..f7f69ae924 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java
@@ -33,26 +33,26 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
public int mMaxStackSize = 64;
public static int MAX = 8;
public boolean bOutput = false, bRedstoneIfFull = false, bInvert = false, bStockingMode = false,
- bSortStacks = false;
+ bSortStacks = false;
public int mSuccess = 0, mTargetStackSize = 0;
public GT_MetaTileEntity_Buffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount,
- String aDescription) {
+ String aDescription) {
super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
}
public GT_MetaTileEntity_Buffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount,
- String[] aDescription) {
+ String[] aDescription) {
super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
}
public GT_MetaTileEntity_Buffer(String aName, int aTier, int aInvSlotCount, String aDescription,
- ITexture[][][] aTextures) {
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
public GT_MetaTileEntity_Buffer(String aName, int aTier, int aInvSlotCount, String[] aDescription,
- ITexture[][][] aTextures) {
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
@@ -62,29 +62,29 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
ITexture tIcon = getOverlayIcon();
ITexture tOut = TextureFactory.of(OVERLAY_PIPE_OUT);
ITexture tUp = TextureFactory.of(
- TextureFactory.of(ARROW_UP),
- TextureFactory.builder()
- .addIcon(ARROW_UP_GLOW)
- .glow()
- .build());
+ TextureFactory.of(ARROW_UP),
+ TextureFactory.builder()
+ .addIcon(ARROW_UP_GLOW)
+ .glow()
+ .build());
ITexture tDown = TextureFactory.of(
- TextureFactory.of(ARROW_DOWN),
- TextureFactory.builder()
- .addIcon(ARROW_DOWN_GLOW)
- .glow()
- .build());
+ TextureFactory.of(ARROW_DOWN),
+ TextureFactory.builder()
+ .addIcon(ARROW_DOWN_GLOW)
+ .glow()
+ .build());
ITexture tLeft = TextureFactory.of(
- TextureFactory.of(ARROW_LEFT),
- TextureFactory.builder()
- .addIcon(ARROW_LEFT_GLOW)
- .glow()
- .build());
+ TextureFactory.of(ARROW_LEFT),
+ TextureFactory.builder()
+ .addIcon(ARROW_LEFT_GLOW)
+ .glow()
+ .build());
ITexture tRight = TextureFactory.of(
- TextureFactory.of(ARROW_RIGHT),
- TextureFactory.builder()
- .addIcon(ARROW_RIGHT_GLOW)
- .glow()
- .build());
+ TextureFactory.of(ARROW_RIGHT),
+ TextureFactory.builder()
+ .addIcon(ARROW_RIGHT_GLOW)
+ .glow()
+ .build());
for (int i = 0; i < rTextures[0].length; i++) {
rTextures[OUTPUT_INDEX][i] = new ITexture[] { MACHINE_CASINGS[mTier][i], tOut };
rTextures[ARROW_RIGHT_INDEX][i] = new ITexture[] { MACHINE_CASINGS[mTier][i], tRight, tIcon };
@@ -98,7 +98,7 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
- boolean aActive, boolean aRedstone) {
+ boolean aActive, boolean aRedstone) {
int colorIndex = aColorIndex + 1;
ForgeDirection side = ForgeDirection.VALID_DIRECTIONS[aSide];
ForgeDirection facing = ForgeDirection.VALID_DIRECTIONS[aFacing];
@@ -292,15 +292,15 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("098", "Do not regulate Item Stack Size"));
} else {
GT_Utility.sendChatToPlayer(
- aPlayer,
- GT_Utility.trans("099", "Regulate Item Stack Size to: ") + mTargetStackSize);
+ aPlayer,
+ GT_Utility.trans("099", "Regulate Item Stack Size to: ") + mTargetStackSize);
}
}
}
@Override
public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
- float aZ) {
+ float aZ) {
aWrenchingSide = GT_Utility.getOppositeSide(aWrenchingSide);
if (getBaseMetaTileEntity().isValidFacing(aWrenchingSide)) {
getBaseMetaTileEntity().setFrontFacing(aWrenchingSide);
@@ -329,9 +329,9 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
if (aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.isServerSide()
- && (aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified()
- || aTimer % 200 == 0
- || mSuccess > 0)) {
+ && (aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified()
+ || aTimer % 200 == 0
+ || mSuccess > 0)) {
mSuccess--;
updateSlots();
moveItems(aBaseMetaTileEntity, aTimer);
@@ -351,29 +351,29 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer, int stacks) {
int tCost;
if (bStockingMode) tCost = GT_Utility.moveMultipleItemStacks(
- aBaseMetaTileEntity,
- aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()),
- aBaseMetaTileEntity.getBackFacing(),
- aBaseMetaTileEntity.getFrontFacing(),
- null,
- false,
- mTargetStackSize == 0 ? 64 : (byte) mTargetStackSize,
- mTargetStackSize == 0 ? 1 : (byte) mTargetStackSize,
- (byte) 64,
- (byte) 1,
- stacks);
+ aBaseMetaTileEntity,
+ aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()),
+ aBaseMetaTileEntity.getBackFacing(),
+ aBaseMetaTileEntity.getFrontFacing(),
+ null,
+ false,
+ mTargetStackSize == 0 ? 64 : (byte) mTargetStackSize,
+ mTargetStackSize == 0 ? 1 : (byte) mTargetStackSize,
+ (byte) 64,
+ (byte) 1,
+ stacks);
else tCost = GT_Utility.moveMultipleItemStacks(
- aBaseMetaTileEntity,
- aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()),
- aBaseMetaTileEntity.getBackFacing(),
- aBaseMetaTileEntity.getFrontFacing(),
- null,
- false,
- (byte) 64,
- (byte) 1,
- mTargetStackSize == 0 ? 64 : (byte) mTargetStackSize,
- mTargetStackSize == 0 ? 1 : (byte) mTargetStackSize,
- stacks);
+ aBaseMetaTileEntity,
+ aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()),
+ aBaseMetaTileEntity.getBackFacing(),
+ aBaseMetaTileEntity.getFrontFacing(),
+ null,
+ false,
+ (byte) 64,
+ (byte) 1,
+ mTargetStackSize == 0 ? 64 : (byte) mTargetStackSize,
+ mTargetStackSize == 0 ? 1 : (byte) mTargetStackSize,
+ stacks);
if (tCost > 0 || aBaseMetaTileEntity.hasInventoryBeenModified()) {
mSuccess = 50;
@@ -424,7 +424,7 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
int slot = validSlots.get(slotindex);
slotindex++;
mInventory[slot] = stacks.get(sID)
- .copy();
+ .copy();
toSet = Math.min(toSet, mInventory[slot].getMaxStackSize());
mInventory[slot].stackSize = toSet;
slots.merge(sID, toSet, (a, b) -> a - b);
@@ -433,14 +433,14 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
@Override
public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
- float aZ) {
+ float aZ) {
if (aPlayer.isSneaking()) {
// I was so proud of all this but I literally just copied code from OutputBus
bSortStacks = !bSortStacks;
GT_Utility.sendChatToPlayer(
- aPlayer,
- GT_Utility.trans("200", "Sort mode: ")
- + (bSortStacks ? GT_Utility.trans("088", "Enabled") : GT_Utility.trans("087", "Disabled")));
+ aPlayer,
+ GT_Utility.trans("200", "Sort mode: ")
+ + (bSortStacks ? GT_Utility.trans("088", "Enabled") : GT_Utility.trans("087", "Disabled")));
return true;
}
return super.onSolderingToolRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ);
@@ -456,21 +456,19 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
bOutput = !bOutput;
if (bOutput) {
GT_Utility.sendChatToPlayer(
- widget.getContext()
- .getPlayer(),
- GT_Utility.trans("116", "Emit Energy to Outputside"));
+ widget.getContext()
+ .getPlayer(),
+ GT_Utility.trans("116", "Emit Energy to Outputside"));
} else {
GT_Utility.sendChatToPlayer(
- widget.getContext()
- .getPlayer(),
- GT_Utility.trans("117", "Don't emit Energy"));
+ widget.getContext()
+ .getPlayer(),
+ GT_Utility.trans("117", "Don't emit Energy"));
}
})
- .setBackground(
- GT_UITextures.BUTTON_STANDARD,
- GT_UITextures.OVERLAY_BUTTON_EMIT_ENERGY)
- .setPos(7, 62)
- .setSize(18, 18));
+ .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_EMIT_ENERGY)
+ .setPos(7, 62)
+ .setSize(18, 18));
}
protected void addEmitRedstoneButton(ModularWindow.Builder builder) {
@@ -478,21 +476,19 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
bRedstoneIfFull = !bRedstoneIfFull;
if (bRedstoneIfFull) {
GT_Utility.sendChatToPlayer(
- widget.getContext()
- .getPlayer(),
- GT_Utility.trans("118", "Emit Redstone if no Slot is free"));
+ widget.getContext()
+ .getPlayer(),
+ GT_Utility.trans("118", "Emit Redstone if no Slot is free"));
} else {
GT_Utility.sendChatToPlayer(
- widget.getContext()
- .getPlayer(),
- GT_Utility.trans("119", "Don't emit Redstone"));
+ widget.getContext()
+ .getPlayer(),
+ GT_Utility.trans("119", "Don't emit Redstone"));
}
})
- .setBackground(
- GT_UITextures.BUTTON_STANDARD,
- GT_UITextures.OVERLAY_BUTTON_EMIT_REDSTONE)
- .setPos(25, 62)
- .setSize(18, 18));
+ .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_EMIT_REDSTONE)
+ .setPos(25, 62)
+ .setSize(18, 18));
}
protected void addInvertRedstoneButton(ModularWindow.Builder builder) {
@@ -500,21 +496,19 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
bInvert = !bInvert;
if (bInvert) {
GT_Utility.sendChatToPlayer(
- widget.getContext()
- .getPlayer(),
- GT_Utility.trans("120", "Invert Redstone"));
+ widget.getContext()
+ .getPlayer(),
+ GT_Utility.trans("120", "Invert Redstone"));
} else {
GT_Utility.sendChatToPlayer(
- widget.getContext()
- .getPlayer(),
- GT_Utility.trans("121", "Don't invert Redstone"));
+ widget.getContext()
+ .getPlayer(),
+ GT_Utility.trans("121", "Don't invert Redstone"));
}
})
- .setBackground(
- GT_UITextures.BUTTON_STANDARD,
- GT_UITextures.OVERLAY_BUTTON_INVERT_REDSTONE)
- .setPos(43, 62)
- .setSize(18, 18));
+ .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_INVERT_REDSTONE)
+ .setPos(43, 62)
+ .setSize(18, 18));
}
protected void addStockingModeButton(ModularWindow.Builder builder) {
@@ -522,32 +516,30 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
bStockingMode = !bStockingMode;
if (bStockingMode) {
GT_Utility.sendChatToPlayer(
- widget.getContext()
- .getPlayer(),
- GT_Utility.trans(
- "217",
- "Stocking mode. Keeps this many items in destination input slots. This mode can be server unfriendly."));
+ widget.getContext()
+ .getPlayer(),
+ GT_Utility.trans(
+ "217",
+ "Stocking mode. Keeps this many items in destination input slots. This mode can be server unfriendly."));
} else {
GT_Utility.sendChatToPlayer(
- widget.getContext()
- .getPlayer(),
- GT_Utility.trans(
- "218",
- "Transfer size mode. Add exactly this many items in destination input slots as long as there is room."));
+ widget.getContext()
+ .getPlayer(),
+ GT_Utility.trans(
+ "218",
+ "Transfer size mode. Add exactly this many items in destination input slots as long as there is room."));
}
})
- .setBackground(
- GT_UITextures.BUTTON_STANDARD,
- GT_UITextures.OVERLAY_BUTTON_STOCKING_MODE)
- .setPos(61, 62)
- .setSize(18, 18));
+ .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_STOCKING_MODE)
+ .setPos(61, 62)
+ .setSize(18, 18));
}
protected void addInventorySlots(ModularWindow.Builder builder) {
builder.widget(
- SlotGroup.ofItemHandler(inventoryHandler, 9)
- .endAtSlot(26)
- .build()
- .setPos(7, 4));
+ SlotGroup.ofItemHandler(inventoryHandler, 9)
+ .endAtSlot(26)
+ .build()
+ .setPos(7, 4));
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_CubicMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_CubicMultiBlockBase.java
index 700732f033..a4456e056c 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_CubicMultiBlockBase.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_CubicMultiBlockBase.java
@@ -36,7 +36,7 @@ import gregtech.api.util.GT_StructureUtility;
* @param <T>
*/
public abstract class GT_MetaTileEntity_CubicMultiBlockBase<T extends GT_MetaTileEntity_CubicMultiBlockBase<T>>
- extends GT_MetaTileEntity_EnhancedMultiBlockBase<T> implements ISurvivalConstructable {
+ extends GT_MetaTileEntity_EnhancedMultiBlockBase<T> implements ISurvivalConstructable {
protected static final String STRUCTURE_PIECE_MAIN = "main";
protected static final ClassValue<IStructureDefinition<GT_MetaTileEntity_CubicMultiBlockBase<?>>> STRUCTURE_DEFINITION = new ClassValue<>() {
@@ -44,27 +44,23 @@ public abstract class GT_MetaTileEntity_CubicMultiBlockBase<T extends GT_MetaTil
@Override
protected IStructureDefinition<GT_MetaTileEntity_CubicMultiBlockBase<?>> computeValue(Class<?> type) {
return StructureDefinition.<GT_MetaTileEntity_CubicMultiBlockBase<?>>builder()
- .addShape(
- STRUCTURE_PIECE_MAIN,
- transpose(
- new String[][] { { "hhh", "hhh", "hhh" }, { "h~h", "h-h", "hhh" },
- { "hhh", "hhh", "hhh" }, }))
- .addElement(
- 'h',
- ofChain(
- lazy(
- t -> GT_StructureUtility.<GT_MetaTileEntity_CubicMultiBlockBase<?>>buildHatchAdder()
- .atLeastList(
- t.getAllowedHatches())
- .casingIndex(
- t.getHatchTextureIndex())
- .dot(1)
- .build()),
- onElementPass(
- GT_MetaTileEntity_CubicMultiBlockBase::onCorrectCasingAdded,
- lazy(
- GT_MetaTileEntity_CubicMultiBlockBase::getCasingElement))))
- .build();
+ .addShape(
+ STRUCTURE_PIECE_MAIN,
+ transpose(
+ new String[][] { { "hhh", "hhh", "hhh" }, { "h~h", "h-h", "hhh" }, { "hhh", "hhh", "hhh" }, }))
+ .addElement(
+ 'h',
+ ofChain(
+ lazy(
+ t -> GT_StructureUtility.<GT_MetaTileEntity_CubicMultiBlockBase<?>>buildHatchAdder()
+ .atLeastList(t.getAllowedHatches())
+ .casingIndex(t.getHatchTextureIndex())
+ .dot(1)
+ .build()),
+ onElementPass(
+ GT_MetaTileEntity_CubicMultiBlockBase::onCorrectCasingAdded,
+ lazy(GT_MetaTileEntity_CubicMultiBlockBase::getCasingElement))))
+ .build();
}
};
private int mCasingAmount = 0;
@@ -104,7 +100,7 @@ public abstract class GT_MetaTileEntity_CubicMultiBlockBase<T extends GT_MetaTil
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
mCasingAmount = 0;
return checkPiece(STRUCTURE_PIECE_MAIN, 1, 1, 0) && mCasingAmount >= getRequiredCasingCount()
- && checkHatches(aBaseMetaTileEntity, aStack);
+ && checkHatches(aBaseMetaTileEntity, aStack);
}
/**
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_EnhancedMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_EnhancedMultiBlockBase.java
index bd6facceee..6fdfa53a14 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_EnhancedMultiBlockBase.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_EnhancedMultiBlockBase.java
@@ -32,7 +32,7 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
* @param <T> type of this
*/
public abstract class GT_MetaTileEntity_EnhancedMultiBlockBase<T extends GT_MetaTileEntity_EnhancedMultiBlockBase<T>>
- extends GT_MetaTileEntity_TooltipMultiBlockBase implements IAlignment, IConstructable {
+ extends GT_MetaTileEntity_TooltipMultiBlockBase implements IAlignment, IConstructable {
private ExtendedFacing mExtendedFacing = ExtendedFacing.DEFAULT;
private IAlignmentLimits mLimits = getInitialAlignmentLimits();
@@ -60,15 +60,15 @@ public abstract class GT_MetaTileEntity_EnhancedMultiBlockBase<T extends GT_Meta
mUpdated = false;
mUpdate = 100;
if (getBaseMetaTileEntity().isServerSide()
- && !GregTech_API.isDummyWorld(getBaseMetaTileEntity().getWorld())) {
+ && !GregTech_API.isDummyWorld(getBaseMetaTileEntity().getWorld())) {
StructureLibAPI.sendAlignment(
- (IAlignmentProvider) base,
- new NetworkRegistry.TargetPoint(
- base.getWorld().provider.dimensionId,
- base.getXCoord(),
- base.getYCoord(),
- base.getZCoord(),
- 512));
+ (IAlignmentProvider) base,
+ new NetworkRegistry.TargetPoint(
+ base.getWorld().provider.dimensionId,
+ base.getXCoord(),
+ base.getYCoord(),
+ base.getZCoord(),
+ 512));
} else {
base.issueTextureUpdate();
}
@@ -82,7 +82,7 @@ public abstract class GT_MetaTileEntity_EnhancedMultiBlockBase<T extends GT_Meta
@Override
public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
- float aZ) {
+ float aZ) {
if (aWrenchingSide != getBaseMetaTileEntity().getFrontFacing())
return super.onWrenchRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ);
if (aPlayer.isSneaking()) {
@@ -132,22 +132,22 @@ public abstract class GT_MetaTileEntity_EnhancedMultiBlockBase<T extends GT_Meta
public void saveNBTData(NBTTagCompound aNBT) {
super.saveNBTData(aNBT);
aNBT.setByte(
- "eRotation",
- (byte) mExtendedFacing.getRotation()
- .getIndex());
+ "eRotation",
+ (byte) mExtendedFacing.getRotation()
+ .getIndex());
aNBT.setByte(
- "eFlip",
- (byte) mExtendedFacing.getFlip()
- .getIndex());
+ "eFlip",
+ (byte) mExtendedFacing.getFlip()
+ .getIndex());
}
@Override
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
mExtendedFacing = ExtendedFacing.of(
- ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()),
- Rotation.byIndex(aNBT.getByte("eRotation")),
- Flip.byIndex(aNBT.getByte("eFlip")));
+ ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()),
+ Rotation.byIndex(aNBT.getByte("eRotation")),
+ Flip.byIndex(aNBT.getByte("eFlip")));
}
@SuppressWarnings("unchecked")
@@ -170,108 +170,108 @@ public abstract class GT_MetaTileEntity_EnhancedMultiBlockBase<T extends GT_Meta
protected final boolean checkPiece(String piece, int horizontalOffset, int verticalOffset, int depthOffset) {
final IGregTechTileEntity tTile = getBaseMetaTileEntity();
return getCastedStructureDefinition().check(
- this,
- piece,
- tTile.getWorld(),
- getExtendedFacing(),
- tTile.getXCoord(),
- tTile.getYCoord(),
- tTile.getZCoord(),
- horizontalOffset,
- verticalOffset,
- depthOffset,
- !mMachine);
+ this,
+ piece,
+ tTile.getWorld(),
+ getExtendedFacing(),
+ tTile.getXCoord(),
+ tTile.getYCoord(),
+ tTile.getZCoord(),
+ horizontalOffset,
+ verticalOffset,
+ depthOffset,
+ !mMachine);
}
protected final boolean buildPiece(String piece, ItemStack trigger, boolean hintOnly, int horizontalOffset,
- int verticalOffset, int depthOffset) {
+ int verticalOffset, int depthOffset) {
final IGregTechTileEntity tTile = getBaseMetaTileEntity();
return getCastedStructureDefinition().buildOrHints(
- this,
- trigger,
- piece,
- tTile.getWorld(),
- getExtendedFacing(),
- tTile.getXCoord(),
- tTile.getYCoord(),
- tTile.getZCoord(),
- horizontalOffset,
- verticalOffset,
- depthOffset,
- hintOnly);
+ this,
+ trigger,
+ piece,
+ tTile.getWorld(),
+ getExtendedFacing(),
+ tTile.getXCoord(),
+ tTile.getYCoord(),
+ tTile.getZCoord(),
+ horizontalOffset,
+ verticalOffset,
+ depthOffset,
+ hintOnly);
}
@Deprecated
protected final int survivialBuildPiece(String piece, ItemStack trigger, int horizontalOffset, int verticalOffset,
- int depthOffset, int elementsBudget, IItemSource source, EntityPlayerMP actor, boolean check) {
+ int depthOffset, int elementsBudget, IItemSource source, EntityPlayerMP actor, boolean check) {
final IGregTechTileEntity tTile = getBaseMetaTileEntity();
return getCastedStructureDefinition().survivalBuild(
- this,
- trigger,
- piece,
- tTile.getWorld(),
- getExtendedFacing(),
- tTile.getXCoord(),
- tTile.getYCoord(),
- tTile.getZCoord(),
- horizontalOffset,
- verticalOffset,
- depthOffset,
- elementsBudget,
- source,
- actor,
- check);
+ this,
+ trigger,
+ piece,
+ tTile.getWorld(),
+ getExtendedFacing(),
+ tTile.getXCoord(),
+ tTile.getYCoord(),
+ tTile.getZCoord(),
+ horizontalOffset,
+ verticalOffset,
+ depthOffset,
+ elementsBudget,
+ source,
+ actor,
+ check);
}
protected final int survivialBuildPiece(String piece, ItemStack trigger, int horizontalOffset, int verticalOffset,
- int depthOffset, int elementsBudget, ISurvivalBuildEnvironment env, boolean check) {
+ int depthOffset, int elementsBudget, ISurvivalBuildEnvironment env, boolean check) {
final IGregTechTileEntity tTile = getBaseMetaTileEntity();
return getCastedStructureDefinition().survivalBuild(
- this,
- trigger,
- piece,
- tTile.getWorld(),
- getExtendedFacing(),
- tTile.getXCoord(),
- tTile.getYCoord(),
- tTile.getZCoord(),
- horizontalOffset,
- verticalOffset,
- depthOffset,
- elementsBudget,
- env,
- check);
+ this,
+ trigger,
+ piece,
+ tTile.getWorld(),
+ getExtendedFacing(),
+ tTile.getXCoord(),
+ tTile.getYCoord(),
+ tTile.getZCoord(),
+ horizontalOffset,
+ verticalOffset,
+ depthOffset,
+ elementsBudget,
+ env,
+ check);
}
@Deprecated
protected final int survivialBuildPiece(String piece, ItemStack trigger, int horizontalOffset, int verticalOffset,
- int depthOffset, int elementsBudget, IItemSource source, EntityPlayerMP actor, boolean check,
- boolean checkIfPlaced) {
+ int depthOffset, int elementsBudget, IItemSource source, EntityPlayerMP actor, boolean check,
+ boolean checkIfPlaced) {
int built = survivialBuildPiece(
- piece,
- trigger,
- horizontalOffset,
- verticalOffset,
- depthOffset,
- elementsBudget,
- source,
- actor,
- check);
+ piece,
+ trigger,
+ horizontalOffset,
+ verticalOffset,
+ depthOffset,
+ elementsBudget,
+ source,
+ actor,
+ check);
if (checkIfPlaced && built > 0) checkStructure(true, getBaseMetaTileEntity());
return built;
}
protected final int survivialBuildPiece(String piece, ItemStack trigger, int horizontalOffset, int verticalOffset,
- int depthOffset, int elementsBudget, ISurvivalBuildEnvironment env, boolean check, boolean checkIfPlaced) {
+ int depthOffset, int elementsBudget, ISurvivalBuildEnvironment env, boolean check, boolean checkIfPlaced) {
int built = survivialBuildPiece(
- piece,
- trigger,
- horizontalOffset,
- verticalOffset,
- depthOffset,
- elementsBudget,
- env,
- check);
+ piece,
+ trigger,
+ horizontalOffset,
+ verticalOffset,
+ depthOffset,
+ elementsBudget,
+ env,
+ check);
if (checkIfPlaced && built > 0) checkStructure(true, getBaseMetaTileEntity());
return built;
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ExtendedPowerMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ExtendedPowerMultiBlockBase.java
index 99b5c6c550..b5eb13b385 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ExtendedPowerMultiBlockBase.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ExtendedPowerMultiBlockBase.java
@@ -21,7 +21,7 @@ import gregtech.api.util.GT_Utility;
* Multiblock base class that allows machine to use power over int.
*/
public abstract class GT_MetaTileEntity_ExtendedPowerMultiBlockBase<T extends GT_MetaTileEntity_EnhancedMultiBlockBase<T>>
- extends GT_MetaTileEntity_EnhancedMultiBlockBase<T> {
+ extends GT_MetaTileEntity_EnhancedMultiBlockBase<T> {
public long lEUt;
@@ -48,7 +48,7 @@ public abstract class GT_MetaTileEntity_ExtendedPowerMultiBlockBase<T extends GT
@Override
protected void calculateOverclockedNessMultiInternal(long aEUt, int aDuration, int mAmperage, long maxInputVoltage,
- boolean perfectOC) {
+ boolean perfectOC) {
// 5% space for cable loss
long zMaxInputVoltage = maxInputVoltage / 100L * 95L;
long zTime = aDuration;
@@ -114,7 +114,7 @@ public abstract class GT_MetaTileEntity_ExtendedPowerMultiBlockBase<T extends GT
@Override
public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y,
- int z) {
+ int z) {
super.getWailaNBTData(player, tile, tag, world, x, y, z);
final IGregTechTileEntity tileEntity = getBaseMetaTileEntity();
@@ -140,66 +140,66 @@ public abstract class GT_MetaTileEntity_ExtendedPowerMultiBlockBase<T extends GT
for (GT_MetaTileEntity_Hatch tHatch : getExoticAndNormalEnergyHatchList()) {
if (isValidMetaTileEntity(tHatch)) {
storedEnergy += tHatch.getBaseMetaTileEntity()
- .getStoredEU();
+ .getStoredEU();
maxEnergy += tHatch.getBaseMetaTileEntity()
- .getEUCapacity();
+ .getEUCapacity();
}
}
long voltage = getAverageInputVoltage();
long amps = getMaxInputAmps();
return new String[] {
- /* 1 */ StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": "
- + EnumChatFormatting.GREEN
- + GT_Utility.formatNumbers(mProgresstime / 20)
- + EnumChatFormatting.RESET
- + " s / "
- + EnumChatFormatting.YELLOW
- + GT_Utility.formatNumbers(mMaxProgresstime / 20)
- + EnumChatFormatting.RESET
- + " s",
- /* 2 */ StatCollector.translateToLocal("GT5U.multiblock.energy") + ": "
- + EnumChatFormatting.GREEN
- + GT_Utility.formatNumbers(storedEnergy)
- + EnumChatFormatting.RESET
- + " EU / "
- + EnumChatFormatting.YELLOW
- + GT_Utility.formatNumbers(maxEnergy)
- + EnumChatFormatting.RESET
- + " EU",
- /* 3 */ StatCollector.translateToLocal("GT5U.multiblock.usage") + ": "
- + EnumChatFormatting.RED
- + GT_Utility.formatNumbers(getActualEnergyUsage())
- + EnumChatFormatting.RESET
- + " EU/t",
- /* 4 */ StatCollector.translateToLocal("GT5U.multiblock.mei") + ": "
- + EnumChatFormatting.YELLOW
- + GT_Utility.formatNumbers(voltage)
- + EnumChatFormatting.RESET
- + " EU/t(*"
- + amps
- + " A)"
- + StatCollector.translateToLocal("GT5U.machines.tier")
- + ": "
- + EnumChatFormatting.YELLOW
- + VN[GT_Utility.getTier(voltage)]
- + EnumChatFormatting.RESET,
- /* 5 */ StatCollector.translateToLocal("GT5U.multiblock.problems") + ": "
- + EnumChatFormatting.RED
- + (getIdealStatus() - getRepairStatus())
- + EnumChatFormatting.RESET
- + " "
- + StatCollector.translateToLocal("GT5U.multiblock.efficiency")
- + ": "
- + EnumChatFormatting.YELLOW
- + mEfficiency / 100.0F
- + EnumChatFormatting.RESET
- + " %",
- /* 6 */ StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": "
- + EnumChatFormatting.GREEN
- + mPollutionReduction
- + EnumChatFormatting.RESET
- + " %" };
+ /* 1 */ StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": "
+ + EnumChatFormatting.GREEN
+ + GT_Utility.formatNumbers(mProgresstime / 20)
+ + EnumChatFormatting.RESET
+ + " s / "
+ + EnumChatFormatting.YELLOW
+ + GT_Utility.formatNumbers(mMaxProgresstime / 20)
+ + EnumChatFormatting.RESET
+ + " s",
+ /* 2 */ StatCollector.translateToLocal("GT5U.multiblock.energy") + ": "
+ + EnumChatFormatting.GREEN
+ + GT_Utility.formatNumbers(storedEnergy)
+ + EnumChatFormatting.RESET
+ + " EU / "
+ + EnumChatFormatting.YELLOW
+ + GT_Utility.formatNumbers(maxEnergy)
+ + EnumChatFormatting.RESET
+ + " EU",
+ /* 3 */ StatCollector.translateToLocal("GT5U.multiblock.usage") + ": "
+ + EnumChatFormatting.RED
+ + GT_Utility.formatNumbers(getActualEnergyUsage())
+ + EnumChatFormatting.RESET
+ + " EU/t",
+ /* 4 */ StatCollector.translateToLocal("GT5U.multiblock.mei") + ": "
+ + EnumChatFormatting.YELLOW
+ + GT_Utility.formatNumbers(voltage)
+ + EnumChatFormatting.RESET
+ + " EU/t(*"
+ + amps
+ + " A)"
+ + StatCollector.translateToLocal("GT5U.machines.tier")
+ + ": "
+ + EnumChatFormatting.YELLOW
+ + VN[GT_Utility.getTier(voltage)]
+ + EnumChatFormatting.RESET,
+ /* 5 */ StatCollector.translateToLocal("GT5U.multiblock.problems") + ": "
+ + EnumChatFormatting.RED
+ + (getIdealStatus() - getRepairStatus())
+ + EnumChatFormatting.RESET
+ + " "
+ + StatCollector.translateToLocal("GT5U.multiblock.efficiency")
+ + ": "
+ + EnumChatFormatting.YELLOW
+ + mEfficiency / 100.0F
+ + EnumChatFormatting.RESET
+ + " %",
+ /* 6 */ StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": "
+ + EnumChatFormatting.GREEN
+ + mPollutionReduction
+ + EnumChatFormatting.RESET
+ + " %" };
}
@Override
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch.java
index a8e505b806..f0ce474fd1 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch.java
@@ -28,22 +28,22 @@ public abstract class GT_MetaTileEntity_Hatch extends GT_MetaTileEntity_BasicTan
private byte actualTexture = 0;
public GT_MetaTileEntity_Hatch(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount,
- String aDescription, ITexture... aTextures) {
+ String aDescription, ITexture... aTextures) {
super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures);
}
public GT_MetaTileEntity_Hatch(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount,
- String[] aDescription, ITexture... aTextures) {
+ String[] aDescription, ITexture... aTextures) {
super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures);
}
public GT_MetaTileEntity_Hatch(String aName, int aTier, int aInvSlotCount, String aDescription,
- ITexture[][][] aTextures) {
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
public GT_MetaTileEntity_Hatch(String aName, int aTier, int aInvSlotCount, String[] aDescription,
- ITexture[][][] aTextures) {
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
@@ -62,7 +62,7 @@ public abstract class GT_MetaTileEntity_Hatch extends GT_MetaTileEntity_BasicTan
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
- boolean aActive, boolean aRedstone) {
+ boolean aActive, boolean aRedstone) {
int texturePointer = (byte) (actualTexture & 0x7F); // just to be sure, from my testing the 8th bit cannot be
// set clientside
int textureIndex = texturePointer | (mTexturePage << 7); // Shift seven since one page is 128 textures!
@@ -76,7 +76,7 @@ public abstract class GT_MetaTileEntity_Hatch extends GT_MetaTileEntity_BasicTan
if (aActive)
return getTexturesActive(Textures.BlockIcons.casingTexturePages[mTexturePage][texturePointer]);
else return getTexturesInactive(
- Textures.BlockIcons.casingTexturePages[mTexturePage][texturePointer]);
+ Textures.BlockIcons.casingTexturePages[mTexturePage][texturePointer]);
} else {
if (aActive) return getTexturesActive(Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1]);
else return getTexturesInactive(Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1]);
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java
index 9adc250f73..7617725d92 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java
@@ -24,13 +24,13 @@ public class GT_MetaTileEntity_Hatch_DataAccess extends GT_MetaTileEntity_Hatch
public GT_MetaTileEntity_Hatch_DataAccess(int aID, String aName, String aNameRegional, int aTier) {
super(
- aID,
- aName,
- aNameRegional,
- aTier,
- 16,
- new String[] { "Data Access for Multiblocks",
- "Adds " + (aTier == 4 ? 4 : 16) + " extra slots for Data Sticks" });
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ 16,
+ new String[] { "Data Access for Multiblocks",
+ "Adds " + (aTier == 4 ? 4 : 16) + " extra slots for Data Sticks" });
}
public GT_MetaTileEntity_Hatch_DataAccess(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
@@ -38,7 +38,7 @@ public class GT_MetaTileEntity_Hatch_DataAccess extends GT_MetaTileEntity_Hatch
}
public GT_MetaTileEntity_Hatch_DataAccess(String aName, int aTier, String[] aDescription,
- ITexture[][][] aTextures) {
+ ITexture[][][] aTextures) {
super(aName, aTier, aTier == 4 ? 4 : 16, aDescription, aTextures);
}
@@ -144,15 +144,11 @@ public class GT_MetaTileEntity_Hatch_DataAccess extends GT_MetaTileEntity_Hatch
@Override
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
if (mTier == 4) {
- getBaseMetaTileEntity().add2by2Slots(
- builder,
- getGUITextureSet().getItemSlot(),
- GT_UITextures.OVERLAY_SLOT_CIRCUIT);
+ getBaseMetaTileEntity()
+ .add2by2Slots(builder, getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CIRCUIT);
} else {
- getBaseMetaTileEntity().add4by4Slots(
- builder,
- getGUITextureSet().getItemSlot(),
- GT_UITextures.OVERLAY_SLOT_CIRCUIT);
+ getBaseMetaTileEntity()
+ .add4by4Slots(builder, getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CIRCUIT);
}
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Dynamo.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Dynamo.java
index 84c1327a91..cc1d0ac404 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Dynamo.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Dynamo.java
@@ -14,16 +14,16 @@ public class GT_MetaTileEntity_Hatch_Dynamo extends GT_MetaTileEntity_Hatch {
public GT_MetaTileEntity_Hatch_Dynamo(int aID, String aName, String aNameRegional, int aTier) {
super(
- aID,
- aName,
- aNameRegional,
- aTier,
- 0,
- new String[] { "Generating electric Energy from Multiblocks", "Puts out up to 1 Amp" });
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ 0,
+ new String[] { "Generating electric Energy from Multiblocks", "Puts out up to 1 Amp" });
}
public GT_MetaTileEntity_Hatch_Dynamo(int aID, String aName, String aNameRegional, int aTier,
- String[] aDescription) {
+ String[] aDescription) {
super(aID, aName, aNameRegional, aTier, 0, aDescription);
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy.java
index dda6fb5716..2ad670fae1 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy.java
@@ -13,22 +13,22 @@ import gregtech.api.metatileentity.MetaTileEntity;
public class GT_MetaTileEntity_Hatch_Energy extends GT_MetaTileEntity_Hatch {
public GT_MetaTileEntity_Hatch_Energy(int aID, String aName, String aNameRegional, int aTier,
- String[] aDescription) {
+ String[] aDescription) {
super(aID, aName, aNameRegional, aTier, 0, aDescription);
}
public GT_MetaTileEntity_Hatch_Energy(int aID, String aName, String aNameRegional, int aTier) {
super(
- aID,
- aName,
- aNameRegional,
- aTier,
- 0,
- new String[] { "Energy Injector for Multiblocks", "Accepts up to 2 Amps" });
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ 0,
+ new String[] { "Energy Injector for Multiblocks", "Accepts up to 2 Amps" });
}
public GT_MetaTileEntity_Hatch_Energy(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount,
- String[] aDescription, ITexture... aTextures) {
+ String[] aDescription, ITexture... aTextures) {
super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures);
}
@@ -41,7 +41,7 @@ public class GT_MetaTileEntity_Hatch_Energy extends GT_MetaTileEntity_Hatch {
}
public GT_MetaTileEntity_Hatch_Energy(String aName, int aTier, int aInvSlotCount, String[] aDescription,
- ITexture[][][] aTextures) {
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Input.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Input.java
index 4b53946e7a..408e1eca14 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Input.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Input.java
@@ -23,25 +23,25 @@ public class GT_MetaTileEntity_Hatch_Input extends GT_MetaTileEntity_Hatch {
public GT_MetaTileEntity_Hatch_Input(int aID, String aName, String aNameRegional, int aTier) {
super(
- aID,
- aName,
- aNameRegional,
- aTier,
- 3,
- new String[] { "Fluid Input for Multiblocks",
- "Capacity: " + GT_Utility.formatNumbers(8000 * (1 << aTier)) + "L" });
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ 3,
+ new String[] { "Fluid Input for Multiblocks",
+ "Capacity: " + GT_Utility.formatNumbers(8000 * (1 << aTier)) + "L" });
}
public GT_MetaTileEntity_Hatch_Input(int aID, int aSlot, String aName, String aNameRegional, int aTier) {
super(
- aID,
- aName,
- aNameRegional,
- aTier,
- aSlot,
- new String[] { "Fluid Input for Multiblocks",
- "Capacity: " + GT_Utility.formatNumbers(8000 * (1 << aTier) / aSlot) + "L",
- "Can hold " + aSlot + " types of fluid." });
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ aSlot,
+ new String[] { "Fluid Input for Multiblocks",
+ "Capacity: " + GT_Utility.formatNumbers(8000 * (1 << aTier) / aSlot) + "L",
+ "Can hold " + aSlot + " types of fluid." });
}
public GT_MetaTileEntity_Hatch_Input(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
@@ -53,22 +53,22 @@ public class GT_MetaTileEntity_Hatch_Input extends GT_MetaTileEntity_Hatch {
}
public GT_MetaTileEntity_Hatch_Input(String aName, int aSlots, int aTier, String[] aDescription,
- ITexture[][][] aTextures) {
+ ITexture[][][] aTextures) {
super(aName, aTier, aSlots, aDescription, aTextures);
}
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch
- ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(FLUID_IN_SIGN) }
- : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN) };
+ ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(FLUID_IN_SIGN) }
+ : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN) };
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch
- ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(FLUID_IN_SIGN) }
- : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN) };
+ ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(FLUID_IN_SIGN) }
+ : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN) };
}
@Override
@@ -158,8 +158,8 @@ public class GT_MetaTileEntity_Hatch_Input extends GT_MetaTileEntity_Hatch {
@Override
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return aSide == aBaseMetaTileEntity.getFrontFacing() && aIndex == 0
- && (mRecipeMap == null || mRecipeMap.containsInput(aStack)
- || mRecipeMap.containsInput(GT_Utility.getFluidForFilledItem(aStack, true)));
+ && (mRecipeMap == null || mRecipeMap.containsInput(aStack)
+ || mRecipeMap.containsInput(GT_Utility.getFluidForFilledItem(aStack, true)));
}
@Override
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java
index a9235ba430..4bbb98c1da 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java
@@ -29,7 +29,7 @@ import gregtech.api.util.GT_Utility;
import gregtech.api.util.extensions.ArrayExt;
public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch
- implements IConfigurationCircuitSupport, IAddUIWidgets {
+ implements IConfigurationCircuitSupport, IAddUIWidgets {
public GT_Recipe_Map mRecipeMap = null;
public boolean disableSort;
@@ -41,21 +41,21 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch
}
protected GT_MetaTileEntity_Hatch_InputBus(int id, String name, String nameRegional, int tier, int slots,
- String[] description) {
+ String[] description) {
super(id, name, nameRegional, tier, slots, description);
}
public GT_MetaTileEntity_Hatch_InputBus(int id, String name, String nameRegional, int tier, int slots) {
super(
- id,
- name,
- nameRegional,
- tier,
- slots,
- ArrayExt.of(
- "Item Input for Multiblocks",
- "Shift + right click with screwdriver to turn Sort mode on/off",
- "Capacity: " + getSlots(tier) + " stack" + (getSlots(tier) >= 2 ? "s" : "")));
+ id,
+ name,
+ nameRegional,
+ tier,
+ slots,
+ ArrayExt.of(
+ "Item Input for Multiblocks",
+ "Shift + right click with screwdriver to turn Sort mode on/off",
+ "Capacity: " + getSlots(tier) + " stack" + (getSlots(tier) >= 2 ? "s" : "")));
}
@Deprecated
@@ -70,22 +70,22 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch
}
public GT_MetaTileEntity_Hatch_InputBus(String aName, int aTier, int aSlots, String[] aDescription,
- ITexture[][][] aTextures) {
+ ITexture[][][] aTextures) {
super(aName, aTier, aSlots, aDescription, aTextures);
}
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch
- ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(ITEM_IN_SIGN) }
- : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN) };
+ ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(ITEM_IN_SIGN) }
+ : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN) };
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch
- ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(ITEM_IN_SIGN) }
- : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN) };
+ ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(ITEM_IN_SIGN) }
+ : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN) };
}
@Override
@@ -132,8 +132,8 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch
@Override
public void initDefaultModes(NBTTagCompound aNBT) {
if (!getBaseMetaTileEntity().getWorld().isRemote) {
- GT_ClientPreference tPreference = GT_Mod.gregtechproxy.getClientPreference(
- getBaseMetaTileEntity().getOwnerUuid());
+ GT_ClientPreference tPreference = GT_Mod.gregtechproxy
+ .getClientPreference(getBaseMetaTileEntity().getOwnerUuid());
if (tPreference != null) disableFilter = !tPreference.isInputBusInitialFilterEnabled();
}
}
@@ -175,7 +175,7 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch
int slot = validSlots.get(slotindex);
slotindex++;
mInventory[slot] = stacks.get(sID)
- .copy();
+ .copy();
toSet = Math.min(toSet, mInventory[slot].getMaxStackSize());
mInventory[slot].stackSize = toSet;
slots.merge(sID, toSet, (a, b) -> a - b);
@@ -203,8 +203,7 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch
@Override
public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
if (!getBaseMetaTileEntity().getCoverInfoAtSide(aSide)
- .isGUIClickable())
- return;
+ .isGUIClickable()) return;
if (aPlayer.isSneaking()) {
if (disableSort) {
disableSort = false;
@@ -217,14 +216,13 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch
}
}
GT_Utility.sendChatToPlayer(
- aPlayer,
- StatCollector.translateToLocal("GT5U.hatch.disableSort." + disableSort) + " "
- + StatCollector.translateToLocal("GT5U.hatch.disableLimited." + disableLimited));
+ aPlayer,
+ StatCollector.translateToLocal("GT5U.hatch.disableSort." + disableSort) + " "
+ + StatCollector.translateToLocal("GT5U.hatch.disableLimited." + disableLimited));
} else {
disableFilter = !disableFilter;
- GT_Utility.sendChatToPlayer(
- aPlayer,
- StatCollector.translateToLocal("GT5U.hatch.disableFilter." + disableFilter));
+ GT_Utility
+ .sendChatToPlayer(aPlayer, StatCollector.translateToLocal("GT5U.hatch.disableFilter." + disableFilter));
}
}
@@ -237,8 +235,8 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch
@Override
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return aSide == getBaseMetaTileEntity().getFrontFacing() && aIndex != getCircuitSlot()
- && (mRecipeMap == null || disableFilter || mRecipeMap.containsInput(aStack))
- && (disableLimited || limitedAllowPutStack(aIndex, aStack));
+ && (mRecipeMap == null || disableFilter || mRecipeMap.containsInput(aStack))
+ && (disableLimited || limitedAllowPutStack(aIndex, aStack));
}
protected boolean limitedAllowPutStack(int aIndex, ItemStack aStack) {
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java
index a2d30a9d72..12a55d097c 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java
@@ -44,7 +44,7 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch
private static ItemStack[] sAutoMaintenanceInputs;
public boolean mWrench = false, mScrewdriver = false, mSoftHammer = false, mHardHammer = false,
- mSolderingTool = false, mCrowbar = false, mAuto;
+ mSolderingTool = false, mCrowbar = false, mAuto;
public GT_MetaTileEntity_Hatch_Maintenance(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier, 1, "For maintaining Multiblocks");
@@ -57,22 +57,22 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch
}
public GT_MetaTileEntity_Hatch_Maintenance(String aName, int aTier, String aDescription, ITexture[][][] aTextures,
- boolean aAuto) {
+ boolean aAuto) {
super(aName, aTier, aAuto ? 4 : 1, aDescription, aTextures);
mAuto = aAuto;
}
public GT_MetaTileEntity_Hatch_Maintenance(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures,
- boolean aAuto) {
+ boolean aAuto) {
super(aName, aTier, aAuto ? 4 : 1, aDescription, aTextures);
mAuto = aAuto;
}
private static ItemStack[] getAutoMaintenanceInputs() {
if (sAutoMaintenanceInputs == null) sAutoMaintenanceInputs = new ItemStack[] { ItemList.Duct_Tape.get(4),
- GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Lubricant, 2),
- GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Steel, 4),
- GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2) };
+ GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Lubricant, 2),
+ GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Steel, 4),
+ GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2) };
return sAutoMaintenanceInputs;
}
@@ -96,22 +96,22 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
if (mAuto) return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_AUTOMAINTENANCE_IDLE),
- TextureFactory.builder()
- .addIcon(OVERLAY_AUTOMAINTENANCE_IDLE_GLOW)
- .glow()
- .build() };
+ TextureFactory.builder()
+ .addIcon(OVERLAY_AUTOMAINTENANCE_IDLE_GLOW)
+ .glow()
+ .build() };
return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_MAINTENANCE) };
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
if (mAuto) return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_AUTOMAINTENANCE),
- TextureFactory.builder()
- .addIcon(OVERLAY_AUTOMAINTENANCE_GLOW)
- .glow()
- .build() };
+ TextureFactory.builder()
+ .addIcon(OVERLAY_AUTOMAINTENANCE_GLOW)
+ .glow()
+ .build() };
return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_MAINTENANCE),
- TextureFactory.of(OVERLAY_DUCTTAPE) };
+ TextureFactory.of(OVERLAY_DUCTTAPE) };
}
@Override
@@ -148,14 +148,13 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch
@Override
public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX,
- float aY, float aZ) {
+ float aY, float aZ) {
if (aBaseMetaTileEntity.isClientSide()) return true;
if (aSide == aBaseMetaTileEntity.getFrontFacing()) {
// only allow OC robot fake player
if (aPlayer instanceof FakePlayer && !aPlayer.getGameProfile()
- .getName()
- .endsWith(".robot"))
- return false;
+ .getName()
+ .endsWith(".robot")) return false;
ItemStack tStack = aPlayer.getCurrentEquippedItem();
if (tStack != null) {
if (tStack.getItem() instanceof ItemToolbox) {
@@ -202,10 +201,8 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch
amt = tStack.stackSize;
boolean temp = true;
for (ItemStack aStack : mInventory) {
- if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(
- GT_OreDictUnificator.get(false, aStack),
- tStack,
- true))) {
+ if ((GT_Utility.areUnificationsEqual(aStack, tStack, true)
+ || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true))) {
amt -= aStack.stackSize;
if (amt < 1) {
temp = false;
@@ -222,10 +219,8 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch
if (tStack != null) {
amt = tStack.stackSize;
for (ItemStack aStack : mInventory) {
- if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(
- GT_OreDictUnificator.get(false, aStack),
- tStack,
- true))) {
+ if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility
+ .areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true))) {
if (aStack.stackSize < amt) {
amt -= aStack.stackSize;
aStack.stackSize = 0;
@@ -259,20 +254,15 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch
}
if (GT_Utility.isStackInList(aStack, GregTech_API.sWrenchList) && !mWrench
- && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer))
- mWrench = true;
+ && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mWrench = true;
if (GT_Utility.isStackInList(aStack, GregTech_API.sScrewdriverList) && !mScrewdriver
- && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer))
- mScrewdriver = true;
+ && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mScrewdriver = true;
if (GT_Utility.isStackInList(aStack, GregTech_API.sSoftHammerList) && !mSoftHammer
- && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer))
- mSoftHammer = true;
+ && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mSoftHammer = true;
if (GT_Utility.isStackInList(aStack, GregTech_API.sHardHammerList) && !mHardHammer
- && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer))
- mHardHammer = true;
+ && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mHardHammer = true;
if (GT_Utility.isStackInList(aStack, GregTech_API.sCrowbarList) && !mCrowbar
- && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer))
- mCrowbar = true;
+ && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mCrowbar = true;
if (!mSolderingTool && GT_ModHandler.useSolderingIron(aStack, aPlayer, aToolboxInventory))
mSolderingTool = true;
if (GT_OreDictUnificator.isItemStackInstanceOf(aStack, "craftingDuctTape")) {
@@ -312,12 +302,11 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
if (mAuto && GT_Mod.gregtechproxy.mAMHInteraction) {
for (int i = 0; i < getSizeInventory(); i++) if (GT_Utility.areStacksEqual(
- GT_OreDictUnificator.get(false, aStack),
- GT_OreDictUnificator.get(false, getStackInSlot(i))))
- return i == aIndex;
+ GT_OreDictUnificator.get(false, aStack),
+ GT_OreDictUnificator.get(false, getStackInSlot(i)))) return i == aIndex;
for (ItemStack tInput : getAutoMaintenanceInputs())
if (GT_Utility.areUnificationsEqual(tInput, aStack, true)
- || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tInput, true))
+ || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tInput, true))
return true;
}
return false;
@@ -334,33 +323,33 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch
getBaseMetaTileEntity().add2by2Slots(builder);
} else {
builder.widget(
- new DrawableWidget().setDrawable(GT_UITextures.SLOT_MAINTENANCE)
- .setPos(78, 33)
- .setSize(20, 20))
- .widget(new SlotWidget(BaseSlot.empty()) {
-
- @Override
- public boolean handleDragAndDrop(ItemStack draggedStack, int button) {
- return false;
- }
-
- @Override
- protected void phantomClick(ClickData clickData, ItemStack cursorStack) {
- if (cursorStack == null) return;
- onToolClick(cursorStack, getContext().getPlayer());
- if (cursorStack.stackSize < 1) {
- getContext().getPlayer().inventory.setItemStack(null);
- }
- if (getContext().getPlayer() instanceof EntityPlayerMP) {
- ((EntityPlayerMP) getContext().getPlayer()).updateHeldItem();
- }
- }
- }.disableShiftInsert()
+ new DrawableWidget().setDrawable(GT_UITextures.SLOT_MAINTENANCE)
+ .setPos(78, 33)
+ .setSize(20, 20))
+ .widget(new SlotWidget(BaseSlot.empty()) {
+
+ @Override
+ public boolean handleDragAndDrop(ItemStack draggedStack, int button) {
+ return false;
+ }
+
+ @Override
+ protected void phantomClick(ClickData clickData, ItemStack cursorStack) {
+ if (cursorStack == null) return;
+ onToolClick(cursorStack, getContext().getPlayer());
+ if (cursorStack.stackSize < 1) {
+ getContext().getPlayer().inventory.setItemStack(null);
+ }
+ if (getContext().getPlayer() instanceof EntityPlayerMP) {
+ ((EntityPlayerMP) getContext().getPlayer()).updateHeldItem();
+ }
+ }
+ }.disableShiftInsert()
.setBackground(GT_UITextures.TRANSPARENT)
.setPos(79, 34))
- .widget(
- new TextWidget("Click with Tool to repair.").setDefaultColor(COLOR_TEXT_GRAY.get())
- .setPos(8, 12));
+ .widget(
+ new TextWidget("Click with Tool to repair.").setDefaultColor(COLOR_TEXT_GRAY.get())
+ .setPos(8, 12));
}
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java
index f0f1705b1f..1fdafd7f35 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java
@@ -27,14 +27,14 @@ import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_Cleanroom;
public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
private static final String localizedDescFormat = GT_LanguageManager.addStringLocalization(
- "gt.blockmachines.hatch.muffler.desc.format",
- "Outputs the Pollution (Might cause ... things)%n" + "DO NOT OBSTRUCT THE OUTPUT!%n"
- + "Reduces Pollution to %d%%%n"
- + "Recovers %d%% of CO2/CO/SO2");
+ "gt.blockmachines.hatch.muffler.desc.format",
+ "Outputs the Pollution (Might cause ... things)%n" + "DO NOT OBSTRUCT THE OUTPUT!%n"
+ + "Reduces Pollution to %d%%%n"
+ + "Recovers %d%% of CO2/CO/SO2");
private final int pollutionReduction = calculatePollutionReduction(100);
private final int pollutionRecover = 100 - pollutionReduction;
private final String[] description = String.format(localizedDescFormat, pollutionReduction, pollutionRecover)
- .split("\\R");
+ .split("\\R");
private final boolean[] facings = new boolean[ForgeDirection.VALID_DIRECTIONS.length];
public GT_MetaTileEntity_Hatch_Muffler(int aID, String aName, String aNameRegional, int aTier) {
@@ -42,7 +42,7 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
}
public GT_MetaTileEntity_Hatch_Muffler(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount,
- String[] aDescription, ITexture... aTextures) {
+ String[] aDescription, ITexture... aTextures) {
super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures);
}
@@ -55,7 +55,7 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
}
public GT_MetaTileEntity_Hatch_Muffler(String aName, int aTier, int aInvSlotCount, String[] aDescription,
- ITexture[][][] aTextures) {
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
setInValidFacings(ForgeDirection.DOWN);
}
@@ -104,11 +104,11 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
super.onPostTick(aBaseMetaTileEntity, aTick);
if (aBaseMetaTileEntity.isClientSide() && this.getBaseMetaTileEntity()
- .isActive()) {
+ .isActive()) {
pollutionParticles(
- this.getBaseMetaTileEntity()
- .getWorld(),
- ParticleFX.LARGE_SMOKE.toString());
+ this.getBaseMetaTileEntity()
+ .getWorld(),
+ ParticleFX.LARGE_SMOKE.toString());
}
}
@@ -163,35 +163,34 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
zSpd = aDir.offsetZ * (0.1F + 0.2F * XSTR_INSTANCE.nextFloat());
}
- WorldSpawnedEventBuilder.ParticleEventBuilder events = new WorldSpawnedEventBuilder.ParticleEventBuilder().setIdentifier(
- name)
- .setWorld(
- aWorld)
- .setMotion(
- xSpd,
- ySpd,
- zSpd);
+ WorldSpawnedEventBuilder.ParticleEventBuilder events = new WorldSpawnedEventBuilder.ParticleEventBuilder()
+ .setIdentifier(name)
+ .setWorld(aWorld)
+ .setMotion(xSpd, ySpd, zSpd);
if (chk1) {
- events.setPosition(
+ events
+ .setPosition(
xPos + ran1 * 0.5F,
yPos + XSTR_INSTANCE.nextFloat() * 0.5F,
zPos + XSTR_INSTANCE.nextFloat() * 0.5F)
- .run();
+ .run();
}
if (chk2) {
- events.setPosition(
+ events
+ .setPosition(
xPos + ran2 * 0.5F,
yPos + XSTR_INSTANCE.nextFloat() * 0.5F,
zPos + XSTR_INSTANCE.nextFloat() * 0.5F)
- .run();
+ .run();
}
if (chk3) {
- events.setPosition(
+ events
+ .setPosition(
xPos + ran3 * 0.5F,
yPos + XSTR_INSTANCE.nextFloat() * 0.5F,
zPos + XSTR_INSTANCE.nextFloat() * 0.5F)
- .run();
+ .run();
}
}
@@ -231,6 +230,6 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
public void setInValidFacings(ForgeDirection... aFacings) {
Arrays.fill(facings, true);
Arrays.stream(aFacings)
- .forEach(face -> facings[face.ordinal()] = false);
+ .forEach(face -> facings[face.ordinal()] = false);
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_MultiInput.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_MultiInput.java
index 1b7fedce22..48d6569f42 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_MultiInput.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_MultiInput.java
@@ -36,7 +36,7 @@ public class GT_MetaTileEntity_Hatch_MultiInput extends GT_MetaTileEntity_Hatch_
}
public GT_MetaTileEntity_Hatch_MultiInput(String aName, int aSlot, int aTier, String[] aDescription,
- ITexture[][][] aTextures) {
+ ITexture[][][] aTextures) {
super(aName, aSlot, aTier, aDescription, aTextures);
this.mStoredFluid = new FluidStack[aSlot];
mCapacityPer = 8000 * (1 << aTier) / aSlot;
@@ -172,9 +172,7 @@ public class GT_MetaTileEntity_Hatch_MultiInput extends GT_MetaTileEntity_Hatch_
@Override
public int fill(FluidStack aFluid, boolean doFill) {
if (aFluid == null || aFluid.getFluid()
- .getID()
- <= 0 || aFluid.amount <= 0 || !canTankBeFilled() || !isFluidInputAllowed(aFluid))
- return 0;
+ .getID() <= 0 || aFluid.amount <= 0 || !canTankBeFilled() || !isFluidInputAllowed(aFluid)) return 0;
if (!hasFluid(aFluid) && getFirstEmptySlot() != -1) {
int tFilled = Math.min(aFluid.amount, mCapacityPer);
if (doFill) {
@@ -297,42 +295,35 @@ public class GT_MetaTileEntity_Hatch_MultiInput extends GT_MetaTileEntity_Hatch_
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
final int SLOT_NUMBER = 4;
final Pos2d[] positions = new Pos2d[] { new Pos2d(70, 25), new Pos2d(88, 25), new Pos2d(70, 43),
- new Pos2d(88, 43), };
+ new Pos2d(88, 43), };
for (int i = 0; i < SLOT_NUMBER; i++) {
final int slotId = i;
builder.widget(
- new FluidDisplaySlotWidget(inventoryHandler, slotId)
- .setFluidAccessConstructor(
- () -> constructFluidAccess(slotId))
- .setIHasFluidDisplay(this)
- .setCanDrain(true)
- .setCanFill(!isDrainableStackSeparate())
- .setActionRealClick(
- FluidDisplaySlotWidget.Action.TRANSFER)
- .setBeforeRealClick((clickData, widget) -> {
- if (NetworkUtils.isClient()) {
- // propagate display item content to
- // actual fluid stored in this tank
- setFluid(
- GT_Utility.getFluidFromDisplayStack(
- widget.getMcSlot()
- .getStack()),
- slotId);
- }
- ItemStack tStackHeld = widget.getContext()
- .getPlayer().inventory.getItemStack();
- FluidStack tFluidHeld = GT_Utility.getFluidForFilledItem(
- tStackHeld,
- true);
- return constructFluidAccess(slotId).isMatch(
- tFluidHeld,
- slotId);
- })
- .setUpdateFluidDisplayItem(
- () -> updateFluidDisplayItem(slotId))
- .setBackground(ModularUITextures.FLUID_SLOT)
- .setPos(positions[slotId]));
+ new FluidDisplaySlotWidget(inventoryHandler, slotId)
+ .setFluidAccessConstructor(() -> constructFluidAccess(slotId))
+ .setIHasFluidDisplay(this)
+ .setCanDrain(true)
+ .setCanFill(!isDrainableStackSeparate())
+ .setActionRealClick(FluidDisplaySlotWidget.Action.TRANSFER)
+ .setBeforeRealClick((clickData, widget) -> {
+ if (NetworkUtils.isClient()) {
+ // propagate display item content to
+ // actual fluid stored in this tank
+ setFluid(
+ GT_Utility.getFluidFromDisplayStack(
+ widget.getMcSlot()
+ .getStack()),
+ slotId);
+ }
+ ItemStack tStackHeld = widget.getContext()
+ .getPlayer().inventory.getItemStack();
+ FluidStack tFluidHeld = GT_Utility.getFluidForFilledItem(tStackHeld, true);
+ return constructFluidAccess(slotId).isMatch(tFluidHeld, slotId);
+ })
+ .setUpdateFluidDisplayItem(() -> updateFluidDisplayItem(slotId))
+ .setBackground(ModularUITextures.FLUID_SLOT)
+ .setPos(positions[slotId]));
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java
index b55350a97e..c3cc1edc9b 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java
@@ -42,16 +42,16 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
public GT_MetaTileEntity_Hatch_Output(int aID, String aName, String aNameRegional, int aTier) {
super(
- aID,
- aName,
- aNameRegional,
- aTier,
- 4,
- new String[] { "Fluid Output for Multiblocks",
- "Capacity: " + GT_Utility.formatNumbers(8000 * (1 << aTier)) + "L",
- "Right click with screwdriver to restrict output",
- "Can be restricted to put out Items and/or Steam/No Steam/1 specific Fluid",
- "Restricted Output Hatches are given priority for Multiblock Fluid output" });
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ 4,
+ new String[] { "Fluid Output for Multiblocks",
+ "Capacity: " + GT_Utility.formatNumbers(8000 * (1 << aTier)) + "L",
+ "Right click with screwdriver to restrict output",
+ "Can be restricted to put out Items and/or Steam/No Steam/1 specific Fluid",
+ "Restricted Output Hatches are given priority for Multiblock Fluid output" });
}
public GT_MetaTileEntity_Hatch_Output(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
@@ -63,29 +63,27 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
}
public GT_MetaTileEntity_Hatch_Output(int aID, String aName, String aNameRegional, int aTier, String[] aDescription,
- int inventorySize) {
+ int inventorySize) {
super(aID, aName, aNameRegional, aTier, inventorySize, aDescription);
}
public GT_MetaTileEntity_Hatch_Output(String name, int tier, int slots, String[] description,
- ITexture[][][] textures) {
+ ITexture[][][] textures) {
super(name, tier, slots, description, textures);
}
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch
- ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT),
- TextureFactory.of(FLUID_OUT_SIGN) }
- : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT) };
+ ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(FLUID_OUT_SIGN) }
+ : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT) };
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch
- ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT),
- TextureFactory.of(FLUID_OUT_SIGN) }
- : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT) };
+ ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(FLUID_OUT_SIGN) }
+ : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT) };
}
@Override
@@ -123,26 +121,24 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
super.onPostTick(aBaseMetaTileEntity, aTick);
if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && mFluid != null) {
- IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(
- aBaseMetaTileEntity.getFrontFacing());
+ IFluidHandler tTileEntity = aBaseMetaTileEntity
+ .getITankContainerAtSide(aBaseMetaTileEntity.getFrontFacing());
if (tTileEntity != null) {
FluidStack tDrained = aBaseMetaTileEntity.drain(
- ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing()),
- Math.max(1, mFluid.amount),
- false);
+ ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing()),
+ Math.max(1, mFluid.amount),
+ false);
if (tDrained != null) {
- int tFilledAmount = tTileEntity.fill(
- ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()),
- tDrained,
- false);
+ int tFilledAmount = tTileEntity
+ .fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tDrained, false);
if (tFilledAmount > 0) {
tTileEntity.fill(
- ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()),
- aBaseMetaTileEntity.drain(
- ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing()),
- tFilledAmount,
- true),
- true);
+ ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()),
+ aBaseMetaTileEntity.drain(
+ ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing()),
+ tFilledAmount,
+ true),
+ true);
}
}
}
@@ -166,7 +162,7 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
lockedFluidName = lockedFluidName.length() == 0 ? null : lockedFluidName;
if (GT_Utility.getFluidFromUnlocalizedName(lockedFluidName) != null) {
lockedFluidName = GT_Utility.getFluidFromUnlocalizedName(lockedFluidName)
- .getName();
+ .getName();
}
}
@@ -243,8 +239,7 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
@Override
public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
if (!getBaseMetaTileEntity().getCoverInfoAtSide(aSide)
- .isGUIClickable())
- return;
+ .isGUIClickable()) return;
if (aPlayer.isSneaking()) {
mMode = (byte) ((mMode + 9) % 10);
} else {
@@ -289,49 +284,48 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
if (mFluid == null) {
this.setLockedFluidName(null);
inBrackets = GT_Utility.trans(
- "115.3",
- "currently none, will be locked to the next that is put in (or use fluid cell to lock)");
+ "115.3",
+ "currently none, will be locked to the next that is put in (or use fluid cell to lock)");
} else {
this.setLockedFluidName(
- this.getDrainableStack()
- .getFluid()
- .getName());
+ this.getDrainableStack()
+ .getFluid()
+ .getName());
inBrackets = this.getDrainableStack()
- .getLocalizedName();
+ .getLocalizedName();
}
GT_Utility.sendChatToPlayer(
- aPlayer,
- String.format(
- "%s (%s)",
- GT_Utility.trans("151.1", "Outputs items and 1 specific Fluid"),
- inBrackets));
+ aPlayer,
+ String.format(
+ "%s (%s)",
+ GT_Utility.trans("151.1", "Outputs items and 1 specific Fluid"),
+ inBrackets));
}
case 9 -> {
playerThatLockedfluid = new WeakReference<>(aPlayer);
if (mFluid == null) {
this.setLockedFluidName(null);
inBrackets = GT_Utility.trans(
- "115.3",
- "currently none, will be locked to the next that is put in (or use fluid cell to lock)");
+ "115.3",
+ "currently none, will be locked to the next that is put in (or use fluid cell to lock)");
} else {
this.setLockedFluidName(
- this.getDrainableStack()
- .getFluid()
- .getName());
+ this.getDrainableStack()
+ .getFluid()
+ .getName());
inBrackets = this.getDrainableStack()
- .getLocalizedName();
+ .getLocalizedName();
}
GT_Utility.sendChatToPlayer(
- aPlayer,
- String.format("%s (%s)", GT_Utility.trans("151.2", "Outputs 1 specific Fluid"), inBrackets));
+ aPlayer,
+ String.format("%s (%s)", GT_Utility.trans("151.2", "Outputs 1 specific Fluid"), inBrackets));
}
}
}
private boolean tryToLockHatch(EntityPlayer aPlayer, byte aSide) {
if (!getBaseMetaTileEntity().getCoverInfoAtSide(aSide)
- .isGUIClickable())
- return false;
+ .isGUIClickable()) return false;
if (!isFluidLocked()) return false;
final ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem();
if (tCurrentItem == null) return false;
@@ -340,32 +334,32 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
tFluid = ((IFluidContainerItem) tCurrentItem.getItem()).getFluid(tCurrentItem);
if (tFluid != null) {
if (getLockedFluidName() != null && !getLockedFluidName().equals(
- tFluid.getFluid()
- .getName())) {
+ tFluid.getFluid()
+ .getName())) {
GT_Utility.sendChatToPlayer(
- aPlayer,
- String.format(
- "%s %s",
- GT_Utility.trans(
- "151.3",
- "Hatch is locked to a different fluid. To change the locking, empty it and made it locked to the next fluid with a screwdriver. Currently locked to"),
- StatCollector.translateToLocal(getLockedFluidName())));
+ aPlayer,
+ String.format(
+ "%s %s",
+ GT_Utility.trans(
+ "151.3",
+ "Hatch is locked to a different fluid. To change the locking, empty it and made it locked to the next fluid with a screwdriver. Currently locked to"),
+ StatCollector.translateToLocal(getLockedFluidName())));
} else {
setLockedFluidName(
- tFluid.getFluid()
- .getName());
+ tFluid.getFluid()
+ .getName());
if (mMode == 8) GT_Utility.sendChatToPlayer(
- aPlayer,
- String.format(
- "%s (%s)",
- GT_Utility.trans("151.1", "Outputs items and 1 specific Fluid"),
- tFluid.getLocalizedName()));
+ aPlayer,
+ String.format(
+ "%s (%s)",
+ GT_Utility.trans("151.1", "Outputs items and 1 specific Fluid"),
+ tFluid.getLocalizedName()));
else GT_Utility.sendChatToPlayer(
- aPlayer,
- String.format(
- "%s (%s)",
- GT_Utility.trans("151.2", "Outputs 1 specific Fluid"),
- tFluid.getLocalizedName()));
+ aPlayer,
+ String.format(
+ "%s (%s)",
+ GT_Utility.trans("151.2", "Outputs 1 specific Fluid"),
+ tFluid.getLocalizedName()));
}
return true;
}
@@ -378,7 +372,7 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
@Override
public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX,
- float aY, float aZ) {
+ float aY, float aZ) {
if (tryToLockHatch(aPlayer, aSide)) return true;
return super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ);
}
@@ -447,15 +441,13 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
protected void onEmptyingContainerWhenEmpty() {
if (this.lockedFluidName == null && this.mFluid != null && isFluidLocked()) {
this.setLockedFluidName(
- this.mFluid.getFluid()
- .getName());
+ this.mFluid.getFluid()
+ .getName());
final EntityPlayer player;
if (playerThatLockedfluid == null || (player = playerThatLockedfluid.get()) == null) return;
GT_Utility.sendChatToPlayer(
- player,
- String.format(
- GT_Utility.trans("151.4", "Successfully locked Fluid to %s"),
- mFluid.getLocalizedName()));
+ player,
+ String.format(GT_Utility.trans("151.4", "Successfully locked Fluid to %s"), mFluid.getLocalizedName()));
playerThatLockedfluid = null;
}
}
@@ -468,20 +460,20 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
@Override
public String[] getInfoData() {
return new String[] { EnumChatFormatting.BLUE + "Output Hatch" + EnumChatFormatting.RESET, "Stored Fluid:",
- EnumChatFormatting.GOLD + (mFluid == null ? "No Fluid" : mFluid.getLocalizedName())
- + EnumChatFormatting.RESET,
- EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mFluid == null ? 0 : mFluid.amount)
- + " L"
- + EnumChatFormatting.RESET
- + " "
- + EnumChatFormatting.YELLOW
- + GT_Utility.formatNumbers(getCapacity())
- + " L"
- + EnumChatFormatting.RESET,
- (!isFluidLocked() || lockedFluidName == null) ? "Not Locked"
- : ("Locked to " + StatCollector.translateToLocal(
- FluidRegistry.getFluidStack(lockedFluidName, 1)
- .getUnlocalizedName())) };
+ EnumChatFormatting.GOLD + (mFluid == null ? "No Fluid" : mFluid.getLocalizedName())
+ + EnumChatFormatting.RESET,
+ EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mFluid == null ? 0 : mFluid.amount)
+ + " L"
+ + EnumChatFormatting.RESET
+ + " "
+ + EnumChatFormatting.YELLOW
+ + GT_Utility.formatNumbers(getCapacity())
+ + " L"
+ + EnumChatFormatting.RESET,
+ (!isFluidLocked() || lockedFluidName == null) ? "Not Locked"
+ : ("Locked to " + StatCollector.translateToLocal(
+ FluidRegistry.getFluidStack(lockedFluidName, 1)
+ .getUnlocalizedName())) };
}
@Override
@@ -493,51 +485,44 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
super.addUIWidgets(builder, buildContext);
builder.widget(
- new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK)
- .setPos(98, 16)
- .setSize(71, 45))
- .widget(
- new FluidDisplaySlotWidget(inventoryHandler, getLockedDisplaySlot()).setIHasFluidDisplay(this)
- .setActionRealClick(
- FluidDisplaySlotWidget.Action.LOCK)
- .setActionDragAndDrop(
- FluidDisplaySlotWidget.Action.LOCK)
- .setBeforeClick(
- (clickData,
- widget) -> {
- if (NetworkUtils.isClient()) {
- // propagate
- // display
- // item
- // content to
- // actual
- // fluid
- // stored in
- // this tank
- setDrainableStack(
- GT_Utility.getFluidFromDisplayStack(
- mInventory[getStackDisplaySlot()]));
- }
- return true;
- })
- .setBackground(
- GT_UITextures.TRANSPARENT)
- .setPos(149, 41))
- .widget(
- new TextWidget("Locked Fluid").setDefaultColor(COLOR_TEXT_WHITE.get())
- .setPos(101, 20))
- .widget(TextWidget.dynamicString(() -> {
- final ItemStack lockedDisplayStack = mInventory[getLockedDisplaySlot()];
- return lockedDisplayStack == null ? "None" : lockedDisplayStack.getDisplayName();
- })
- .setSynced(false)
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setTextAlignment(Alignment.CenterLeft)
- .setMaxWidth(65)
- .setPos(101, 30))
- // #updateFluidDisplayItem invalidates locked fluid slot
- // if lockedFluidName == null or mMode is incorrect
- .widget(new FakeSyncWidget.StringSyncer(() -> lockedFluidName, val -> lockedFluidName = val))
- .widget(new FakeSyncWidget.ByteSyncer(() -> mMode, val -> mMode = val));
+ new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK)
+ .setPos(98, 16)
+ .setSize(71, 45))
+ .widget(
+ new FluidDisplaySlotWidget(inventoryHandler, getLockedDisplaySlot()).setIHasFluidDisplay(this)
+ .setActionRealClick(FluidDisplaySlotWidget.Action.LOCK)
+ .setActionDragAndDrop(FluidDisplaySlotWidget.Action.LOCK)
+ .setBeforeClick((clickData, widget) -> {
+ if (NetworkUtils.isClient()) {
+ // propagate
+ // display
+ // item
+ // content to
+ // actual
+ // fluid
+ // stored in
+ // this tank
+ setDrainableStack(GT_Utility.getFluidFromDisplayStack(mInventory[getStackDisplaySlot()]));
+ }
+ return true;
+ })
+ .setBackground(GT_UITextures.TRANSPARENT)
+ .setPos(149, 41))
+ .widget(
+ new TextWidget("Locked Fluid").setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setPos(101, 20))
+ .widget(TextWidget.dynamicString(() -> {
+ final ItemStack lockedDisplayStack = mInventory[getLockedDisplaySlot()];
+ return lockedDisplayStack == null ? "None" : lockedDisplayStack.getDisplayName();
+ })
+ .setSynced(false)
+ .setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setTextAlignment(Alignment.CenterLeft)
+ .setMaxWidth(65)
+ .setPos(101, 30))
+ // #updateFluidDisplayItem invalidates locked fluid slot
+ // if lockedFluidName == null or mMode is incorrect
+ .widget(new FakeSyncWidget.StringSyncer(() -> lockedFluidName, val -> lockedFluidName = val))
+ .widget(new FakeSyncWidget.ByteSyncer(() -> mMode, val -> mMode = val));
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java
index 633d82566c..f04840d7d3 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java
@@ -29,23 +29,23 @@ public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch i
public GT_MetaTileEntity_Hatch_OutputBus(int id, String name, String nameRegional, int tier, int slots) {
super(
- id,
- name,
- nameRegional,
- tier,
- slots,
- ArrayExt.of(
- "Item Output for Multiblocks",
- "Capacity: " + getSlots(tier) + " stack" + (getSlots(tier) >= 2 ? "s" : "")));
+ id,
+ name,
+ nameRegional,
+ tier,
+ slots,
+ ArrayExt.of(
+ "Item Output for Multiblocks",
+ "Capacity: " + getSlots(tier) + " stack" + (getSlots(tier) >= 2 ? "s" : "")));
}
public GT_MetaTileEntity_Hatch_OutputBus(int aID, String aName, String aNameRegional, int aTier,
- String[] aDescription) {
+ String[] aDescription) {
super(aID, aName, aNameRegional, aTier, getSlots(aTier), aDescription);
}
public GT_MetaTileEntity_Hatch_OutputBus(int aID, String aName, String aNameRegional, int aTier,
- String[] aDescription, int inventorySize) {
+ String[] aDescription, int inventorySize) {
super(aID, aName, aNameRegional, aTier, inventorySize, aDescription);
}
@@ -61,22 +61,22 @@ public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch i
}
public GT_MetaTileEntity_Hatch_OutputBus(String name, int tier, int slots, String[] description,
- ITexture[][][] textures) {
+ ITexture[][][] textures) {
super(name, tier, slots, description, textures);
}
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch
- ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(ITEM_OUT_SIGN) }
- : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT) };
+ ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(ITEM_OUT_SIGN) }
+ : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT) };
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch
- ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(ITEM_OUT_SIGN) }
- : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT) };
+ ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(ITEM_OUT_SIGN) }
+ : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT) };
}
@Override
@@ -131,7 +131,7 @@ public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch i
} else {
int tRealStackLimit = Math.min(getInventoryStackLimit(), tSlot.getMaxStackSize());
if (tSlot.stackSize < tRealStackLimit && tSlot.isItemEqual(aStack)
- && ItemStack.areItemStackTagsEqual(tSlot, aStack)) {
+ && ItemStack.areItemStackTagsEqual(tSlot, aStack)) {
if (aStack.stackSize + tSlot.stackSize <= tRealStackLimit) {
mInventory[i].stackSize += aStack.stackSize;
return true;
@@ -160,21 +160,21 @@ public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch i
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
super.onPostTick(aBaseMetaTileEntity, aTick);
if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && (aTick & 0x7) == 0) {
- final IInventory tTileEntity = aBaseMetaTileEntity.getIInventoryAtSide(
- aBaseMetaTileEntity.getFrontFacing());
+ final IInventory tTileEntity = aBaseMetaTileEntity
+ .getIInventoryAtSide(aBaseMetaTileEntity.getFrontFacing());
if (tTileEntity != null) {
moveMultipleItemStacks(
- aBaseMetaTileEntity,
- tTileEntity,
- aBaseMetaTileEntity.getFrontFacing(),
- aBaseMetaTileEntity.getBackFacing(),
- null,
- false,
- (byte) 64,
- (byte) 1,
- (byte) 64,
- (byte) 1,
- mInventory.length);
+ aBaseMetaTileEntity,
+ tTileEntity,
+ aBaseMetaTileEntity.getFrontFacing(),
+ aBaseMetaTileEntity.getBackFacing(),
+ null,
+ false,
+ (byte) 64,
+ (byte) 1,
+ (byte) 64,
+ (byte) 1,
+ mInventory.length);
for (int i = 0; i < mInventory.length; i++)
if (mInventory[i] != null && mInventory[i].stackSize <= 0) mInventory[i] = null;
// GT_Utility.moveOneItemStack(aBaseMetaTileEntity, tTileEntity,
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java
index e26029b629..0f5f5dcc85 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java
@@ -62,14 +62,14 @@ import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase
import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeTurbine;
public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
- implements IAddGregtechLogo, IAddUIWidgets, IBindPlayerInventoryUI {
+ implements IAddGregtechLogo, IAddUIWidgets, IBindPlayerInventoryUI {
public static boolean disableMaintenance;
public boolean mMachine = false, mWrench = false, mScrewdriver = false, mSoftHammer = false, mHardHammer = false,
- mSolderingTool = false, mCrowbar = false, mRunningOnLoad = false;
+ mSolderingTool = false, mCrowbar = false, mRunningOnLoad = false;
public boolean mStructureChanged = false;
public int mPollution = 0, mProgresstime = 0, mMaxProgresstime = 0, mEUt = 0, mEfficiencyIncrease = 0,
- mStartUpCheck = 100, mRuntime = 0, mEfficiency = 0;
+ mStartUpCheck = 100, mRuntime = 0, mEfficiency = 0;
public volatile boolean mUpdated = false;
public int mUpdate = 0;
public ItemStack[] mOutputItems = null;
@@ -104,43 +104,30 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
public GT_MetaTileEntity_MultiBlockBase(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, 2);
- GT_MetaTileEntity_MultiBlockBase.disableMaintenance = GregTech_API.sMachineFile.get(
- ConfigCategories.machineconfig,
- "MultiBlockMachines.disableMaintenance",
- false);
- this.damageFactorLow = GregTech_API.sMachineFile.get(
- ConfigCategories.machineconfig,
- "MultiBlockMachines.damageFactorLow",
- 5);
- this.damageFactorHigh = (float) GregTech_API.sMachineFile.get(
- ConfigCategories.machineconfig,
- "MultiBlockMachines.damageFactorHigh",
- 0.6f);
+ GT_MetaTileEntity_MultiBlockBase.disableMaintenance = GregTech_API.sMachineFile
+ .get(ConfigCategories.machineconfig, "MultiBlockMachines.disableMaintenance", false);
+ this.damageFactorLow = GregTech_API.sMachineFile
+ .get(ConfigCategories.machineconfig, "MultiBlockMachines.damageFactorLow", 5);
+ this.damageFactorHigh = (float) GregTech_API.sMachineFile
+ .get(ConfigCategories.machineconfig, "MultiBlockMachines.damageFactorHigh", 0.6f);
this.mNEI = "";
}
public GT_MetaTileEntity_MultiBlockBase(String aName) {
super(aName, 2);
- GT_MetaTileEntity_MultiBlockBase.disableMaintenance = GregTech_API.sMachineFile.get(
- ConfigCategories.machineconfig,
- "MultiBlockMachines.disableMaintenance",
- false);
- this.damageFactorLow = GregTech_API.sMachineFile.get(
- ConfigCategories.machineconfig,
- "MultiBlockMachines.damageFactorLow",
- 5);
- this.damageFactorHigh = (float) GregTech_API.sMachineFile.get(
- ConfigCategories.machineconfig,
- "MultiBlockMachines.damageFactorHigh",
- 0.6f);
+ GT_MetaTileEntity_MultiBlockBase.disableMaintenance = GregTech_API.sMachineFile
+ .get(ConfigCategories.machineconfig, "MultiBlockMachines.disableMaintenance", false);
+ this.damageFactorLow = GregTech_API.sMachineFile
+ .get(ConfigCategories.machineconfig, "MultiBlockMachines.damageFactorLow", 5);
+ this.damageFactorHigh = (float) GregTech_API.sMachineFile
+ .get(ConfigCategories.machineconfig, "MultiBlockMachines.damageFactorHigh", 0.6f);
}
public static boolean isValidMetaTileEntity(MetaTileEntity aMetaTileEntity) {
return aMetaTileEntity.getBaseMetaTileEntity() != null && aMetaTileEntity.getBaseMetaTileEntity()
- .getMetaTileEntity()
- == aMetaTileEntity
- && !aMetaTileEntity.getBaseMetaTileEntity()
- .isDead();
+ .getMetaTileEntity() == aMetaTileEntity
+ && !aMetaTileEntity.getBaseMetaTileEntity()
+ .isDead();
}
@Override
@@ -164,8 +151,8 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
mLockedToSingleRecipe = !mLockedToSingleRecipe;
if (mLockedToSingleRecipe) {
GT_Utility.sendChatToPlayer(
- aPlayer,
- GT_Utility.trans("223", "Single recipe locking enabled. Will lock to next recipe."));
+ aPlayer,
+ GT_Utility.trans("223", "Single recipe locking enabled. Will lock to next recipe."));
} else {
GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("220", "Single recipe locking disabled."));
mSingleRecipeCheck = null;
@@ -377,13 +364,13 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
}
}
aBaseMetaTileEntity.setErrorDisplayID(
- (aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mWrench ? 0 : 1)
- | (mScrewdriver ? 0 : 2)
- | (mSoftHammer ? 0 : 4)
- | (mHardHammer ? 0 : 8)
- | (mSolderingTool ? 0 : 16)
- | (mCrowbar ? 0 : 32)
- | (mMachine ? 0 : 64));
+ (aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mWrench ? 0 : 1)
+ | (mScrewdriver ? 0 : 2)
+ | (mSoftHammer ? 0 : 4)
+ | (mHardHammer ? 0 : 8)
+ | (mSolderingTool ? 0 : 16)
+ | (mCrowbar ? 0 : 32)
+ | (mMachine ? 0 : 64));
aBaseMetaTileEntity.setActive(mMaxProgresstime > 0);
boolean active = aBaseMetaTileEntity.isActive() && mPollution > 0;
setMufflers(active);
@@ -406,7 +393,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
for (GT_MetaTileEntity_Hatch_Maintenance tHatch : mMaintenanceHatches) {
if (isValidMetaTileEntity(tHatch)) {
if (tHatch.mAuto
- && !(mWrench && mScrewdriver && mSoftHammer && mHardHammer && mSolderingTool && mCrowbar))
+ && !(mWrench && mScrewdriver && mSoftHammer && mHardHammer && mSolderingTool && mCrowbar))
tHatch.autoMaintainance();
if (tHatch.mWrench) mWrench = true;
if (tHatch.mScrewdriver) mScrewdriver = true;
@@ -446,9 +433,9 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
if (mOutputItems != null) for (ItemStack tStack : mOutputItems) if (tStack != null) {
try {
GT_Mod.achievements.issueAchivementHatch(
- aBaseMetaTileEntity.getWorld()
- .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()),
- tStack);
+ aBaseMetaTileEntity.getWorld()
+ .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()),
+ tStack);
} catch (Exception ignored) {}
addOutput(tStack);
}
@@ -456,10 +443,10 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
addFluidOutputs(mOutputFluids);
}
mEfficiency = Math.max(
- 0,
- Math.min(
- mEfficiency + mEfficiencyIncrease,
- getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000)));
+ 0,
+ Math.min(
+ mEfficiency + mEfficiencyIncrease,
+ getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000)));
mOutputItems = null;
mProgresstime = 0;
mMaxProgresstime = 0;
@@ -471,9 +458,9 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
if (mOutputFluids.length > 1) {
try {
GT_Mod.achievements.issueAchievement(
- aBaseMetaTileEntity.getWorld()
- .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()),
- "oilplant");
+ aBaseMetaTileEntity.getWorld()
+ .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()),
+ "oilplant");
} catch (Exception ignored) {}
}
}
@@ -481,7 +468,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
}
} else {
if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()
- || aBaseMetaTileEntity.hasInventoryBeenModified()) {
+ || aBaseMetaTileEntity.hasInventoryBeenModified()) {
if (aBaseMetaTileEntity.isAllowedToWork()) {
if (checkRecipe()) {
@@ -517,13 +504,8 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
if (getProcessStartSound() != null)
GT_Utility.doSoundAtClient(getProcessStartSound(), getTimeBetweenProcessSounds(), 1.0F, aX, aY, aZ);
}
- case INTERRUPT_SOUND_INDEX -> GT_Utility.doSoundAtClient(
- SoundResource.IC2_MACHINES_INTERRUPT_ONE,
- 100,
- 1.0F,
- aX,
- aY,
- aZ);
+ case INTERRUPT_SOUND_INDEX -> GT_Utility
+ .doSoundAtClient(SoundResource.IC2_MACHINES_INTERRUPT_ONE, 100, 1.0F, aX, aY, aZ);
}
}
@@ -542,8 +524,8 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
if (activitySoundLoop == null) {
activitySoundLoop = new GT_SoundLoop(activitySound, getBaseMetaTileEntity(), false, true);
Minecraft.getMinecraft()
- .getSoundHandler()
- .playSound(activitySoundLoop);
+ .getSoundHandler()
+ .playSound(activitySoundLoop);
}
} else {
if (activitySoundLoop != null) {
@@ -658,10 +640,10 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
public int getRepairStatus() {
return (mWrench ? 1 : 0) + (mScrewdriver ? 1 : 0)
- + (mSoftHammer ? 1 : 0)
- + (mHardHammer ? 1 : 0)
- + (mSolderingTool ? 1 : 0)
- + (mCrowbar ? 1 : 0);
+ + (mSoftHammer ? 1 : 0)
+ + (mHardHammer ? 1 : 0)
+ + (mSolderingTool ? 1 : 0)
+ + (mCrowbar ? 1 : 0);
}
public int getIdealStatus() {
@@ -691,15 +673,14 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
}
}
if (mInventory[1] != null && getBaseMetaTileEntity().getRandomNumber(2) == 0
- && !mInventory[1].getUnlocalizedName()
- .startsWith("gt.blockmachines.basicmachine.")) {
+ && !mInventory[1].getUnlocalizedName()
+ .startsWith("gt.blockmachines.basicmachine.")) {
if (mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) {
NBTTagCompound tNBT = mInventory[1].getTagCompound();
((GT_MetaGenerated_Tool) mInventory[1].getItem()).doDamage(
- mInventory[1],
- (long) getDamageToComponent(mInventory[1]) * (long) Math.min(
- mEUt / this.damageFactorLow,
- Math.pow(mEUt, this.damageFactorHigh)));
+ mInventory[1],
+ (long) getDamageToComponent(mInventory[1])
+ * (long) Math.min(mEUt / this.damageFactorLow, Math.pow(mEUt, this.damageFactorHigh)));
if (mInventory[1].stackSize == 0) mInventory[1] = null;
}
}
@@ -710,34 +691,34 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
public void explodeMultiblock() {
GT_Log.exp.println(
- "MultiBlockExplosion at: " + this.getBaseMetaTileEntity()
- .getXCoord()
- + " | "
- + this.getBaseMetaTileEntity()
- .getYCoord()
- + " | "
- + this.getBaseMetaTileEntity()
- .getZCoord()
- + " DIMID: "
- + this.getBaseMetaTileEntity()
- .getWorld().provider.dimensionId
- + ".");
+ "MultiBlockExplosion at: " + this.getBaseMetaTileEntity()
+ .getXCoord()
+ + " | "
+ + this.getBaseMetaTileEntity()
+ .getYCoord()
+ + " | "
+ + this.getBaseMetaTileEntity()
+ .getZCoord()
+ + " DIMID: "
+ + this.getBaseMetaTileEntity()
+ .getWorld().provider.dimensionId
+ + ".");
GT_Pollution.addPollution(getBaseMetaTileEntity(), GT_Mod.gregtechproxy.mPollutionOnExplosion);
mInventory[1] = null;
Iterable<MetaTileEntity> allHatches = Iterables.concat(
- mInputBusses,
- mOutputBusses,
- mInputHatches,
- mOutputHatches,
- mDynamoHatches,
- mMufflerHatches,
- mEnergyHatches,
- mMaintenanceHatches);
+ mInputBusses,
+ mOutputBusses,
+ mInputHatches,
+ mOutputHatches,
+ mDynamoHatches,
+ mMufflerHatches,
+ mEnergyHatches,
+ mMaintenanceHatches);
for (MetaTileEntity tTileEntity : allHatches) {
if (tTileEntity != null && tTileEntity.getBaseMetaTileEntity() != null) {
tTileEntity.getBaseMetaTileEntity()
- .doExplosion(V[8]);
+ .doExplosion(V[8]);
}
}
getBaseMetaTileEntity().doExplosion(V[8]);
@@ -796,12 +777,12 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
ampsOnCurrentHatch = (int) Math.min(aDynamo.maxAmperesOut(), aAmpsToInject);
for (int i = 0; i < ampsOnCurrentHatch; i++) {
aDynamo.getBaseMetaTileEntity()
- .increaseStoredEnergyUnits(aVoltage, false);
+ .increaseStoredEnergyUnits(aVoltage, false);
}
injected += aVoltage * ampsOnCurrentHatch;
if (aRemainder > 0 && ampsOnCurrentHatch < aDynamo.maxAmperesOut()) {
aDynamo.getBaseMetaTileEntity()
- .increaseStoredEnergyUnits(aRemainder, false);
+ .increaseStoredEnergyUnits(aRemainder, false);
injected += aRemainder;
}
}
@@ -813,7 +794,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
long rVoltage = 0;
for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches)
if (isValidMetaTileEntity(tHatch)) rVoltage += tHatch.getBaseMetaTileEntity()
- .getInputVoltage();
+ .getInputVoltage();
return rVoltage;
}
@@ -827,7 +808,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
* @param perfectOC - If the Multiblock OCs perfectly, i.e. the large Chemical Reactor
*/
protected void calculateOverclockedNessMultiInternal(long aEUt, int aDuration, int mAmperage, long maxInputVoltage,
- boolean perfectOC) {
+ boolean perfectOC) {
byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage));
if (mTier == 0) {
// Long time calculation
@@ -896,14 +877,13 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
if (aEU <= 0) return true;
for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) if (isValidMetaTileEntity(tHatch)) {
if (tHatch.getBaseMetaTileEntity()
- .decreaseStoredEnergyUnits(aEU, false))
- return true;
+ .decreaseStoredEnergyUnits(aEU, false)) return true;
}
return false;
}
protected static boolean dumpFluid(List<GT_MetaTileEntity_Hatch_Output> aOutputHatches, FluidStack copiedFluidStack,
- boolean restrictiveHatchesOnly) {
+ boolean restrictiveHatchesOnly) {
for (GT_MetaTileEntity_Hatch_Output tHatch : aOutputHatches) {
if (!isValidMetaTileEntity(tHatch) || (restrictiveHatchesOnly && tHatch.mMode == 0)) {
continue;
@@ -967,8 +947,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) {
if (!outputSuccess && isValidMetaTileEntity(tHatch) && tHatch.outputsItems()) {
if (tHatch.getBaseMetaTileEntity()
- .addStackToSlot(1, single))
- outputSuccess = true;
+ .addStackToSlot(1, single)) outputSuccess = true;
}
}
}
@@ -983,14 +962,13 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
tHatch.mRecipeMap = getRecipeMap();
if (isValidMetaTileEntity(tHatch)) {
if (GT_Utility.areStacksEqual(
- aStack,
- tHatch.getBaseMetaTileEntity()
- .getStackInSlot(0))) {
+ aStack,
+ tHatch.getBaseMetaTileEntity()
+ .getStackInSlot(0))) {
if (tHatch.getBaseMetaTileEntity()
- .getStackInSlot(0).stackSize
- >= aStack.stackSize) {
+ .getStackInSlot(0).stackSize >= aStack.stackSize) {
tHatch.getBaseMetaTileEntity()
- .decrStackSize(0, aStack.stackSize);
+ .decrStackSize(0, aStack.stackSize);
return true;
}
}
@@ -1000,17 +978,15 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
tHatch.mRecipeMap = getRecipeMap();
if (isValidMetaTileEntity(tHatch)) {
for (int i = tHatch.getBaseMetaTileEntity()
- .getSizeInventory()
- - 1; i >= 0; i--) {
+ .getSizeInventory() - 1; i >= 0; i--) {
if (GT_Utility.areStacksEqual(
- aStack,
- tHatch.getBaseMetaTileEntity()
- .getStackInSlot(i))) {
+ aStack,
+ tHatch.getBaseMetaTileEntity()
+ .getStackInSlot(i))) {
if (tHatch.getBaseMetaTileEntity()
- .getStackInSlot(i).stackSize
- >= aStack.stackSize) {
+ .getStackInSlot(i).stackSize >= aStack.stackSize) {
tHatch.getBaseMetaTileEntity()
- .decrStackSize(i, aStack.stackSize);
+ .decrStackSize(i, aStack.stackSize);
return true;
}
}
@@ -1030,11 +1006,10 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
for (GT_MetaTileEntity_Hatch_OutputBus tHatch : mOutputBusses) {
if (isValidMetaTileEntity(tHatch)) {
for (int i = tHatch.getBaseMetaTileEntity()
- .getSizeInventory()
- - 1; i >= 0; i--) {
+ .getSizeInventory() - 1; i >= 0; i--) {
rList.add(
- tHatch.getBaseMetaTileEntity()
- .getStackInSlot(i));
+ tHatch.getBaseMetaTileEntity()
+ .getStackInSlot(i));
}
}
}
@@ -1070,20 +1045,17 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
tHatch.mRecipeMap = getRecipeMap();
if (isValidMetaTileEntity(tHatch)) {
for (int i = tHatch.getBaseMetaTileEntity()
- .getSizeInventory()
- - 1; i >= 0; i--) {
+ .getSizeInventory() - 1; i >= 0; i--) {
if (tHatch.getBaseMetaTileEntity()
- .getStackInSlot(i)
- != null)
+ .getStackInSlot(i) != null)
rList.add(
- tHatch.getBaseMetaTileEntity()
- .getStackInSlot(i));
+ tHatch.getBaseMetaTileEntity()
+ .getStackInSlot(i));
}
}
}
if (getStackInSlot(1) != null && getStackInSlot(1).getUnlocalizedName()
- .startsWith("gt.integrated_circuit"))
- rList.add(getStackInSlot(1));
+ .startsWith("gt.integrated_circuit")) rList.add(getStackInSlot(1));
return rList;
}
@@ -1109,7 +1081,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
}
protected static <T extends GT_MetaTileEntity_Hatch> T identifyHatch(IGregTechTileEntity aTileEntity,
- int aBaseCasingIndex, Class<T> clazz) {
+ int aBaseCasingIndex, Class<T> clazz) {
if (aTileEntity == null) return null;
IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
if (!clazz.isInstance(aMetaTileEntity)) return null;
@@ -1177,7 +1149,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
if (aMetaTileEntity == null) return false;
if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch hatch
- && GT_ExoticEnergyInputHelper.isExoticEnergyInput(aMetaTileEntity)) {
+ && GT_ExoticEnergyInputHelper.isExoticEnergyInput(aMetaTileEntity)) {
hatch.updateTexture(aBaseCasingIndex);
return mExoticEnergyHatches.add(hatch);
}
@@ -1208,12 +1180,12 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
return addInputBusToMachineList(aTileEntity, aBaseCasingIndex)
- || addInputHatchToMachineList(aTileEntity, aBaseCasingIndex);
+ || addInputHatchToMachineList(aTileEntity, aBaseCasingIndex);
}
public boolean addOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
return addOutputBusToMachineList(aTileEntity, aBaseCasingIndex)
- || addOutputHatchToMachineList(aTileEntity, aBaseCasingIndex);
+ || addOutputHatchToMachineList(aTileEntity, aBaseCasingIndex);
}
public boolean addInputBusToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
@@ -1276,62 +1248,62 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) {
if (isValidMetaTileEntity(tHatch)) {
storedEnergy += tHatch.getBaseMetaTileEntity()
- .getStoredEU();
+ .getStoredEU();
maxEnergy += tHatch.getBaseMetaTileEntity()
- .getEUCapacity();
+ .getEUCapacity();
}
}
return new String[] {
- /* 1 */ StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": "
- + EnumChatFormatting.GREEN
- + GT_Utility.formatNumbers(mProgresstime / 20)
- + EnumChatFormatting.RESET
- + " s / "
- + EnumChatFormatting.YELLOW
- + GT_Utility.formatNumbers(mMaxProgresstime / 20)
- + EnumChatFormatting.RESET
- + " s",
- /* 2 */ StatCollector.translateToLocal("GT5U.multiblock.energy") + ": "
- + EnumChatFormatting.GREEN
- + GT_Utility.formatNumbers(storedEnergy)
- + EnumChatFormatting.RESET
- + " EU / "
- + EnumChatFormatting.YELLOW
- + GT_Utility.formatNumbers(maxEnergy)
- + EnumChatFormatting.RESET
- + " EU",
- /* 3 */ StatCollector.translateToLocal("GT5U.multiblock.usage") + ": "
- + EnumChatFormatting.RED
- + GT_Utility.formatNumbers(getActualEnergyUsage())
- + EnumChatFormatting.RESET
- + " EU/t",
- /* 4 */ StatCollector.translateToLocal("GT5U.multiblock.mei") + ": "
- + EnumChatFormatting.YELLOW
- + GT_Utility.formatNumbers(getMaxInputVoltage())
- + EnumChatFormatting.RESET
- + " EU/t(*2A) "
- + StatCollector.translateToLocal("GT5U.machines.tier")
- + ": "
- + EnumChatFormatting.YELLOW
- + VN[GT_Utility.getTier(getMaxInputVoltage())]
- + EnumChatFormatting.RESET,
- /* 5 */ StatCollector.translateToLocal("GT5U.multiblock.problems") + ": "
- + EnumChatFormatting.RED
- + (getIdealStatus() - getRepairStatus())
- + EnumChatFormatting.RESET
- + " "
- + StatCollector.translateToLocal("GT5U.multiblock.efficiency")
- + ": "
- + EnumChatFormatting.YELLOW
- + mEfficiency / 100.0F
- + EnumChatFormatting.RESET
- + " %",
- /* 6 */ StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": "
- + EnumChatFormatting.GREEN
- + mPollutionReduction
- + EnumChatFormatting.RESET
- + " %" };
+ /* 1 */ StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": "
+ + EnumChatFormatting.GREEN
+ + GT_Utility.formatNumbers(mProgresstime / 20)
+ + EnumChatFormatting.RESET
+ + " s / "
+ + EnumChatFormatting.YELLOW
+ + GT_Utility.formatNumbers(mMaxProgresstime / 20)
+ + EnumChatFormatting.RESET
+ + " s",
+ /* 2 */ StatCollector.translateToLocal("GT5U.multiblock.energy") + ": "
+ + EnumChatFormatting.GREEN
+ + GT_Utility.formatNumbers(storedEnergy)
+ + EnumChatFormatting.RESET
+ + " EU / "
+ + EnumChatFormatting.YELLOW
+ + GT_Utility.formatNumbers(maxEnergy)
+ + EnumChatFormatting.RESET
+ + " EU",
+ /* 3 */ StatCollector.translateToLocal("GT5U.multiblock.usage") + ": "
+ + EnumChatFormatting.RED
+ + GT_Utility.formatNumbers(getActualEnergyUsage())
+ + EnumChatFormatting.RESET
+ + " EU/t",
+ /* 4 */ StatCollector.translateToLocal("GT5U.multiblock.mei") + ": "
+ + EnumChatFormatting.YELLOW
+ + GT_Utility.formatNumbers(getMaxInputVoltage())
+ + EnumChatFormatting.RESET
+ + " EU/t(*2A) "
+ + StatCollector.translateToLocal("GT5U.machines.tier")
+ + ": "
+ + EnumChatFormatting.YELLOW
+ + VN[GT_Utility.getTier(getMaxInputVoltage())]
+ + EnumChatFormatting.RESET,
+ /* 5 */ StatCollector.translateToLocal("GT5U.multiblock.problems") + ": "
+ + EnumChatFormatting.RED
+ + (getIdealStatus() - getRepairStatus())
+ + EnumChatFormatting.RESET
+ + " "
+ + StatCollector.translateToLocal("GT5U.multiblock.efficiency")
+ + ": "
+ + EnumChatFormatting.YELLOW
+ + mEfficiency / 100.0F
+ + EnumChatFormatting.RESET
+ + " %",
+ /* 6 */ StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": "
+ + EnumChatFormatting.GREEN
+ + mPollutionReduction
+ + EnumChatFormatting.RESET
+ + " %" };
}
@Override
@@ -1392,44 +1364,44 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
@Override
public void getWailaBody(ItemStack itemStack, List<String> currentTip, IWailaDataAccessor accessor,
- IWailaConfigHandler config) {
+ IWailaConfigHandler config) {
final NBTTagCompound tag = accessor.getNBTData();
if (tag.getBoolean("incompleteStructure")) {
currentTip.add(RED + "** INCOMPLETE STRUCTURE **" + RESET);
}
currentTip.add(
- (tag.getBoolean("hasProblems") ? (RED + "** HAS PROBLEMS **") : GREEN + "Running Fine") + RESET
- + " Efficiency: "
- + tag.getFloat("efficiency")
- + "%");
+ (tag.getBoolean("hasProblems") ? (RED + "** HAS PROBLEMS **") : GREEN + "Running Fine") + RESET
+ + " Efficiency: "
+ + tag.getFloat("efficiency")
+ + "%");
boolean isActive = tag.getBoolean("isActive");
if (isActive) {
long actualEnergyUsage = tag.getLong("energyUsage");
if (actualEnergyUsage > 0) {
currentTip.add(
- StatCollector.translateToLocalFormatted(
- "GT5U.waila.energy.use",
- GT_Utility.formatNumbers(actualEnergyUsage),
- GT_Utility.getColoredTierNameFromVoltage(actualEnergyUsage)));
+ StatCollector.translateToLocalFormatted(
+ "GT5U.waila.energy.use",
+ GT_Utility.formatNumbers(actualEnergyUsage),
+ GT_Utility.getColoredTierNameFromVoltage(actualEnergyUsage)));
} else if (actualEnergyUsage < 0) {
currentTip.add(
- StatCollector.translateToLocalFormatted(
- "GT5U.waila.energy.produce",
- GT_Utility.formatNumbers(-actualEnergyUsage),
- GT_Utility.getColoredTierNameFromVoltage(-actualEnergyUsage)));
+ StatCollector.translateToLocalFormatted(
+ "GT5U.waila.energy.produce",
+ GT_Utility.formatNumbers(-actualEnergyUsage),
+ GT_Utility.getColoredTierNameFromVoltage(-actualEnergyUsage)));
}
}
currentTip.add(
- GT_Waila.getMachineProgressString(isActive, tag.getInteger("maxProgress"), tag.getInteger("progress")));
+ GT_Waila.getMachineProgressString(isActive, tag.getInteger("maxProgress"), tag.getInteger("progress")));
super.getWailaBody(itemStack, currentTip, accessor, config);
}
@Override
public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y,
- int z) {
+ int z) {
super.getWailaNBTData(player, tile, tag, world, x, y, z);
tag.setBoolean("hasProblems", (getIdealStatus() - getRepairStatus()) > 0);
@@ -1567,38 +1539,35 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
@Override
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
builder.widget(
- new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK)
- .setPos(4, 4)
- .setSize(190, 85));
+ new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK)
+ .setPos(4, 4)
+ .setSize(190, 85));
final SlotWidget inventorySlot = new SlotWidget(inventoryHandler, 1);
builder.widget(
- inventorySlot.setPos(173, 167)
- .setBackground(GT_UITextures.SLOT_DARK_GRAY));
+ inventorySlot.setPos(173, 167)
+ .setBackground(GT_UITextures.SLOT_DARK_GRAY));
final DynamicPositionedColumn screenElements = new DynamicPositionedColumn();
drawTexts(screenElements, inventorySlot);
builder.widget(screenElements);
builder.widget(createPowerSwitchButton())
- .widget(new FakeSyncWidget.BooleanSyncer(() -> getBaseMetaTileEntity().isAllowedToWork(), val -> {
- if (val) getBaseMetaTileEntity().enableWorking();
- else getBaseMetaTileEntity().disableWorking();
- }));
+ .widget(new FakeSyncWidget.BooleanSyncer(() -> getBaseMetaTileEntity().isAllowedToWork(), val -> {
+ if (val) getBaseMetaTileEntity().enableWorking();
+ else getBaseMetaTileEntity().disableWorking();
+ }));
builder.widget(createVoidExcessButton())
- .widget(new FakeSyncWidget.BooleanSyncer(() -> voidExcess, val -> voidExcess = val));
+ .widget(new FakeSyncWidget.BooleanSyncer(() -> voidExcess, val -> voidExcess = val));
builder.widget(createInputSeparationButton())
- .widget(new FakeSyncWidget.BooleanSyncer(() -> inputSeparation, val -> inputSeparation = val));
+ .widget(new FakeSyncWidget.BooleanSyncer(() -> inputSeparation, val -> inputSeparation = val));
builder.widget(createBatchModeButton())
- .widget(new FakeSyncWidget.BooleanSyncer(() -> batchMode, val -> batchMode = val));
+ .widget(new FakeSyncWidget.BooleanSyncer(() -> batchMode, val -> batchMode = val));
builder.widget(createLockToSingleRecipeButton())
- .widget(
- new FakeSyncWidget.BooleanSyncer(
- () -> mLockedToSingleRecipe,
- val -> mLockedToSingleRecipe = val));
+ .widget(new FakeSyncWidget.BooleanSyncer(() -> mLockedToSingleRecipe, val -> mLockedToSingleRecipe = val));
}
@Override
@@ -1606,119 +1575,102 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inventorySlot) {
screenElements.setSynced(false)
- .setSpace(0)
- .setPos(10, 7);
+ .setSpace(0)
+ .setPos(10, 7);
- screenElements.widget(
+ screenElements
+ .widget(
new TextWidget(GT_Utility.trans("132", "Pipe is loose.")).setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mWrench))
- .widget(new FakeSyncWidget.BooleanSyncer(() -> mWrench, val -> mWrench = val));
- screenElements.widget(
+ .setEnabled(widget -> !mWrench))
+ .widget(new FakeSyncWidget.BooleanSyncer(() -> mWrench, val -> mWrench = val));
+ screenElements
+ .widget(
new TextWidget(GT_Utility.trans("133", "Screws are loose.")).setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mScrewdriver))
- .widget(new FakeSyncWidget.BooleanSyncer(() -> mScrewdriver, val -> mScrewdriver = val));
- screenElements.widget(
+ .setEnabled(widget -> !mScrewdriver))
+ .widget(new FakeSyncWidget.BooleanSyncer(() -> mScrewdriver, val -> mScrewdriver = val));
+ screenElements
+ .widget(
new TextWidget(GT_Utility.trans("134", "Something is stuck.")).setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mSoftHammer))
- .widget(new FakeSyncWidget.BooleanSyncer(() -> mSoftHammer, val -> mSoftHammer = val));
- screenElements.widget(
+ .setEnabled(widget -> !mSoftHammer))
+ .widget(new FakeSyncWidget.BooleanSyncer(() -> mSoftHammer, val -> mSoftHammer = val));
+ screenElements
+ .widget(
new TextWidget(GT_Utility.trans("135", "Platings are dented.")).setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mHardHammer))
- .widget(new FakeSyncWidget.BooleanSyncer(() -> mHardHammer, val -> mHardHammer = val));
- screenElements.widget(
+ .setEnabled(widget -> !mHardHammer))
+ .widget(new FakeSyncWidget.BooleanSyncer(() -> mHardHammer, val -> mHardHammer = val));
+ screenElements
+ .widget(
new TextWidget(GT_Utility.trans("136", "Circuitry burned out.")).setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mSolderingTool))
- .widget(new FakeSyncWidget.BooleanSyncer(() -> mSolderingTool, val -> mSolderingTool = val));
- screenElements.widget(
+ .setEnabled(widget -> !mSolderingTool))
+ .widget(new FakeSyncWidget.BooleanSyncer(() -> mSolderingTool, val -> mSolderingTool = val));
+ screenElements
+ .widget(
new TextWidget(GT_Utility.trans("137", "That doesn't belong there."))
- .setDefaultColor(
- COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mCrowbar))
- .widget(new FakeSyncWidget.BooleanSyncer(() -> mCrowbar, val -> mCrowbar = val));
- screenElements.widget(
+ .setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setEnabled(widget -> !mCrowbar))
+ .widget(new FakeSyncWidget.BooleanSyncer(() -> mCrowbar, val -> mCrowbar = val));
+ screenElements
+ .widget(
new TextWidget(GT_Utility.trans("138", "Incomplete Structure.")).setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mMachine))
- .widget(new FakeSyncWidget.BooleanSyncer(() -> mMachine, val -> mMachine = val));
+ .setEnabled(widget -> !mMachine))
+ .widget(new FakeSyncWidget.BooleanSyncer(() -> mMachine, val -> mMachine = val));
screenElements.widget(
- new TextWidget("Too Uncertain.").setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(
- widget -> (getBaseMetaTileEntity().getErrorDisplayID() & 128)
- != 0));
+ new TextWidget("Too Uncertain.").setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setEnabled(widget -> (getBaseMetaTileEntity().getErrorDisplayID() & 128) != 0));
screenElements.widget(
- new TextWidget("Invalid Parameters.").setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(
- widget -> (getBaseMetaTileEntity().getErrorDisplayID()
- & 256) != 0));
+ new TextWidget("Invalid Parameters.").setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setEnabled(widget -> (getBaseMetaTileEntity().getErrorDisplayID() & 256) != 0));
screenElements.widget(
- new TextWidget(GT_Utility.trans("139", "Hit with Soft Mallet")).setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(
- widget -> getBaseMetaTileEntity().getErrorDisplayID()
- == 0
- && !getBaseMetaTileEntity().isActive()))
- .widget(
- new FakeSyncWidget.IntegerSyncer(
- () -> getBaseMetaTileEntity().getErrorDisplayID(),
- val -> getBaseMetaTileEntity().setErrorDisplayID(val)))
- .widget(
- new FakeSyncWidget.BooleanSyncer(
- () -> getBaseMetaTileEntity().isActive(),
- val -> getBaseMetaTileEntity().setActive(val)));
+ new TextWidget(GT_Utility.trans("139", "Hit with Soft Mallet")).setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setEnabled(
+ widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 && !getBaseMetaTileEntity().isActive()))
+ .widget(
+ new FakeSyncWidget.IntegerSyncer(
+ () -> getBaseMetaTileEntity().getErrorDisplayID(),
+ val -> getBaseMetaTileEntity().setErrorDisplayID(val)))
+ .widget(
+ new FakeSyncWidget.BooleanSyncer(
+ () -> getBaseMetaTileEntity().isActive(),
+ val -> getBaseMetaTileEntity().setActive(val)));
screenElements.widget(
- new TextWidget(
- GT_Utility.trans("140", "to (re-)start the Machine")).setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(
- widget -> getBaseMetaTileEntity().getErrorDisplayID()
- == 0
- && !getBaseMetaTileEntity().isActive()));
+ new TextWidget(GT_Utility.trans("140", "to (re-)start the Machine")).setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setEnabled(
+ widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 && !getBaseMetaTileEntity().isActive()));
screenElements.widget(
- new TextWidget(GT_Utility.trans("141", "if it doesn't start.")).setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(
- widget -> getBaseMetaTileEntity().getErrorDisplayID()
- == 0
- && !getBaseMetaTileEntity().isActive()));
+ new TextWidget(GT_Utility.trans("141", "if it doesn't start.")).setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setEnabled(
+ widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 && !getBaseMetaTileEntity().isActive()));
screenElements.widget(
- new TextWidget(GT_Utility.trans("142", "Running perfectly.")).setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(
- widget -> getBaseMetaTileEntity().getErrorDisplayID()
- == 0
- && getBaseMetaTileEntity().isActive()));
+ new TextWidget(GT_Utility.trans("142", "Running perfectly.")).setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setEnabled(
+ widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 && getBaseMetaTileEntity().isActive()));
screenElements.widget(
- new TextWidget(GT_Utility.trans("143", "Missing Mining Pipe")).setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> {
- if (getBaseMetaTileEntity().getErrorDisplayID()
- == 0
- && this instanceof GT_MetaTileEntity_DrillerBase) {
- final ItemStack tItem = inventorySlot.getMcSlot()
- .getStack();
- return tItem == null
- || !GT_Utility.areStacksEqual(
- tItem,
- GT_ModHandler.getIC2Item(
- "miningPipe",
- 1L));
- }
- return false;
- }));
+ new TextWidget(GT_Utility.trans("143", "Missing Mining Pipe")).setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setEnabled(widget -> {
+ if (getBaseMetaTileEntity().getErrorDisplayID() == 0
+ && this instanceof GT_MetaTileEntity_DrillerBase) {
+ final ItemStack tItem = inventorySlot.getMcSlot()
+ .getStack();
+ return tItem == null
+ || !GT_Utility.areStacksEqual(tItem, GT_ModHandler.getIC2Item("miningPipe", 1L));
+ }
+ return false;
+ }));
screenElements.widget(
- new TextWidget(GT_Utility.trans("144", "Missing Turbine Rotor")).setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> {
- if (getBaseMetaTileEntity().getErrorDisplayID()
- == 0
- && this instanceof GT_MetaTileEntity_LargeTurbine) {
- final ItemStack tItem = inventorySlot.getMcSlot()
- .getStack();
- return tItem == null || !(tItem
- .getItem()
- == GT_MetaGenerated_Tool_01.INSTANCE
- && tItem.getItemDamage()
- >= 170
- && tItem.getItemDamage()
- <= 177);
- }
- return false;
- }));
+ new TextWidget(GT_Utility.trans("144", "Missing Turbine Rotor")).setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setEnabled(widget -> {
+ if (getBaseMetaTileEntity().getErrorDisplayID() == 0
+ && this instanceof GT_MetaTileEntity_LargeTurbine) {
+ final ItemStack tItem = inventorySlot.getMcSlot()
+ .getStack();
+ return tItem == null
+ || !(tItem.getItem() == GT_MetaGenerated_Tool_01.INSTANCE && tItem.getItemDamage() >= 170
+ && tItem.getItemDamage() <= 177);
+ }
+ return false;
+ }));
}
protected ButtonWidget createPowerSwitchButton() {
@@ -1729,24 +1681,23 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
getBaseMetaTileEntity().enableWorking();
}
})
- .setPlayClickSoundResource(
- () -> getBaseMetaTileEntity().isAllowedToWork()
- ? SoundResource.GUI_BUTTON_UP.resourceLocation
- : SoundResource.GUI_BUTTON_DOWN.resourceLocation)
- .setBackground(() -> {
- List<UITexture> ret = new ArrayList<>();
- ret.add(GT_UITextures.BUTTON_STANDARD);
- if (getBaseMetaTileEntity().isAllowedToWork()) {
- ret.add(GT_UITextures.OVERLAY_BUTTON_POWER_SWITCH_ON);
- } else {
- ret.add(GT_UITextures.OVERLAY_BUTTON_POWER_SWITCH_OFF);
- }
- return ret.toArray(new IDrawable[0]);
- })
- .setPos(174, 148)
- .setSize(16, 16);
+ .setPlayClickSoundResource(
+ () -> getBaseMetaTileEntity().isAllowedToWork() ? SoundResource.GUI_BUTTON_UP.resourceLocation
+ : SoundResource.GUI_BUTTON_DOWN.resourceLocation)
+ .setBackground(() -> {
+ List<UITexture> ret = new ArrayList<>();
+ ret.add(GT_UITextures.BUTTON_STANDARD);
+ if (getBaseMetaTileEntity().isAllowedToWork()) {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_POWER_SWITCH_ON);
+ } else {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_POWER_SWITCH_OFF);
+ }
+ return ret.toArray(new IDrawable[0]);
+ })
+ .setPos(174, 148)
+ .setSize(16, 16);
button.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.power_switch"))
- .setTooltipShowUpDelay(TOOLTIP_DELAY);
+ .setTooltipShowUpDelay(TOOLTIP_DELAY);
return (ButtonWidget) button;
}
@@ -1756,29 +1707,29 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
voidExcess = !voidExcess;
}
})
- .setPlayClickSound(true)
- .setBackground(() -> {
- List<UITexture> ret = new ArrayList<>();
- ret.add(GT_UITextures.BUTTON_STANDARD);
- if (isVoidExcessButtonEnabled()) {
- if (isVoidExcessEnabled()) {
- ret.add(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_ON);
- } else {
- ret.add(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_OFF);
- }
- } else {
- if (isVoidExcessEnabled()) {
- ret.add(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_ON_DISABLED);
- } else {
- ret.add(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_OFF_DISABLED);
- }
- }
- return ret.toArray(new IDrawable[0]);
- })
- .setPos(8, 91)
- .setSize(16, 16);
+ .setPlayClickSound(true)
+ .setBackground(() -> {
+ List<UITexture> ret = new ArrayList<>();
+ ret.add(GT_UITextures.BUTTON_STANDARD);
+ if (isVoidExcessButtonEnabled()) {
+ if (isVoidExcessEnabled()) {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_ON);
+ } else {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_OFF);
+ }
+ } else {
+ if (isVoidExcessEnabled()) {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_ON_DISABLED);
+ } else {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_OFF_DISABLED);
+ }
+ }
+ return ret.toArray(new IDrawable[0]);
+ })
+ .setPos(8, 91)
+ .setSize(16, 16);
button.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.void_excess"))
- .setTooltipShowUpDelay(TOOLTIP_DELAY);
+ .setTooltipShowUpDelay(TOOLTIP_DELAY);
return (ButtonWidget) button;
}
@@ -1788,31 +1739,29 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
inputSeparation = !inputSeparation;
}
})
- .setPlayClickSound(true)
- .setBackground(() -> {
- List<UITexture> ret = new ArrayList<>();
- ret.add(GT_UITextures.BUTTON_STANDARD);
- if (isInputSeparationButtonEnabled()) {
- if (isInputSeparationEnabled()) {
- ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_ON);
- } else {
- ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_OFF);
- }
- } else {
- if (isInputSeparationEnabled()) {
- ret.add(
- GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_ON_DISABLED);
- } else {
- ret.add(
- GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_OFF_DISABLED);
- }
- }
- return ret.toArray(new IDrawable[0]);
- })
- .setPos(26, 91)
- .setSize(16, 16);
+ .setPlayClickSound(true)
+ .setBackground(() -> {
+ List<UITexture> ret = new ArrayList<>();
+ ret.add(GT_UITextures.BUTTON_STANDARD);
+ if (isInputSeparationButtonEnabled()) {
+ if (isInputSeparationEnabled()) {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_ON);
+ } else {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_OFF);
+ }
+ } else {
+ if (isInputSeparationEnabled()) {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_ON_DISABLED);
+ } else {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_OFF_DISABLED);
+ }
+ }
+ return ret.toArray(new IDrawable[0]);
+ })
+ .setPos(26, 91)
+ .setSize(16, 16);
button.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.input_separation"))
- .setTooltipShowUpDelay(TOOLTIP_DELAY);
+ .setTooltipShowUpDelay(TOOLTIP_DELAY);
return (ButtonWidget) button;
}
@@ -1822,29 +1771,29 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
batchMode = !batchMode;
}
})
- .setPlayClickSound(true)
- .setBackground(() -> {
- List<UITexture> ret = new ArrayList<>();
- ret.add(GT_UITextures.BUTTON_STANDARD);
- if (isBatchModeButtonEnabled()) {
- if (isBatchModeEnabled()) {
- ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_ON);
- } else {
- ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_OFF);
- }
- } else {
- if (isBatchModeEnabled()) {
- ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_ON_DISABLED);
- } else {
- ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_OFF_DISABLED);
- }
- }
- return ret.toArray(new IDrawable[0]);
- })
- .setPos(44, 91)
- .setSize(16, 16);
+ .setPlayClickSound(true)
+ .setBackground(() -> {
+ List<UITexture> ret = new ArrayList<>();
+ ret.add(GT_UITextures.BUTTON_STANDARD);
+ if (isBatchModeButtonEnabled()) {
+ if (isBatchModeEnabled()) {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_ON);
+ } else {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_OFF);
+ }
+ } else {
+ if (isBatchModeEnabled()) {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_ON_DISABLED);
+ } else {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_OFF_DISABLED);
+ }
+ }
+ return ret.toArray(new IDrawable[0]);
+ })
+ .setPos(44, 91)
+ .setSize(16, 16);
button.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.batch_mode"))
- .setTooltipShowUpDelay(TOOLTIP_DELAY);
+ .setTooltipShowUpDelay(TOOLTIP_DELAY);
return (ButtonWidget) button;
}
@@ -1854,29 +1803,29 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
mLockedToSingleRecipe = !mLockedToSingleRecipe;
}
})
- .setPlayClickSound(true)
- .setBackground(() -> {
- List<UITexture> ret = new ArrayList<>();
- ret.add(GT_UITextures.BUTTON_STANDARD);
- if (supportsSingleRecipeLocking()) {
- if (isRecipeLockingEnabled()) {
- ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_LOCKED);
- } else {
- ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_UNLOCKED);
- }
- } else {
- if (isRecipeLockingEnabled()) {
- ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_LOCKED_DISABLED);
- } else {
- ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_UNLOCKED_DISABLED);
- }
- }
- return ret.toArray(new IDrawable[0]);
- })
- .setPos(62, 91)
- .setSize(16, 16);
+ .setPlayClickSound(true)
+ .setBackground(() -> {
+ List<UITexture> ret = new ArrayList<>();
+ ret.add(GT_UITextures.BUTTON_STANDARD);
+ if (supportsSingleRecipeLocking()) {
+ if (isRecipeLockingEnabled()) {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_LOCKED);
+ } else {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_UNLOCKED);
+ }
+ } else {
+ if (isRecipeLockingEnabled()) {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_LOCKED_DISABLED);
+ } else {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_UNLOCKED_DISABLED);
+ }
+ }
+ return ret.toArray(new IDrawable[0]);
+ })
+ .setPos(62, 91)
+ .setSize(16, 16);
button.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.lock_recipe"))
- .setTooltipShowUpDelay(TOOLTIP_DELAY);
+ .setTooltipShowUpDelay(TOOLTIP_DELAY);
return (ButtonWidget) button;
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SpecialFilter.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SpecialFilter.java
index 890733e363..9672c87f40 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SpecialFilter.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SpecialFilter.java
@@ -29,18 +29,18 @@ public abstract class GT_MetaTileEntity_SpecialFilter extends GT_MetaTileEntity_
public boolean bInvertFilter = false;
public GT_MetaTileEntity_SpecialFilter(int aID, String aName, String aNameRegional, int aTier,
- String[] aDescription) {
+ String[] aDescription) {
// 9 buffer slot, 1 representation slot, 1 holo slot. last seems not needed...
super(aID, aName, aNameRegional, aTier, 11, aDescription);
}
public GT_MetaTileEntity_SpecialFilter(String aName, int aTier, int aInvSlotCount, String aDescription,
- ITexture[][][] aTextures) {
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
public GT_MetaTileEntity_SpecialFilter(String aName, int aTier, int aInvSlotCount, String[] aDescription,
- ITexture[][][] aTextures) {
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
@@ -68,8 +68,8 @@ public abstract class GT_MetaTileEntity_SpecialFilter extends GT_MetaTileEntity_
@Override
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack))
- && ((this.bNBTAllowed) || (!aStack.hasTagCompound()))
- && (this.isStackAllowed(aStack) != this.bInvertFilter);
+ && ((this.bNBTAllowed) || (!aStack.hasTagCompound()))
+ && (this.isStackAllowed(aStack) != this.bInvertFilter);
}
protected abstract boolean isStackAllowed(ItemStack aStack);
@@ -91,79 +91,77 @@ public abstract class GT_MetaTileEntity_SpecialFilter extends GT_MetaTileEntity_
bInvertFilter = !bInvertFilter;
if (bInvertFilter) {
GT_Utility.sendChatToPlayer(
- widget.getContext()
- .getPlayer(),
- GT_Utility.trans("124", "Invert Filter"));
+ widget.getContext()
+ .getPlayer(),
+ GT_Utility.trans("124", "Invert Filter"));
} else {
GT_Utility.sendChatToPlayer(
- widget.getContext()
- .getPlayer(),
- GT_Utility.trans("125", "Don't invert Filter"));
+ widget.getContext()
+ .getPlayer(),
+ GT_Utility.trans("125", "Don't invert Filter"));
}
})
- .setBackground(
- GT_UITextures.BUTTON_STANDARD,
- GT_UITextures.OVERLAY_BUTTON_INVERT_FILTER)
- .setPos(61, 62)
- .setSize(18, 18))
- .widget(new ButtonWidget().setOnClick((clickData, widget) -> {
- bNBTAllowed = !bNBTAllowed;
- if (bNBTAllowed) {
- GT_Utility.sendChatToPlayer(
- widget.getContext()
- .getPlayer(),
- GT_Utility.trans("126", "Ignore NBT"));
- } else {
- GT_Utility.sendChatToPlayer(
- widget.getContext()
- .getPlayer(),
- GT_Utility.trans("127", "NBT has to match"));
- }
- })
- .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_NBT)
- .setPos(79, 62)
- .setSize(18, 18))
- .widget(
- new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_WHITE.apply(27, false))
- .setPos(6, 19)
- .setSize(27, 24))
- .widget(
- new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_BLUE.apply(42, true))
- .setPos(53, 19)
- .setSize(42, 24))
- .widget(
- new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_RED.apply(19, true))
- .setPos(152, 19)
- .setSize(19, 24))
- .widget(new SlotWidget(BaseSlot.phantom(inventoryHandler, 9)) {
-
- @Override
- protected void phantomClick(ClickData clickData, ItemStack cursorStack) {
- clickTypeIcon(clickData.mouseButton != 0, cursorStack);
- }
-
- @Override
- public void buildTooltip(List<Text> tooltip) {
- if (getEmptySlotTooltip() != null) {
- tooltip.addAll(getEmptySlotTooltip());
- }
- super.buildTooltip(tooltip);
- }
-
- @Override
- public List<String> getExtraTooltip() {
- if (getItemExtraTooltip() != null) {
- return getItemExtraTooltip();
- }
- return Collections.emptyList();
- }
- }.disableShiftInsert()
+ .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_INVERT_FILTER)
+ .setPos(61, 62)
+ .setSize(18, 18))
+ .widget(new ButtonWidget().setOnClick((clickData, widget) -> {
+ bNBTAllowed = !bNBTAllowed;
+ if (bNBTAllowed) {
+ GT_Utility.sendChatToPlayer(
+ widget.getContext()
+ .getPlayer(),
+ GT_Utility.trans("126", "Ignore NBT"));
+ } else {
+ GT_Utility.sendChatToPlayer(
+ widget.getContext()
+ .getPlayer(),
+ GT_Utility.trans("127", "NBT has to match"));
+ }
+ })
+ .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_NBT)
+ .setPos(79, 62)
+ .setSize(18, 18))
+ .widget(
+ new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_WHITE.apply(27, false))
+ .setPos(6, 19)
+ .setSize(27, 24))
+ .widget(
+ new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_BLUE.apply(42, true))
+ .setPos(53, 19)
+ .setSize(42, 24))
+ .widget(
+ new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_RED.apply(19, true))
+ .setPos(152, 19)
+ .setSize(19, 24))
+ .widget(new SlotWidget(BaseSlot.phantom(inventoryHandler, 9)) {
+
+ @Override
+ protected void phantomClick(ClickData clickData, ItemStack cursorStack) {
+ clickTypeIcon(clickData.mouseButton != 0, cursorStack);
+ }
+
+ @Override
+ public void buildTooltip(List<Text> tooltip) {
+ if (getEmptySlotTooltip() != null) {
+ tooltip.addAll(getEmptySlotTooltip());
+ }
+ super.buildTooltip(tooltip);
+ }
+
+ @Override
+ public List<String> getExtraTooltip() {
+ if (getItemExtraTooltip() != null) {
+ return getItemExtraTooltip();
+ }
+ return Collections.emptyList();
+ }
+ }.disableShiftInsert()
.setPos(34, 22)
.setBackground(GT_UITextures.BUTTON_STANDARD))
- .widget(
- SlotGroup.ofItemHandler(inventoryHandler, 3)
- .endAtSlot(8)
- .build()
- .setPos(97, 4));
+ .widget(
+ SlotGroup.ofItemHandler(inventoryHandler, 3)
+ .endAtSlot(8)
+ .build()
+ .setPos(97, 4));
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java
index 3424baca8b..765cd047ad 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java
@@ -35,7 +35,7 @@ public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntit
public final ITexture[][][] mTextures;
public GT_MetaTileEntity_TieredMachineBlock(int aID, String aName, String aNameRegional, int aTier,
- int aInvSlotCount, String aDescription, ITexture... aTextures) {
+ int aInvSlotCount, String aDescription, ITexture... aTextures) {
super(aID, aName, aNameRegional, aInvSlotCount);
mTier = (byte) Math.max(0, Math.min(aTier, 14));
mDescriptionArray = aDescription == null ? new String[0] : new String[] { aDescription };
@@ -46,7 +46,7 @@ public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntit
}
public GT_MetaTileEntity_TieredMachineBlock(int aID, String aName, String aNameRegional, int aTier,
- int aInvSlotCount, String[] aDescription, ITexture... aTextures) {
+ int aInvSlotCount, String[] aDescription, ITexture... aTextures) {
super(aID, aName, aNameRegional, aInvSlotCount);
mTier = (byte) Math.max(0, Math.min(aTier, 15));
mDescriptionArray = aDescription == null ? new String[0] : aDescription;
@@ -63,7 +63,7 @@ public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntit
}
public GT_MetaTileEntity_TieredMachineBlock(String aName, int aTier, int aInvSlotCount, String aDescription,
- ITexture[][][] aTextures) {
+ ITexture[][][] aTextures) {
super(aName, aInvSlotCount);
mTier = (byte) aTier;
mDescriptionArray = aDescription == null ? new String[0] : new String[] { aDescription };
@@ -72,7 +72,7 @@ public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntit
}
public GT_MetaTileEntity_TieredMachineBlock(String aName, int aTier, int aInvSlotCount, String[] aDescription,
- ITexture[][][] aTextures) {
+ ITexture[][][] aTextures) {
super(aName, aInvSlotCount);
mTier = (byte) aTier;
mDescriptionArray = aDescription == null ? new String[0] : aDescription;
@@ -124,15 +124,9 @@ public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntit
protected SlotWidget createChargerSlot(int x, int y, String tooltipKey, Object[] tooltipArgs) {
return (SlotWidget) new SlotWidget(inventoryHandler, rechargerSlotStartIndex()).disableShiftInsert()
- .setGTTooltip(
- () -> mTooltipCache.getData(
- tooltipKey,
- tooltipArgs))
- .setTooltipShowUpDelay(
- TOOLTIP_DELAY)
- .setBackground(
- getGUITextureSet().getItemSlot(),
- GT_UITextures.OVERLAY_SLOT_CHARGER)
- .setPos(x, y);
+ .setGTTooltip(() -> mTooltipCache.getData(tooltipKey, tooltipArgs))
+ .setTooltipShowUpDelay(TOOLTIP_DELAY)
+ .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CHARGER)
+ .setPos(x, y);
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TooltipMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TooltipMultiBlockBase.java
index a4c42dd14d..c12c7c1442 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TooltipMultiBlockBase.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TooltipMultiBlockBase.java
@@ -12,10 +12,10 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
* A multiblock with tooltip {@link GT_Multiblock_Tooltip_Builder}
*/
public abstract class GT_MetaTileEntity_TooltipMultiBlockBase extends GT_MetaTileEntity_MultiBlockBase
- implements ISecondaryDescribable {
+ implements ISecondaryDescribable {
private static final AtomicReferenceArray<GT_Multiblock_Tooltip_Builder> tooltips = new AtomicReferenceArray<>(
- GregTech_API.METATILEENTITIES.length);
+ GregTech_API.METATILEENTITIES.length);
public GT_MetaTileEntity_TooltipMultiBlockBase(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java
index c7b9c66b70..ae70607416 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java
@@ -58,38 +58,38 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi
ITexture[][][] rTextures = new ITexture[12][17][];
for (byte i = -1; i < 16; i++) {
rTextures[0][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] };
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] };
rTextures[1][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] };
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] };
rTextures[2][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] };
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] };
rTextures[3][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
- Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier] };
+ Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier] };
rTextures[4][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
- Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier] };
+ Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier] };
rTextures[5][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
- Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier] };
+ Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier] };
rTextures[6][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
- Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier] };
+ Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier] };
rTextures[7][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
- Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier] };
+ Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier] };
rTextures[8][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
- Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier] };
+ Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier] };
rTextures[9][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] };
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] };
rTextures[10][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] };
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] };
rTextures[11][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] };
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] };
}
return rTextures;
}
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
- boolean aActive, boolean aRedstone) {
+ boolean aActive, boolean aRedstone) {
return mTextures[Math.min(2, aSide) + (aSide == aFacing ? 3 : 0)
- + (aBaseMetaTileEntity.isAllowedToWork() ? 0 : 6)][aColorIndex + 1];
+ + (aBaseMetaTileEntity.isAllowedToWork() ? 0 : 6)][aColorIndex + 1];
}
@Override
@@ -125,7 +125,7 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi
@Override
public boolean isInputFacing(byte aSide) {
return getBaseMetaTileEntity().isAllowedToWork() ? aSide == getBaseMetaTileEntity().getFrontFacing()
- : aSide != getBaseMetaTileEntity().getFrontFacing();
+ : aSide != getBaseMetaTileEntity().getFrontFacing();
}
@Override
@@ -175,51 +175,46 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi
for (byte i = 0; i < 6 && aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity(); i++)
if (aBaseMetaTileEntity.inputEnergyFrom(i)) {
TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i);
- if (tTileEntity instanceof IEnergyProvider && ((IEnergyProvider) tTileEntity).extractEnergy(
- ForgeDirection.getOrientation(GT_Utility.getOppositeSide(i)),
- 1,
- true) == 1) {
+ if (tTileEntity instanceof IEnergyProvider && ((IEnergyProvider) tTileEntity)
+ .extractEnergy(ForgeDirection.getOrientation(GT_Utility.getOppositeSide(i)), 1, true) == 1) {
long tEU = ((IEnergyProvider) tTileEntity).extractEnergy(
- ForgeDirection.getOrientation(GT_Utility.getOppositeSide(i)),
- GT_Utility.safeInt(maxEUInput() * 100L / GregTech_API.mRFtoEU),
- false);
+ ForgeDirection.getOrientation(GT_Utility.getOppositeSide(i)),
+ GT_Utility.safeInt(maxEUInput() * 100L / GregTech_API.mRFtoEU),
+ false);
tEU = tEU * GregTech_API.mRFtoEU / 100;
aBaseMetaTileEntity.injectEnergyUnits((byte) 6, Math.min(tEU, maxEUInput()), 1);
} else if (tTileEntity instanceof IEnergyStorage
- && ((IEnergyStorage) tTileEntity).extractEnergy(1, true) == 1) {
- long tEU = ((IEnergyStorage) tTileEntity).extractEnergy(
- GT_Utility.safeInt(maxEUInput() * 100L / GregTech_API.mRFtoEU),
- false);
- tEU = tEU * GregTech_API.mRFtoEU / 100;
- aBaseMetaTileEntity.injectEnergyUnits((byte) 6, Math.min(tEU, maxEUInput()), 1);
- } else
- if (GregTech_API.meIOLoaded && tTileEntity instanceof IPowerContainer
- && ((IPowerContainer) tTileEntity).getEnergyStored() > 0) {
- int storedRF = ((IPowerContainer) tTileEntity).getEnergyStored();
- int extractRF = GT_Utility.safeInt(maxEUInput() * 100L / GregTech_API.mRFtoEU);
- long tEU = 0;
- if (tTileEntity instanceof TileCapBank) {
- ICapBankNetwork network = ((TileCapBank) tTileEntity).getNetwork();
- if (network != null && network.getEnergyStoredL() > 0) {
- tEU = Math.min(
- (Math.min(
- Math.min(network.getEnergyStoredL(), storedRF - extractRF),
- network.getMaxOutput())) * (long) GregTech_API.mRFtoEU
- / 100L,
- maxEUInput());
- network.addEnergy(GT_Utility.safeInt(-(tEU * 100 / GregTech_API.mRFtoEU)));
- }
+ && ((IEnergyStorage) tTileEntity).extractEnergy(1, true) == 1) {
+ long tEU = ((IEnergyStorage) tTileEntity)
+ .extractEnergy(GT_Utility.safeInt(maxEUInput() * 100L / GregTech_API.mRFtoEU), false);
+ tEU = tEU * GregTech_API.mRFtoEU / 100;
+ aBaseMetaTileEntity.injectEnergyUnits((byte) 6, Math.min(tEU, maxEUInput()), 1);
+ } else if (GregTech_API.meIOLoaded && tTileEntity instanceof IPowerContainer
+ && ((IPowerContainer) tTileEntity).getEnergyStored() > 0) {
+ int storedRF = ((IPowerContainer) tTileEntity).getEnergyStored();
+ int extractRF = GT_Utility.safeInt(maxEUInput() * 100L / GregTech_API.mRFtoEU);
+ long tEU = 0;
+ if (tTileEntity instanceof TileCapBank) {
+ ICapBankNetwork network = ((TileCapBank) tTileEntity).getNetwork();
+ if (network != null && network.getEnergyStoredL() > 0) {
+ tEU = Math.min(
+ (Math.min(
+ Math.min(network.getEnergyStoredL(), storedRF - extractRF),
+ network.getMaxOutput())) * (long) GregTech_API.mRFtoEU / 100L,
+ maxEUInput());
+ network.addEnergy(GT_Utility.safeInt(-(tEU * 100 / GregTech_API.mRFtoEU)));
+ }
+ } else {
+ if (storedRF > extractRF) {
+ ((IPowerContainer) tTileEntity).setEnergyStored(storedRF - extractRF);
+ tEU = maxEUInput();
} else {
- if (storedRF > extractRF) {
- ((IPowerContainer) tTileEntity).setEnergyStored(storedRF - extractRF);
- tEU = maxEUInput();
- } else {
- ((IPowerContainer) tTileEntity).setEnergyStored(0);
- tEU = storedRF * (long) GregTech_API.mRFtoEU / 100L;
- }
+ ((IPowerContainer) tTileEntity).setEnergyStored(0);
+ tEU = storedRF * (long) GregTech_API.mRFtoEU / 100L;
}
- aBaseMetaTileEntity.injectEnergyUnits((byte) 6, Math.min(tEU, maxEUInput()), 1);
}
+ aBaseMetaTileEntity.injectEnergyUnits((byte) 6, Math.min(tEU, maxEUInput()), 1);
+ }
}
}
}
@@ -252,14 +247,14 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi
@Override
public String getAlternativeModeText() {
return (getBaseMetaTileEntity().isAllowedToWork() ? GT_Utility.trans("145", "Step Down, In: ")
- : GT_Utility.trans("146", "Step Up, In: ")) + maxEUInput()
- + GT_Utility.trans("148", "V ")
- + maxAmperesIn()
- + GT_Utility.trans("147", "A, Out: ")
- + maxEUOutput()
- + GT_Utility.trans("148", "V ")
- + maxAmperesOut()
- + GT_Utility.trans("149", "A");
+ : GT_Utility.trans("146", "Step Up, In: ")) + maxEUInput()
+ + GT_Utility.trans("148", "V ")
+ + maxAmperesIn()
+ + GT_Utility.trans("147", "A, Out: ")
+ + maxEUOutput()
+ + GT_Utility.trans("148", "V ")
+ + maxAmperesOut()
+ + GT_Utility.trans("149", "A");
}
@Override
@@ -269,45 +264,42 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi
@Override
public void getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
- IWailaConfigHandler config) {
+ IWailaConfigHandler config) {
final int facing = getBaseMetaTileEntity().getFrontFacing();
final NBTTagCompound tag = accessor.getNBTData();
final int side = (byte) accessor.getSide()
- .ordinal();
+ .ordinal();
final boolean allowedToWork = tag.getBoolean("isAllowedToWork");
final byte inputTier = GT_Utility.getTier(tag.getLong("maxEUInput"));
final byte outputTier = GT_Utility.getTier(tag.getLong("maxEUOutput"));
currenttip.add(
- String.format(
- "%s %s(%dA) -> %s(%dA)",
- (allowedToWork ? (GREEN + "Step Down") : (RED + "Step Up")) + RESET,
- GT_Mod.gregtechproxy.mWailaTransformerVoltageTier
- ? GT_Utility.getColoredTierNameFromTier(inputTier)
- : tag.getLong("maxEUInput"),
- tag.getLong("maxAmperesIn"),
- GT_Mod.gregtechproxy.mWailaTransformerVoltageTier
- ? GT_Utility.getColoredTierNameFromTier(outputTier)
- : tag.getLong("maxEUOutput"),
- tag.getLong("maxAmperesOut")));
+ String.format(
+ "%s %s(%dA) -> %s(%dA)",
+ (allowedToWork ? (GREEN + "Step Down") : (RED + "Step Up")) + RESET,
+ GT_Mod.gregtechproxy.mWailaTransformerVoltageTier ? GT_Utility.getColoredTierNameFromTier(inputTier)
+ : tag.getLong("maxEUInput"),
+ tag.getLong("maxAmperesIn"),
+ GT_Mod.gregtechproxy.mWailaTransformerVoltageTier ? GT_Utility.getColoredTierNameFromTier(outputTier)
+ : tag.getLong("maxEUOutput"),
+ tag.getLong("maxAmperesOut")));
if ((side == facing && allowedToWork) || (side != facing && !allowedToWork)) {
currenttip.add(
- String.format(
- GOLD + "Input:" + RESET + " %s(%dA)",
- GT_Mod.gregtechproxy.mWailaTransformerVoltageTier
- ? GT_Utility.getColoredTierNameFromTier(inputTier)
- : tag.getLong("maxEUInput"),
- tag.getLong("maxAmperesIn")));
+ String.format(
+ GOLD + "Input:" + RESET + " %s(%dA)",
+ GT_Mod.gregtechproxy.mWailaTransformerVoltageTier ? GT_Utility.getColoredTierNameFromTier(inputTier)
+ : tag.getLong("maxEUInput"),
+ tag.getLong("maxAmperesIn")));
} else {
currenttip.add(
- String.format(
- BLUE + "Output:" + RESET + " %s(%dA)",
- GT_Mod.gregtechproxy.mWailaTransformerVoltageTier
- ? GT_Utility.getColoredTierNameFromTier(outputTier)
- : tag.getLong("maxEUOutput"),
- tag.getLong("maxAmperesOut")));
+ String.format(
+ BLUE + "Output:" + RESET + " %s(%dA)",
+ GT_Mod.gregtechproxy.mWailaTransformerVoltageTier
+ ? GT_Utility.getColoredTierNameFromTier(outputTier)
+ : tag.getLong("maxEUOutput"),
+ tag.getLong("maxAmperesOut")));
}
super.getWailaBody(itemStack, currenttip, accessor, config);
@@ -315,7 +307,7 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi
@Override
public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y,
- int z) {
+ int z) {
super.getWailaNBTData(player, tile, tag, world, x, y, z);
tag.setBoolean("isAllowedToWork", getBaseMetaTileEntity().isAllowedToWork());
tag.setLong("maxEUInput", maxEUInput());
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Dynamo.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Dynamo.java
index 1c61f9ffa7..0e313a4c00 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Dynamo.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Dynamo.java
@@ -14,13 +14,13 @@ import gregtech.api.interfaces.tileentity.IWirelessEnergyHatchInformation;
import gregtech.api.metatileentity.MetaTileEntity;
public class GT_MetaTileEntity_Wireless_Dynamo extends GT_MetaTileEntity_Hatch_Dynamo
- implements IGlobalWirelessEnergy, IWirelessEnergyHatchInformation {
+ implements IGlobalWirelessEnergy, IWirelessEnergyHatchInformation {
private String owner_uuid;
private String owner_name;
public GT_MetaTileEntity_Wireless_Dynamo(String aName, byte aTier, String[] aDescription,
- ITexture[][][] aTextures) {
+ ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
}
@@ -86,8 +86,8 @@ public class GT_MetaTileEntity_Wireless_Dynamo extends GT_MetaTileEntity_Hatch_D
@Override
public String[] getDescription() {
return new String[] { EnumChatFormatting.GRAY + "Stores energy globally in a network, up to 2^(2^31) EU.",
- EnumChatFormatting.GRAY + "Does not connect to wires. This block accepts EU into the network.",
- AuthorColen };
+ EnumChatFormatting.GRAY + "Does not connect to wires. This block accepts EU into the network.",
+ AuthorColen };
}
@Override
@@ -126,7 +126,7 @@ public class GT_MetaTileEntity_Wireless_Dynamo extends GT_MetaTileEntity_Hatch_D
// UUID and username of the owner.
owner_uuid = aBaseMetaTileEntity.getOwnerUuid()
- .toString();
+ .toString();
owner_name = aBaseMetaTileEntity.getOwnerName();
strongCheckOrAddUser(owner_uuid, owner_name);
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Hatch.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Hatch.java
index e17cc6fbfb..c363bb6eb0 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Hatch.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Hatch.java
@@ -16,10 +16,10 @@ import gregtech.api.interfaces.tileentity.IWirelessEnergyHatchInformation;
import gregtech.api.metatileentity.MetaTileEntity;
public class GT_MetaTileEntity_Wireless_Hatch extends GT_MetaTileEntity_Hatch_Energy
- implements IGlobalWirelessEnergy, IWirelessEnergyHatchInformation {
+ implements IGlobalWirelessEnergy, IWirelessEnergyHatchInformation {
- private final BigInteger eu_transferred_per_operation = BigInteger.valueOf(
- 2 * V[mTier] * ticks_between_energy_addition);
+ private final BigInteger eu_transferred_per_operation = BigInteger
+ .valueOf(2 * V[mTier] * ticks_between_energy_addition);
private final long eu_transferred_per_operation_long = eu_transferred_per_operation.longValue();
private String owner_uuid;
@@ -36,8 +36,8 @@ public class GT_MetaTileEntity_Wireless_Hatch extends GT_MetaTileEntity_Hatch_En
@Override
public String[] getDescription() {
return new String[] { EnumChatFormatting.GRAY + "Stores energy globally in a network, up to 2^(2^31) EU.",
- EnumChatFormatting.GRAY + "Does not connect to wires. This block withdraws EU from the network.",
- AuthorColen };
+ EnumChatFormatting.GRAY + "Does not connect to wires. This block withdraws EU from the network.",
+ AuthorColen };
}
@Override
@@ -132,7 +132,7 @@ public class GT_MetaTileEntity_Wireless_Hatch extends GT_MetaTileEntity_Hatch_En
// UUID and username of the owner.
owner_uuid = aBaseMetaTileEntity.getOwnerUuid()
- .toString();
+ .toString();
owner_name = aBaseMetaTileEntity.getOwnerName();
strongCheckOrAddUser(owner_uuid, owner_name);