aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/metatileentity/implementations
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/api/metatileentity/implementations')
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java371
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java343
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java43
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java305
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java220
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java91
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull.java58
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull_NonElectric.java22
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java641
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java254
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java418
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Steel.java151
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java120
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java258
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_CubicMultiBlockBase.java81
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_EnhancedMultiBlockBase.java225
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ExtendedPowerMultiBlockBase.java93
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch.java80
-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.java24
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy.java41
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Input.java53
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java44
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java178
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java62
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_MultiInput.java71
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java182
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java52
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java493
-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.java54
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TooltipMultiBlockBase.java11
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java253
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Dynamo.java27
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Hatch.java30
35 files changed, 2494 insertions, 3027 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 750b50d652..1ea2e3e756 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
@@ -2,6 +2,22 @@ package gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.GT_Values.ALL_VALID_SIDES;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+
import cofh.api.energy.IEnergyReceiver;
import cpw.mods.fml.common.Loader;
import gregtech.GT_Mod;
@@ -36,33 +52,16 @@ import ic2.api.energy.tile.IEnergySink;
import ic2.api.energy.tile.IEnergySource;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.reactor.IReactorChamber;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.AxisAlignedBB;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTileEntityCable {
+
public final float mThickNess;
public final Materials mMaterial;
public final long mCableLossPerMeter, mAmperage, mVoltage;
public final boolean mInsulated, mCanShock;
- public int mTransferredAmperage = 0,
- mTransferredAmperageLast20 = 0,
- mTransferredAmperageLast20OK = 0,
+ public int mTransferredAmperage = 0, mTransferredAmperageLast20 = 0, mTransferredAmperageLast20OK = 0,
mTransferredAmperageOK = 0;
- public long mTransferredVoltageLast20 = 0,
- mTransferredVoltage = 0,
- mTransferredVoltageLast20OK = 0,
+ public long mTransferredVoltageLast20 = 0, mTransferredVoltage = 0, mTransferredVoltageLast20OK = 0,
mTransferredVoltageOK = 0;
public long mRestRF;
public int mOverheat;
@@ -71,17 +70,8 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
private int[] lastAmperage;
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) {
+ public GT_MetaPipeEntity_Cable(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial,
+ long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
super(aID, aName, aNameRegional, 0);
mThickNess = aThickNess;
mMaterial = aMaterial;
@@ -92,15 +82,8 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
mCableLossPerMeter = aCableLossPerMeter;
}
- public GT_MetaPipeEntity_Cable(
- String aName,
- float aThickNess,
- Materials aMaterial,
- long aCableLossPerMeter,
- long aAmperage,
- long aVoltage,
- boolean aInsulated,
- boolean aCanShock) {
+ public GT_MetaPipeEntity_Cable(String aName, float aThickNess, Materials aMaterial, long aCableLossPerMeter,
+ long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
super(aName, 0);
mThickNess = aThickNess;
mMaterial = aMaterial;
@@ -119,87 +102,77 @@ 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);
- }
-
- @Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aConnections,
- byte aColorIndex,
- boolean aConnected,
- boolean aRedstone) {
- if (!mInsulated)
- return new ITexture[] {
- TextureFactory.of(
- mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- Dyes.getModulation(aColorIndex, mMaterial.mRGBa))
- };
+ mName,
+ mThickNess,
+ mMaterial,
+ mCableLossPerMeter,
+ mAmperage,
+ mVoltage,
+ mInsulated,
+ mCanShock);
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections,
+ byte aColorIndex, boolean aConnected, boolean aRedstone) {
+ if (!mInsulated) return new ITexture[] { TextureFactory.of(
+ 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))
- };
+ if (tThickNess < 0.124F) return new ITexture[] { TextureFactory.of(
+ 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))
- };
+ 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)) };
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))
- };
+ 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)) };
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))
- };
+ 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)) };
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))
- };
+ 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)) };
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_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_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
+ if (mCanShock && (((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0
&& aEntity instanceof EntityLivingBase
&& !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity))
GT_Utility.applyElectricityDamage(
- (EntityLivingBase) aEntity, mTransferredVoltageLast20, mTransferredAmperageLast20);
+ (EntityLivingBase) aEntity,
+ mTransferredVoltageLast20,
+ mTransferredAmperageLast20);
}
@Override
@@ -242,8 +215,8 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
@Override
@Deprecated
- public long transferElectricity(
- byte aSide, long aVoltage, long aAmperage, ArrayList<TileEntity> aAlreadyPassedTileEntityList) {
+ public long transferElectricity(byte aSide, long aVoltage, long aAmperage,
+ ArrayList<TileEntity> aAlreadyPassedTileEntityList) {
return transferElectricity(aSide, aVoltage, aAmperage, new HashSet<>(aAlreadyPassedTileEntityList));
}
@@ -275,24 +248,24 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
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
+ lastWorldTick = aBaseMetaTileEntity.getWorld().getTotalWorldTime() - 1; // sets initial value -1 since it is
+ // in the same tick as first on post
+ // tick
}
}
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
super.onPostTick(aBaseMetaTileEntity, aTick);
- if (aTick % 20 == 0
- && aBaseMetaTileEntity.isServerSide()
+ if (aTick % 20 == 0 && aBaseMetaTileEntity.isServerSide()
&& (!GT_Mod.gregtechproxy.gt6Cable || mCheckConnections)) {
checkConnections();
}
}
@Override
- public boolean onWireCutterRightClick(
- byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
+ float aZ) {
if (GT_Mod.gregtechproxy.gt6Cable
&& GT_ModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) {
if (isConnectedAtSide(aWrenchingSide)) {
@@ -308,8 +281,8 @@ 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) {
+ public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
+ float aZ) {
if (GT_Mod.gregtechproxy.gt6Cable
&& GT_ModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) {
if (isConnectedAtSide(aWrenchingSide)) {
@@ -325,34 +298,26 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
}
@Override
- public boolean letsIn(
- GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable,
+ ICoverable aTileEntity) {
return coverBehavior.letsEnergyIn(aSide, aCoverID, aCoverVariable, aTileEntity);
}
@Override
- public boolean letsOut(
- GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ public boolean letsOut(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable,
+ ICoverable aTileEntity) {
return coverBehavior.letsEnergyOut(aSide, aCoverID, aCoverVariable, aTileEntity);
}
@Override
- public boolean letsIn(
- GT_CoverBehaviorBase<?> coverBehavior,
- byte aSide,
- int aCoverID,
- ISerializableObject aCoverVariable,
- ICoverable aTileEntity) {
+ public boolean letsIn(GT_CoverBehaviorBase<?> coverBehavior, byte aSide, int aCoverID,
+ 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) {
+ public boolean letsOut(GT_CoverBehaviorBase<?> coverBehavior, byte aSide, int aCoverID,
+ ISerializableObject aCoverVariable, ICoverable aTileEntity) {
return coverBehavior.letsEnergyOut(aSide, aCoverID, aCoverVariable, aTileEntity);
}
@@ -374,9 +339,9 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
final ForgeDirection tDir = ForgeDirection.getOrientation(tSide);
// GT Machine handling
- if ((tTileEntity instanceof IEnergyConnected)
- && (((IEnergyConnected) tTileEntity).inputEnergyFrom(tSide, false)
- || ((IEnergyConnected) tTileEntity).outputsEnergyTo(tSide, false))) return true;
+ if ((tTileEntity instanceof IEnergyConnected) && (((IEnergyConnected) tTileEntity).inputEnergyFrom(tSide, false)
+ || ((IEnergyConnected) tTileEntity).outputsEnergyTo(tSide, false)))
+ return true;
// Solar Panel Compat
if (coverBehavior instanceof GT_Cover_SolarPanel) return true;
@@ -398,15 +363,18 @@ 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);
+ else ic2Energy = (tTileEntity == null || tTileEntity instanceof IEnergyTile || EnergyNet.instance == null)
+ ? 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)) {
@@ -416,14 +384,13 @@ 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;
+ if (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver
+ && ((IEnergyReceiver) tTileEntity).canConnectEnergy(tDir))
+ return true;
// RF Input Compat
- return GregTech_API.mInputRF
- && (tTileEntity instanceof IEnergyEmitter
- && ((IEnergyEmitter) tTileEntity).emitsEnergyTo((TileEntity) baseMetaTile, tDir));
+ return GregTech_API.mInputRF && (tTileEntity instanceof IEnergyEmitter
+ && ((IEnergyEmitter) tTileEntity).emitsEnergyTo((TileEntity) baseMetaTile, tDir));
}
@Override
@@ -445,16 +412,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
@@ -491,21 +466,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
@@ -557,19 +549,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) {
+ public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB,
+ 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);
@@ -583,20 +569,19 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
if (mConnections != 0) {
final IGregTechTileEntity baseMeta = getBaseMetaTileEntity();
- 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);
-
- if (tEmitter instanceof IEnergyEmitter) return true;
- }
+ 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);
+
+ if (tEmitter instanceof IEnergyEmitter) return true;
+ }
}
return false;
}
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 61d55bfd9b..29237218a1 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
@@ -3,6 +3,25 @@ package gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.GT_Values.D1;
import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
+import java.util.ArrayList;
+import java.util.List;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.FluidTankInfo;
+import net.minecraftforge.fluids.IFluidHandler;
+
+import org.apache.commons.lang3.tuple.MutableTriple;
+
import cpw.mods.fml.common.Optional;
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
@@ -21,24 +40,9 @@ import gregtech.common.GT_Client;
import gregtech.common.covers.CoverInfo;
import gregtech.common.covers.GT_Cover_Drain;
import gregtech.common.covers.GT_Cover_FluidRegulator;
-import java.util.ArrayList;
-import java.util.List;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.AxisAlignedBB;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.FluidTankInfo;
-import net.minecraftforge.fluids.IFluidHandler;
-import org.apache.commons.lang3.tuple.MutableTriple;
public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
+
public final float mThickNess;
public final Materials mMaterial;
public final int mCapacity, mHeatResistance, mPipeAmount;
@@ -50,28 +54,13 @@ 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) {
+ public GT_MetaPipeEntity_Fluid(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial,
+ 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) {
+ public GT_MetaPipeEntity_Fluid(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial,
+ int aCapacity, int aHeatResistance, boolean aGasProof, int aFluidTypes) {
super(aID, aName, aNameRegional, 0, false);
mThickNess = aThickNess;
mMaterial = aMaterial;
@@ -84,24 +73,13 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
}
@Deprecated
- public GT_MetaPipeEntity_Fluid(
- String aName,
- float aThickNess,
- Materials aMaterial,
- int aCapacity,
- int aHeatResistance,
- boolean aGasProof) {
+ public GT_MetaPipeEntity_Fluid(String aName, float aThickNess, Materials aMaterial, int aCapacity,
+ 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) {
+ public GT_MetaPipeEntity_Fluid(String aName, float aThickNess, Materials aMaterial, int aCapacity,
+ int aHeatResistance, boolean aGasProof, int aFluidTypes) {
super(aName, 0);
mThickNess = aThickNess;
mMaterial = aMaterial;
@@ -120,79 +98,61 @@ 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) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections,
+ 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))
- };
+ return new ITexture[] { aConnected ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex)
+ : 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}
- };
+ 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 } };
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
+ // 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)
- };
+ return new ITexture[] { aConnected ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex)
+ : 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));
- if (aPipeAmount >= 4)
- return TextureFactory.of(
- 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));
- if (aThickNess < 0.374F)
- return TextureFactory.of(
- 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));
- if (aThickNess < 0.749F)
- return TextureFactory.of(
- 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));
+ if (aPipeAmount >= 9) return TextureFactory.of(
+ 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));
+ if (aThickNess < 0.124F) return TextureFactory.of(
+ 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));
+ if (aThickNess < 0.499F) return TextureFactory.of(
+ 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));
+ if (aThickNess < 0.874F) return TextureFactory.of(
+ 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));
@@ -277,9 +237,8 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
@Override
public void saveNBTData(NBTTagCompound aNBT) {
- for (int i = 0; i < mPipeAmount; i++)
- if (mFluids[i] != null)
- aNBT.setTag("mFluid" + (i == 0 ? "" : i), mFluids[i].writeToNBT(new NBTTagCompound()));
+ for (int i = 0; i < mPipeAmount; i++) if (mFluids[i] != null)
+ aNBT.setTag("mFluid" + (i == 0 ? "" : i), mFluids[i].writeToNBT(new NBTTagCompound()));
aNBT.setByte("mLastReceivedFrom", mLastReceivedFrom);
if (GT_Mod.gregtechproxy.gt6Pipe) {
aNBT.setByte("mConnections", mConnections);
@@ -305,17 +264,17 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
for (FluidStack tFluid : mFluids) {
if (tFluid != null) {
final int tTemperature = tFluid.getFluid().getTemperature(tFluid);
- if (tTemperature > 320
- && !isCoverOnSide(
- (BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) {
+ 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;
+ }
}
}
}
@@ -361,25 +320,33 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
// 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);
+ + " | "
+ + 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);
+ 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);
}
if (!mGasProof && tFluid.getFluid().isGaseous(tFluid)) {
tFluid.amount -= 5;
sendSound((byte) 9);
if (tTemperature > 320) {
try {
- for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) getBaseMetaTileEntity()
- .getWorld()
+ for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) getBaseMetaTileEntity().getWorld()
.getEntitiesWithinAABB(
EntityLivingBase.class,
AxisAlignedBB.getBoundingBox(
@@ -396,8 +363,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
}
} else if (tTemperature < 260) {
try {
- for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) getBaseMetaTileEntity()
- .getWorld()
+ for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) getBaseMetaTileEntity().getWorld()
.getEntitiesWithinAABB(
EntityLivingBase.class,
AxisAlignedBB.getBoundingBox(
@@ -434,8 +400,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
final IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide(aSide);
final IGregTechTileEntity gTank = tTank instanceof IGregTechTileEntity ? (IGregTechTileEntity) tTank : null;
- if (isConnectedAtSide(aSide)
- && 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()))) {
@@ -470,8 +435,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);
@@ -480,8 +445,8 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
}
@Override
- public boolean onWrenchRightClick(
- byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
+ float aZ) {
if (GT_Mod.gregtechproxy.gt6Pipe) {
final byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
final byte tMask = (byte) (1 << tSide);
@@ -508,34 +473,26 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
}
@Override
- public boolean letsIn(
- GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable,
+ 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) {
+ public boolean letsOut(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable,
+ 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) {
+ public boolean letsIn(GT_CoverBehaviorBase<?> coverBehavior, byte aSide, int aCoverID,
+ 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) {
+ public boolean letsOut(GT_CoverBehaviorBase<?> coverBehavior, byte aSide, int aCoverID,
+ ISerializableObject aCoverVariable, ICoverable aTileEntity) {
return coverBehavior.letsFluidOut(aSide, aCoverID, aCoverVariable, null, aTileEntity);
}
@@ -553,14 +510,14 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
public boolean canConnect(byte aSide, TileEntity tTileEntity) {
if (tTileEntity == null) return false;
- final byte tSide =
- (byte) ForgeDirection.getOrientation(aSide).getOpposite().ordinal();
+ final byte tSide = (byte) ForgeDirection.getOrientation(aSide).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;
+ final IGregTechTileEntity gTileEntity = (tTileEntity instanceof IGregTechTileEntity)
+ ? (IGregTechTileEntity) tTileEntity
+ : null;
if (coverBehavior instanceof GT_Cover_Drain || (GregTech_API.mTConstruct && isTConstructFaucet(tTileEntity)))
return true;
@@ -570,8 +527,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
if (fTileEntity != null) {
final FluidTankInfo[] tInfo = fTileEntity.getTankInfo(ForgeDirection.getOrientation(tSide));
if (tInfo != null) {
- return tInfo.length > 0
- || (GregTech_API.mTranslocator && isTranslocator(tTileEntity))
+ return tInfo.length > 0 || (GregTech_API.mTranslocator && isTranslocator(tTileEntity))
|| gTileEntity != null
&& gTileEntity.getCoverBehaviorAtSideNew(tSide) instanceof GT_Cover_FluidRegulator;
}
@@ -603,18 +559,19 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
if (aIndex == 9) {
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());
+ 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());
}
}
@@ -763,19 +720,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 };
}
}
@@ -848,19 +811,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) {
+ public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB,
+ 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 d50c4fc165..e449921d1d 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
@@ -3,6 +3,9 @@ package gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.GT_Values.RA;
import static gregtech.api.util.GT_Utility.calculateRecipeEU;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+
import gregtech.api.enums.*;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -13,12 +16,11 @@ import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_ModHandler.RecipeBits;
import gregtech.api.util.GT_OreDictUnificator;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
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) {
@@ -30,7 +32,7 @@ public class GT_MetaPipeEntity_Frame extends MetaPipeEntity {
GT_ModHandler.addCraftingRecipe(
getStackForm(2),
RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {"SSS", "SwS", "SSS", 'S', OrePrefixes.stick.get(mMaterial)});
+ new Object[] { "SSS", "SwS", "SSS", 'S', OrePrefixes.stick.get(mMaterial) });
}
if (!aMaterial.contains(SubTag.NO_RECIPES)) {
@@ -60,18 +62,11 @@ public class GT_MetaPipeEntity_Frame extends MetaPipeEntity {
}
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aConnections,
- byte aColorIndex,
- boolean aConnected,
- boolean aRedstone) {
- return new ITexture[] {
- TextureFactory.of(
- mMaterial.mIconSet.mTextures[OrePrefixes.frameGt.mTextureIndex],
- Dyes.getModulation(aColorIndex, mMaterial.mRGBa))
- };
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections,
+ byte aColorIndex, boolean aConnected, boolean aRedstone) {
+ return new ITexture[] { TextureFactory.of(
+ mMaterial.mIconSet.mTextures[OrePrefixes.frameGt.mTextureIndex],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) };
}
@Override
@@ -106,23 +101,23 @@ public class GT_MetaPipeEntity_Frame extends MetaPipeEntity {
@Override
public final void saveNBTData(NBTTagCompound aNBT) {
- /*Do nothing*/
+ /* Do nothing */
}
@Override
public final void loadNBTData(NBTTagCompound aNBT) {
- /*Do nothing*/
+ /* Do nothing */
}
@Override
- public final boolean allowPutStack(
- IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ public final boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide,
+ ItemStack aStack) {
return false;
}
@Override
- public final boolean allowPullStack(
- IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ public final boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide,
+ ItemStack aStack) {
return false;
}
@@ -133,7 +128,7 @@ public class GT_MetaPipeEntity_Frame extends MetaPipeEntity {
@Override
public void disconnect(byte aSide) {
- /* Do nothing*/
+ /* Do nothing */
}
@Override
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 5ae9150a58..5d2211528b 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
@@ -3,6 +3,23 @@ package gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.GT_Values.ALL_VALID_SIDES;
import static gregtech.api.enums.Textures.BlockIcons.PIPE_RESTRICTOR;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.ISidedInventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.tileentity.TileEntityDispenser;
+import net.minecraft.tileentity.TileEntityHopper;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+
import gregtech.GT_Mod;
import gregtech.api.enums.Dyes;
import gregtech.api.enums.GT_Values;
@@ -22,23 +39,9 @@ import gregtech.api.util.GT_Utility;
import gregtech.api.util.ISerializableObject;
import gregtech.common.GT_Client;
import gregtech.common.covers.CoverInfo;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.ISidedInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.tileentity.TileEntityDispenser;
-import net.minecraft.tileentity.TileEntityHopper;
-import net.minecraft.util.AxisAlignedBB;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileEntityItemPipe {
+
public final float mThickNess;
public final Materials mMaterial;
public final int mStepSize;
@@ -48,16 +51,8 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
public boolean mIsRestrictive = false;
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) {
+ public GT_MetaPipeEntity_Item(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial,
+ int aInvSlotCount, int aStepSize, boolean aIsRestrictive, int aTickTime) {
super(aID, aName, aNameRegional, aInvSlotCount, false);
mIsRestrictive = aIsRestrictive;
mThickNess = aThickNess;
@@ -67,26 +62,13 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
addInfo(aID);
}
- public GT_MetaPipeEntity_Item(
- int aID,
- String aName,
- String aNameRegional,
- float aThickNess,
- Materials aMaterial,
- int aInvSlotCount,
- int aStepSize,
- boolean aIsRestrictive) {
+ public GT_MetaPipeEntity_Item(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial,
+ 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) {
+ public GT_MetaPipeEntity_Item(String aName, float aThickNess, Materials aMaterial, int aInvSlotCount, int aStepSize,
+ boolean aIsRestrictive, int aTickTime) {
super(aName, aInvSlotCount);
mIsRestrictive = aIsRestrictive;
mThickNess = aThickNess;
@@ -103,112 +85,87 @@ 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) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections,
+ 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)
- };
+ 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],
- Dyes.getModulation(aColorIndex, mMaterial.mRGBa)),
- TextureFactory.of(PIPE_RESTRICTOR)
- };
+ 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)
- };
+ return new ITexture[] { TextureFactory.of(
+ 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))
- };
+ if (tThickNess < 0.124F) return new ITexture[] { TextureFactory.of(
+ 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))
- };
+ return new ITexture[] { TextureFactory.of(
+ 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))
- };
+ return new ITexture[] { TextureFactory.of(
+ 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))
- };
+ return new ITexture[] { TextureFactory.of(
+ 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],
- Dyes.getModulation(aColorIndex, mMaterial.mRGBa))
- };
+ 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],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) };
}
- return new ITexture[] {
- TextureFactory.of(
- mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex],
- Dyes.getModulation(aColorIndex, mMaterial.mRGBa))
- };
+ return new ITexture[] { TextureFactory.of(
+ mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) };
}
@Override
@@ -268,10 +225,11 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
final ArrayList<IMetaTileEntityItemPipe> tPipeList = new ArrayList<>();
- for (boolean temp = true; temp && !isInventoryEmpty() && pipeCapacityCheck(); ) {
+ 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()) {
if (temp) break;
@@ -289,8 +247,8 @@ 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) {
+ public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
+ float aZ) {
if (GT_Mod.gregtechproxy.gt6Pipe) {
final byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
if (isConnectedAtSide(tSide)) {
@@ -305,34 +263,26 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
}
@Override
- public boolean letsIn(
- GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable,
+ 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) {
+ public boolean letsOut(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable,
+ 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) {
+ public boolean letsIn(GT_CoverBehaviorBase<?> coverBehavior, byte aSide, int aCoverID,
+ 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) {
+ public boolean letsOut(GT_CoverBehaviorBase<?> coverBehavior, byte aSide, int aCoverID,
+ ISerializableObject aCoverVariable, ICoverable aTileEntity) {
return coverBehavior.letsItemsOut(aSide, aCoverID, aCoverVariable, -1, aTileEntity);
}
@@ -353,8 +303,9 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
final byte tSide = GT_Utility.getOppositeSide(aSide);
boolean connectable = GT_Utility.isConnectableNonInventoryPipe(tTileEntity, tSide);
- final IGregTechTileEntity gTileEntity =
- (tTileEntity instanceof IGregTechTileEntity) ? (IGregTechTileEntity) tTileEntity : null;
+ final IGregTechTileEntity gTileEntity = (tTileEntity instanceof IGregTechTileEntity)
+ ? (IGregTechTileEntity) tTileEntity
+ : null;
if (gTileEntity != null) {
if (gTileEntity.getMetaTileEntity() == null) return false;
if (gTileEntity.getMetaTileEntity().connectsToItemPipe(tSide)) return true;
@@ -410,18 +361,17 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
if ((!(tInventory instanceof TileEntityHopper) && !(tInventory instanceof TileEntityDispenser))
|| 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;
}
}
}
@@ -490,21 +440,14 @@ 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)
- };
- else if (mTickTime % 20 == 0)
- return new String[] {
+ if (mTickTime == 20) return new String[] { "Item Capacity: %%%" + getMaxPipeCapacity() + "%%% Stacks/sec",
+ "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)
- };
- else
- return new String[] {
+ "Routing Value: %%%" + GT_Utility.formatNumbers(mStepSize) };
+ else return new String[] {
"Item Capacity: %%%" + getMaxPipeCapacity() + "%%% Stacks/%%%" + mTickTime + "%%% ticks",
- "Routing Value: %%%" + GT_Utility.formatNumbers(mStepSize)
- };
+ "Routing Value: %%%" + GT_Utility.formatNumbers(mStepSize) };
}
private boolean isInventoryEmpty() {
@@ -567,19 +510,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) {
+ public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB,
+ 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 c46dbe0bae..7eb396a293 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
@@ -2,10 +2,25 @@ package gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.GT_Values.V;
+import java.util.List;
+
+import mcp.mobius.waila.api.IWailaConfigHandler;
+import mcp.mobius.waila.api.IWailaDataAccessor;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.World;
+
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot;
import com.gtnewhorizons.modularui.common.widget.SlotGroup;
+
import gregtech.api.enums.Textures;
import gregtech.api.gui.modularui.GT_UIInfos;
import gregtech.api.interfaces.ITexture;
@@ -16,44 +31,34 @@ import gregtech.api.items.GT_MetaBase_Item;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
import ic2.api.item.IElectricItem;
-import java.util.List;
-import mcp.mobius.waila.api.IWailaConfigHandler;
-import mcp.mobius.waila.api.IWailaDataAccessor;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraft.world.World;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
* <p/>
- * This is the main construct for my Basic Machines such as the Automatic Extractor
- * Extend this class to make a simple Machine
+ * This is the main construct for my Basic Machines such as the Automatic Extractor Extend this class to make a simple
+ * Machine
*/
public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_TieredMachineBlock
implements IAddUIWidgets {
+
public boolean mCharge = false, mDecharge = false;
public int mBatteryCount = 0, mChargeableCount = 0;
private long count = 0;
private long mStored = 0;
private long mMax = 0;
- public GT_MetaTileEntity_BasicBatteryBuffer(
- int aID, String aName, String aNameRegional, int aTier, String aDescription, int aSlotCount) {
+ public GT_MetaTileEntity_BasicBatteryBuffer(int aID, String aName, String aNameRegional, int aTier,
+ 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) {
+ public GT_MetaTileEntity_BasicBatteryBuffer(String aName, int aTier, String aDescription, ITexture[][][] aTextures,
+ int aSlotCount) {
super(aName, aTier, aSlotCount, aDescription, aTextures);
}
- public GT_MetaTileEntity_BasicBatteryBuffer(
- String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, int aSlotCount) {
+ public GT_MetaTileEntity_BasicBatteryBuffer(String aName, int aTier, String[] aDescription,
+ ITexture[][][] aTextures, int aSlotCount) {
super(aName, aTier, aSlotCount, aDescription, aTextures);
}
@@ -69,27 +74,18 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
public ITexture[][][] getTextureSet(ITexture[] aTextures) {
ITexture[][][] rTextures = new ITexture[2][17][];
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]
- };
+ 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] };
}
return rTextures;
}
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- boolean aActive,
- boolean aRedstone) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ boolean aActive, boolean aRedstone) {
return mTextures[aSide == aFacing ? 1 : 0][aColorIndex + 1];
}
@@ -231,11 +227,10 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3;
mBatteryCount = 0;
mChargeableCount = 0;
- for (ItemStack tStack : mInventory)
- if (GT_ModHandler.isElectricItem(tStack, mTier)) {
- if (GT_ModHandler.isChargerItem(tStack)) mBatteryCount++;
- mChargeableCount++;
- }
+ for (ItemStack tStack : mInventory) if (GT_ModHandler.isElectricItem(tStack, mTier)) {
+ if (GT_ModHandler.isChargerItem(tStack)) mBatteryCount++;
+ mChargeableCount++;
+ }
}
count++;
}
@@ -244,8 +239,7 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
if (GT_ModHandler.isElectricItem(aStack) && aStack.getUnlocalizedName().startsWith("gt.metaitem.01.")) {
String name = aStack.getUnlocalizedName();
- if (name.equals("gt.metaitem.01.32510")
- || name.equals("gt.metaitem.01.32511")
+ 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")
@@ -310,23 +304,24 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
if (storedOverflow) {
tStored = Long.MAX_VALUE;
}
- return new long[] {tStored, tScale};
+ return new long[] { tStored, tScale };
}
@Override
public String[] getInfoData() {
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"
- };
+ 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" };
}
private void updateStorageInfo() {
@@ -339,29 +334,32 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
}
@Override
- public void getWailaBody(
- ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
+ public void getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
+ 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"))));
+ currenttip.add(
+ 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)));
- currenttip.add(StatCollector.translateToLocalFormatted(
- "GT5U.waila.energy.avg_out",
- GT_Utility.formatNumbers(avgOut),
- GT_Utility.getColoredTierNameFromVoltage(avgOut)));
+ currenttip.add(
+ 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)));
super.getWailaBody(itemStack, currenttip, accessor, config);
}
@Override
- public void getWailaNBTData(
- EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, int z) {
+ public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y,
+ int z) {
updateStorageInfo();
super.getWailaNBTData(player, tile, tag, world, x, y, z);
tag.setLong("mStored", mStored);
@@ -384,60 +382,48 @@ 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));
+ 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));
break;
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));
+ 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));
break;
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));
+ 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));
break;
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));
+ 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));
break;
}
}
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 ca5f255302..669b3c9495 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
@@ -2,6 +2,13 @@ package gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.GT_Values.V;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.IFluidContainerItem;
+import net.minecraftforge.fluids.IFluidHandler;
+
import gregtech.api.enums.ItemList;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.Textures;
@@ -14,21 +21,16 @@ import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import gregtech.common.GT_Pollution;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.IFluidContainerItem;
-import net.minecraftforge.fluids.IFluidHandler;
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) {
+
+ public GT_MetaTileEntity_BasicGenerator(int aID, String aName, String aNameRegional, int aTier, String aDescription,
+ 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) {
+ public GT_MetaTileEntity_BasicGenerator(int aID, String aName, String aNameRegional, int aTier,
+ String[] aDescription, ITexture... aTextures) {
super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
}
@@ -59,21 +61,11 @@ 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) {
- return mTextures[
- (aActive ? 5 : 0)
- + (aSide == aFacing
- ? 0
- : aSide == GT_Utility.getOppositeSide(aFacing)
- ? 1
- : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][
- aColorIndex + 1];
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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];
}
@Override
@@ -91,23 +83,23 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity
}
public ITexture[] getFront(byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1] };
}
public ITexture[] getBack(byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1] };
}
public ITexture[] getBottom(byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1] };
}
public ITexture[] getTop(byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1] };
}
public ITexture[] getSides(byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1] };
}
public ITexture[] getFrontActive(byte aColor) {
@@ -221,10 +213,11 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity
} else {
if (mInventory[getStackDisplaySlot()] == null)
mInventory[getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1);
- mInventory[getStackDisplaySlot()].setStackDisplayName("Draining internal buffer: "
- + GT_Utility.formatNumbers(
- aBaseMetaTileEntity.getUniversalEnergyStored() - getMinimumStoredEU())
- + " EU");
+ mInventory[getStackDisplaySlot()].setStackDisplayName(
+ "Draining internal buffer: "
+ + GT_Utility.formatNumbers(
+ aBaseMetaTileEntity.getUniversalEnergyStored() - getMinimumStoredEU())
+ + " EU");
}
} else {
long tFuelValue = getFuelValue(mFluid), tConsumed = consumedFluidPerOperation(mFluid);
@@ -262,9 +255,9 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity
}
}
- if (aBaseMetaTileEntity.isServerSide())
- aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork()
- && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU());
+ if (aBaseMetaTileEntity.isServerSide()) aBaseMetaTileEntity.setActive(
+ aBaseMetaTileEntity.isAllowedToWork()
+ && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU());
}
/**
@@ -279,17 +272,14 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity
return !OrePrefixes.CELL_TYPES.contains(association.mPrefix)
&& !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...
+ 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...
}
}
@@ -341,9 +331,8 @@ 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);
+ return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && (getFuelValue(aStack, 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 31420386ee..cb9c670f05 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
@@ -2,37 +2,33 @@ package gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.GT_Values.V;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
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) {
+
+ public GT_MetaTileEntity_BasicHull(int aID, String aName, String aNameRegional, int aTier, String aDescription,
+ 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) {
+ public GT_MetaTileEntity_BasicHull(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount,
+ 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) {
+ public GT_MetaTileEntity_BasicHull(String aName, int aTier, int aInvSlotCount, String aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
- public GT_MetaTileEntity_BasicHull(
- String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_BasicHull(String aName, int aTier, int aInvSlotCount, String[] aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
@@ -117,13 +113,8 @@ 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) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ boolean aConnected, boolean aRedstone) {
return mTextures[Math.min(2, aSide) + (aSide == aFacing ? 3 : 0)][aColorIndex + 1];
}
@@ -131,18 +122,15 @@ public class GT_MetaTileEntity_BasicHull extends GT_MetaTileEntity_BasicTank {
public ITexture[][][] getTextureSet(ITexture[] aTextures) {
ITexture[][][] rTextures = new ITexture[6][17][];
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]};
- 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]
- };
- rTextures[4][i + 1] = new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], 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]
- };
+ 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] };
+ 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] };
+ rTextures[4][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
+ 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] };
}
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 716d9d2c12..1296d846af 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
@@ -4,29 +4,25 @@ import gregtech.api.interfaces.ITexture;
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) {
+
+ public GT_MetaTileEntity_BasicHull_NonElectric(int aID, String aName, String aNameRegional, int aTier,
+ String aDescription) {
super(aID, aName, aNameRegional, aTier, aDescription);
}
- public GT_MetaTileEntity_BasicHull_NonElectric(
- String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_BasicHull_NonElectric(String aName, int aTier, String aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, 1, aDescription, aTextures);
}
- public GT_MetaTileEntity_BasicHull_NonElectric(
- String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_BasicHull_NonElectric(String aName, int aTier, String[] aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, 1, aDescription, aTextures);
}
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aConnections,
- byte aColorIndex,
- boolean aConnected,
- boolean aRedstone) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections,
+ 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 632b8cca8b..501e78ccec 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
@@ -19,6 +19,29 @@ import static gregtech.api.metatileentity.BaseTileEntity.TOOLTIP_DELAY;
import static gregtech.api.metatileentity.BaseTileEntity.UNUSED_SLOT_TOOLTIP;
import static gregtech.api.util.GT_Utility.moveMultipleItemStacks;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import mcp.mobius.waila.api.IWailaConfigHandler;
+import mcp.mobius.waila.api.IWailaDataAccessor;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.World;
+import net.minecraftforge.common.DimensionManager;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.IFluidHandler;
+
+import org.apache.commons.lang3.tuple.Pair;
+
import com.gtnewhorizons.modularui.api.drawable.IDrawable;
import com.gtnewhorizons.modularui.api.drawable.UITexture;
import com.gtnewhorizons.modularui.api.math.Pos2d;
@@ -32,6 +55,7 @@ import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget;
import com.gtnewhorizons.modularui.common.widget.ProgressBar;
import com.gtnewhorizons.modularui.common.widget.SlotWidget;
+
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ItemList;
@@ -55,31 +79,12 @@ import gregtech.common.gui.modularui.widget.FluidDisplaySlotWidget;
import gregtech.common.power.BasicMachineEUPower;
import gregtech.common.power.Power;
import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_Cleanroom;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import mcp.mobius.waila.api.IWailaConfigHandler;
-import mcp.mobius.waila.api.IWailaDataAccessor;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraft.world.World;
-import net.minecraftforge.common.DimensionManager;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.IFluidHandler;
-import org.apache.commons.lang3.tuple.Pair;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
* <p/>
- * This is the main construct for my Basic Machines such as the Automatic Extractor
- * Extend this class to make a simple Machine
+ * This is the main construct for my Basic Machines such as the Automatic Extractor Extend this class to make a simple
+ * Machine
*/
public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_BasicTank
implements IConfigurationCircuitSupport, IAddGregtechLogo, IAddUIWidgets {
@@ -87,20 +92,14 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
/**
* return values for checkRecipe()
*/
- protected static final int DID_NOT_FIND_RECIPE = 0,
- FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1,
+ protected static final int DID_NOT_FIND_RECIPE = 0, FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1,
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;
+ public boolean mAllowInputFromOutputSide = false, mFluidTransfer = false, mItemTransfer = 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;
@@ -109,40 +108,23 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
protected final Power mPower;
/**
- * Contains the Recipe which has been previously used, or null if there was no previous Recipe, which could have been buffered
+ * Contains the Recipe which has been previously used, or null if there was no previous Recipe, which could have
+ * been buffered
*/
protected GT_Recipe mLastRecipe = null;
private FluidStack mFluidOut;
/**
- * @param aOverlays 0 = SideFacingActive
- * 1 = SideFacingInactive
- * 2 = FrontFacingActive
- * 3 = FrontFacingInactive
- * 4 = TopFacingActive
- * 5 = TopFacingInactive
- * 6 = BottomFacingActive
- * 7 = BottomFacingInactive
- * ----- Not all Array Elements have to be initialised, you can also just use 8 Parameters for the Default Pipe Texture Overlays -----
- * 8 = BottomFacingPipeActive
- * 9 = BottomFacingPipeInactive
- * 10 = TopFacingPipeActive
- * 11 = TopFacingPipeInactive
- * 12 = SideFacingPipeActive
- * 13 = SideFacingPipeInactive
+ * @param aOverlays 0 = SideFacingActive 1 = SideFacingInactive 2 = FrontFacingActive 3 = FrontFacingInactive 4 =
+ * TopFacingActive 5 = TopFacingInactive 6 = BottomFacingActive 7 = BottomFacingInactive ----- Not
+ * all Array Elements have to be initialised, you can also just use 8 Parameters for the Default
+ * Pipe Texture Overlays ----- 8 = BottomFacingPipeActive 9 = BottomFacingPipeInactive 10 =
+ * TopFacingPipeActive 11 = TopFacingPipeInactive 12 = SideFacingPipeActive 13 =
+ * 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,
+ 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) {
super(
aID,
@@ -160,17 +142,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
mPower = buildPower();
}
- public GT_MetaTileEntity_BasicMachine(
- int aID,
- String aName,
- String aNameRegional,
- int aTier,
- int aAmperage,
- String[] aDescription,
- int aInputSlotCount,
- int aOutputSlotCount,
- String aGUIName,
- String aNEIName,
+ 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) {
super(
aID,
@@ -188,16 +161,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
mPower = buildPower();
}
- public GT_MetaTileEntity_BasicMachine(
- String aName,
- int aTier,
- int aAmperage,
- String aDescription,
- ITexture[][][] aTextures,
- int aInputSlotCount,
- int aOutputSlotCount,
- String aGUIName,
- String aNEIName) {
+ public GT_MetaTileEntity_BasicMachine(String aName, int aTier, int aAmperage, String aDescription,
+ 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)];
@@ -207,16 +172,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
mPower = buildPower();
}
- public GT_MetaTileEntity_BasicMachine(
- String aName,
- int aTier,
- int aAmperage,
- String[] aDescription,
- ITexture[][][] aTextures,
- int aInputSlotCount,
- int aOutputSlotCount,
- String aGUIName,
- String aNEIName) {
+ public GT_MetaTileEntity_BasicMachine(String aName, int aTier, int aAmperage, String[] aDescription,
+ 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)];
@@ -253,12 +210,10 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
ITexture[][][] rTextures = new ITexture[14][17][];
aTextures = Arrays.copyOf(aTextures, 14);
- for (int i = 0; i < aTextures.length; i++)
- if (aTextures[i] != null)
- for (byte c = -1; c < 16; c++) {
- if (rTextures[i][c + 1] == null)
- rTextures[i][c + 1] = new ITexture[] {MACHINE_CASINGS[mTier][c + 1], aTextures[i]};
- }
+ for (int i = 0; i < aTextures.length; i++) if (aTextures[i] != null) for (byte c = -1; c < 16; c++) {
+ if (rTextures[i][c + 1] == null)
+ rTextures[i][c + 1] = new ITexture[] { MACHINE_CASINGS[mTier][c + 1], aTextures[i] };
+ }
for (byte c = -1; c < 16; c++) {
if (rTextures[0][c + 1] == null) rTextures[0][c + 1] = getSideFacingActive(c);
@@ -280,28 +235,16 @@ 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) {
- return mTextures[
- mMainFacing < 2
- ? aSide == aFacing
- ? aActive ? 2 : 3
- : aSide == 0 ? aActive ? 6 : 7 : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1
- : aSide == mMainFacing
- ? aActive ? 2 : 3
- : (showPipeFacing() && aSide == aFacing)
- ? aSide == 0
- ? aActive ? 8 : 9
- : aSide == 1 ? aActive ? 10 : 11 : aActive ? 12 : 13
- : aSide == 0
- ? aActive ? 6 : 7
- : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1][
- aColorIndex + 1];
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ boolean aActive, boolean aRedstone) {
+ return mTextures[mMainFacing < 2
+ ? aSide == aFacing ? aActive ? 2 : 3
+ : aSide == 0 ? aActive ? 6 : 7 : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1
+ : aSide == mMainFacing ? aActive ? 2 : 3
+ : (showPipeFacing() && aSide == aFacing)
+ ? aSide == 0 ? aActive ? 8 : 9 : aSide == 1 ? aActive ? 10 : 11 : aActive ? 12 : 13
+ : aSide == 0 ? aActive ? 6 : 7
+ : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1][aColorIndex + 1];
}
@Override
@@ -326,8 +269,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
@Override
public boolean isValidSlot(int aIndex) {
- return aIndex > 0
- && super.isValidSlot(aIndex)
+ return aIndex > 0 && super.isValidSlot(aIndex)
&& aIndex != getCircuitSlot()
&& aIndex != OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length;
}
@@ -359,9 +301,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
@Override
public boolean isLiquidInput(byte aSide) {
- return aSide != mMainFacing
- && (mAllowInputFromOutputSide
- || aSide != getBaseMetaTileEntity().getFrontFacing());
+ return aSide != mMainFacing && (mAllowInputFromOutputSide || aSide != getBaseMetaTileEntity().getFrontFacing());
}
@Override
@@ -456,8 +396,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
@Override
public boolean isFluidInputAllowed(FluidStack aFluid) {
- return getFillableStack() != null
- || (getRecipeList() != null && getRecipeList().containsInput(aFluid));
+ return getFillableStack() != null || (getRecipeList() != null && getRecipeList().containsInput(aFluid));
}
@Override
@@ -556,8 +495,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
aBaseMetaTileEntity,
getLocalName(),
mGUIName,
- GT_Utility.isStringValid(mNEIName)
- ? mNEIName
+ GT_Utility.isStringValid(mNEIName) ? mNEIName
: getRecipeList() != null ? getRecipeList().mUnlocalizedName : "");
}
@@ -565,8 +503,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
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();
@@ -631,9 +569,9 @@ 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])) break;
+ 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());
else if (mOutputFluid.isFluidEqual(getDrainableStack()))
@@ -666,8 +604,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
boolean tRemovedOutputFluid = false;
- if (doesAutoOutputFluids()
- && getDrainableStack() != null
+ if (doesAutoOutputFluids() && getDrainableStack() != null
&& aBaseMetaTileEntity.getFrontFacing() != mMainFacing
&& (tSucceeded || aTick % 20 == 0)) {
IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide(aBaseMetaTileEntity.getFrontFacing());
@@ -675,22 +612,21 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
FluidStack tDrained = drain(1000, false);
if (tDrained != null) {
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()),
+ tDrained,
+ false);
+ if (tFilledAmount > 0) tTank.fill(
+ ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()),
+ drain(tFilledAmount, true),
+ true);
}
}
if (getDrainableStack() == null) tRemovedOutputFluid = true;
}
- if (doesAutoOutput()
- && !isOutputEmpty()
+ if (doesAutoOutput() && !isOutputEmpty()
&& aBaseMetaTileEntity.getFrontFacing() != mMainFacing
- && (tSucceeded
- || mOutputBlocked % 300 == 1
+ && (tSucceeded || mOutputBlocked % 300 == 1
|| aBaseMetaTileEntity.hasInventoryBeenModified()
|| aTick % 600 == 0)) {
TileEntity tTileEntity2 = aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getFrontFacing());
@@ -710,24 +646,21 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
(byte) 64,
(byte) 1,
tMaxStacks);
- // for (int i = 0, tCosts = 1; i < mOutputItems.length && tCosts > 0 &&
+ // for (int i = 0, tCosts = 1; i < mOutputItems.length && tCosts > 0 &&
// aBaseMetaTileEntity.isUniversalEnergyStored(128); i++) {
- // tCosts = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, tTileEntity2,
+ // tCosts = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, tTileEntity2,
// aBaseMetaTileEntity.getFrontFacing(), aBaseMetaTileEntity.getBackFacing(), null, false, (byte) 64,
// (byte) 1, (byte) 64, (byte) 1);
- // if (tCosts > 0) aBaseMetaTileEntity.decreaseStoredEnergyUnits(tCosts, true);
- // }
+ // if (tCosts > 0) aBaseMetaTileEntity.decreaseStoredEnergyUnits(tCosts, true);
+ // }
}
- if (mOutputBlocked != 0)
- if (isOutputEmpty()) mOutputBlocked = 0;
- else mOutputBlocked++;
+ if (mOutputBlocked != 0) if (isOutputEmpty()) mOutputBlocked = 0;
+ else mOutputBlocked++;
if (allowToCheckRecipe()) {
- if (mMaxProgresstime <= 0
- && aBaseMetaTileEntity.isAllowedToWork()
- && (tRemovedOutputFluid
- || tSucceeded
+ if (mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork()
+ && (tRemovedOutputFluid || tSucceeded
|| aBaseMetaTileEntity.hasInventoryBeenModified()
|| aTick % 600 == 0
|| aBaseMetaTileEntity.hasWorkJustBeenEnabled())
@@ -764,11 +697,11 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
}
// Only using mNeedsSteamVenting right now and assigning it to 64 to space in the range for more single block
// machine problems.
- // Value | Class | Field
- // 1 | GT_MetaTileEntity_BasicMachine | mStuttering
- // 64 | GT_MetaTileEntity_BasicMachine_Bronze | mNeedsSteamVenting
- aBaseMetaTileEntity.setErrorDisplayID(
- (aBaseMetaTileEntity.getErrorDisplayID() & ~127)); // | (mStuttering ? 1 : 0));
+ // Value | Class | Field
+ // 1 | GT_MetaTileEntity_BasicMachine | mStuttering
+ // 64 | GT_MetaTileEntity_BasicMachine_Bronze | mNeedsSteamVenting
+ aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127)); // | (mStuttering ? 1 :
+ // 0));
}
protected void doDisplayThings() {
@@ -798,8 +731,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());
}
}
}
@@ -818,8 +751,9 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
/**
* Calcualtes overclocked ness using long integers
- * @param aEUt - recipe EUt
- * @param aDuration - recipe Duration
+ *
+ * @param aEUt - recipe EUt
+ * @param aDuration - recipe Duration
*/
protected void calculateOverclockedNess(int aEUt, int aDuration) {
mPower.computePowerUsageAndDuration(aEUt, aDuration);
@@ -842,32 +776,27 @@ 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));
+ return aRecipe != null && (aRecipe.mNeedsEmptyOutput ? isOutputEmpty() && getDrainableStack() == null
+ : canOutput(aRecipe.getFluidOutput(0)) && canOutput(aRecipe.mOutputs));
}
protected boolean canOutput(ItemStack... aOutputs) {
if (aOutputs == null) return true;
ItemStack[] tOutputSlots = getAllOutputs();
for (int i = 0; i < tOutputSlots.length && i < aOutputs.length; i++)
- if (tOutputSlots[i] != null
- && aOutputs[i] != null
+ 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;
- }
+ mOutputBlocked++;
+ return false;
+ }
return true;
}
protected boolean canOutput(FluidStack aOutput) {
- return getDrainableStack() == null
- || aOutput == null
- || (getDrainableStack().isFluidEqual(aOutput)
- && (getDrainableStack().amount <= 0
- || getDrainableStack().amount + aOutput.amount <= getCapacity()));
+ return getDrainableStack() == null || aOutput == null
+ || (getDrainableStack().isFluidEqual(aOutput) && (getDrainableStack().amount <= 0
+ || getDrainableStack().amount + aOutput.amount <= getCapacity()));
}
protected ItemStack getInputAt(int aIndex) {
@@ -884,11 +813,10 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
protected boolean isOutputEmpty() {
boolean rIsEmpty = true;
- for (ItemStack tOutputSlotContent : getAllOutputs())
- if (tOutputSlotContent != null) {
- rIsEmpty = false;
- break;
- }
+ for (ItemStack tOutputSlotContent : getAllOutputs()) if (tOutputSlotContent != null) {
+ rIsEmpty = false;
+ break;
+ }
return rIsEmpty;
}
@@ -973,22 +901,30 @@ 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"
- };
+ 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" };
}
@Override
@@ -1002,28 +938,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")
+ 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) {
+ public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
+ 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;
}
@@ -1045,10 +982,10 @@ 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()
+ if (aSide == mMainFacing || aIndex < getInputSlot()
|| aIndex >= getInputSlot() + mInputSlotCount
- || (!mAllowInputFromOutputSide && aSide == aBaseMetaTileEntity.getFrontFacing())) return false;
+ || (!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;
@@ -1056,12 +993,12 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
}
/**
- * Test if given stack can be inserted into specified slot.
- * If mDisableMultiStack is false, before execution of this method it is ensured there is no such kind of item inside any input slots already.
- * Otherwise, you don't need to check for it anyway.
+ * Test if given stack can be inserted into specified slot. If mDisableMultiStack is false, before execution of this
+ * method it is ensured there is no such kind of item inside any input slots already. Otherwise, you don't need to
+ * check for it anyway.
*/
- protected boolean allowPutStackValidated(
- IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide,
+ ItemStack aStack) {
return !mDisableMultiStack || mInventory[aIndex] == null;
}
@@ -1105,7 +1042,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
}
/**
- * Override this to check the Recipes yourself, super calls to this could be useful if you just want to add a special case
+ * Override this to check the Recipes yourself, super calls to this could be useful if you just want to add a
+ * special case
* <p/>
* I thought about Enum too, but Enum doesn't add support for people adding other return Systems.
* <p/>
@@ -1129,8 +1067,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
/**
*
* @param skipOC disables OverclockedNess calculation and check - if you do you must implement your own method...
- * @return DID_NOT_FIND_RECIPE = 0,
- * FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1,
+ * @return DID_NOT_FIND_RECIPE = 0, FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1,
* FOUND_AND_SUCCESSFULLY_USED_RECIPE = 2;
*/
public int checkRecipe(boolean skipOC) {
@@ -1141,13 +1078,12 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
mLastRecipe,
false,
V[mTier],
- new FluidStack[] {getFillableStack()},
+ new FluidStack[] { getFillableStack() },
getSpecialSlot(),
getAllInputs());
if (tRecipe == null) return DID_NOT_FIND_RECIPE;
- if (GT_Mod.gregtechproxy.mLowGravProcessing
- && (tRecipe.mSpecialValue == -100 || tRecipe.mSpecialValue == -300)
+ if (GT_Mod.gregtechproxy.mLowGravProcessing && (tRecipe.mSpecialValue == -100 || tRecipe.mSpecialValue == -300)
&& !isValidForLowGravity(tRecipe, getBaseMetaTileEntity().getWorld().provider.dimensionId))
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe;
@@ -1156,26 +1092,25 @@ 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)
+ && (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()))
+ if (!tRecipe.isRecipeInputEqual(true, new FluidStack[] { getFillableStack() }, getAllInputs()))
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
for (int i = 0; i < mOutputItems.length; i++)
if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(i))
mOutputItems[i] = tRecipe.getOutput(i);
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;
- }
+ 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;
+ }
mOutputFluid = tRecipe.getFluidOutput(0);
if (!skipOC) {
calculateOverclockedNess(tRecipe);
@@ -1187,64 +1122,64 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
}
public ITexture[] getSideFacingActive(byte aColor) {
- return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] { MACHINE_CASINGS[mTier][aColor + 1] };
}
public ITexture[] getSideFacingInactive(byte aColor) {
- return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] { MACHINE_CASINGS[mTier][aColor + 1] };
}
public ITexture[] getFrontFacingActive(byte aColor) {
- return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] { MACHINE_CASINGS[mTier][aColor + 1] };
}
public ITexture[] getFrontFacingInactive(byte aColor) {
- return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] { MACHINE_CASINGS[mTier][aColor + 1] };
}
public ITexture[] getTopFacingActive(byte aColor) {
- return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] { MACHINE_CASINGS[mTier][aColor + 1] };
}
public ITexture[] getTopFacingInactive(byte aColor) {
- return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] { MACHINE_CASINGS[mTier][aColor + 1] };
}
public ITexture[] getBottomFacingActive(byte aColor) {
- return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] { MACHINE_CASINGS[mTier][aColor + 1] };
}
public ITexture[] getBottomFacingInactive(byte aColor) {
- return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] { MACHINE_CASINGS[mTier][aColor + 1] };
}
public ITexture[] getBottomFacingPipeActive(byte aColor) {
- return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
+ return new ITexture[] { MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT) };
}
public ITexture[] getBottomFacingPipeInactive(byte aColor) {
- return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
+ return new ITexture[] { MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT) };
}
public ITexture[] getTopFacingPipeActive(byte aColor) {
- return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
+ return new ITexture[] { MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT) };
}
public ITexture[] getTopFacingPipeInactive(byte aColor) {
- return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
+ return new ITexture[] { MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT) };
}
public ITexture[] getSideFacingPipeActive(byte aColor) {
- return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
+ return new ITexture[] { MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT) };
}
public ITexture[] getSideFacingPipeInactive(byte aColor) {
- return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
+ return new ITexture[] { MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT) };
}
@Override
- public void getWailaBody(
- ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
+ public void getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
+ IWailaConfigHandler config) {
final NBTTagCompound tag = accessor.getNBTData();
if (tag.getBoolean("stutteringSingleBlock")) {
@@ -1254,35 +1189,40 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
if (isActive) {
int mEUt = tag.getInteger("eut");
if (mEUt > 0) {
- currenttip.add(StatCollector.translateToLocalFormatted(
- "GT5U.waila.energy.use",
- GT_Utility.formatNumbers(mEUt),
- GT_Utility.getColoredTierNameFromVoltage(mEUt)));
+ currenttip.add(
+ 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)));
+ currenttip.add(
+ 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")));
+ currenttip.add(
+ GT_Waila.getMachineProgressString(
+ isActive,
+ tag.getInteger("maxProgressSingleBlock"),
+ tag.getInteger("progressSingleBlock")));
}
- currenttip.add(String.format(
- "Machine Facing: %s",
- ForgeDirection.getOrientation(tag.getInteger("mainFacingSingleBlock"))
- .name()));
+ currenttip.add(
+ String.format(
+ "Machine Facing: %s",
+ ForgeDirection.getOrientation(tag.getInteger("mainFacingSingleBlock")).name()));
- currenttip.add(String.format(
- "Output Facing: %s",
- ForgeDirection.getOrientation(tag.getInteger("outputFacingSingleBlock"))
- .name()));
+ currenttip.add(
+ 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) {
+ public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y,
+ int z) {
super.getWailaNBTData(player, tile, tag, world, x, y, z);
tag.setInteger("progressSingleBlock", mProgresstime);
@@ -1324,10 +1264,9 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
if (getRecipeList() != null) {
getRecipeList().addGregTechLogoUI(builder, new Pos2d(0, 0));
} else {
- builder.widget(new DrawableWidget()
- .setDrawable(getGUITextureSet().getGregTechLogo())
- .setSize(17, 17)
- .setPos(152, 63));
+ builder.widget(
+ new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()).setSize(17, 17)
+ .setPos(152, 63));
}
}
@@ -1342,31 +1281,32 @@ 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));
+ builder.widget(
+ 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));
+ builder.widget(
+ createErrorStatusArea(
+ builder,
+ isSteampowered() ? GT_UITextures.PICTURE_STALLED_STEAM
+ : GT_UITextures.PICTURE_STALLED_ELECTRICITY));
}
/**
* Adds item I/O, special item, and fluid I/O slots.
*/
protected void addIOSlots(ModularWindow.Builder builder) {
- final boolean hasFluidInput =
- getRecipeList() != null ? (getRecipeList().hasFluidInputs()) : (getCapacity() != 0);
- final boolean hasFluidOutput =
- getRecipeList() != null && getRecipeList().hasFluidOutputs();
+ final boolean hasFluidInput = getRecipeList() != null ? (getRecipeList().hasFluidInputs())
+ : (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)),
@@ -1388,59 +1328,48 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
* Override this as needed instead of calling.
*/
protected SlotWidget createItemInputSlot(int index, IDrawable[] backgrounds, Pos2d pos) {
- return (SlotWidget) new SlotWidget(inventoryHandler, getInputSlot() + index)
- .setAccess(true, true)
- .setBackground(backgrounds)
- .setPos(pos);
+ return (SlotWidget) new SlotWidget(inventoryHandler, getInputSlot() + index).setAccess(true, true)
+ .setBackground(backgrounds).setPos(pos);
}
/**
* Override this as needed instead of calling.
*/
protected SlotWidget createItemOutputSlot(int index, IDrawable[] backgrounds, Pos2d pos) {
- return (SlotWidget) new SlotWidget(inventoryHandler, getOutputSlot() + index)
- .setAccess(true, false)
- .setBackground(backgrounds)
- .setPos(pos);
+ return (SlotWidget) new SlotWidget(inventoryHandler, getOutputSlot() + index).setAccess(true, false)
+ .setBackground(backgrounds).setPos(pos);
}
/**
* Override this as needed instead of calling.
*/
protected SlotWidget createSpecialSlot(IDrawable[] backgrounds, Pos2d pos) {
- return (SlotWidget) new SlotWidget(inventoryHandler, getSpecialSlotIndex())
- .setAccess(true, true)
+ 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);
+ .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) {
@@ -1448,9 +1377,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
.setUpdateFluidDisplayItem(this::updateFluidOutputDisplayItem)
.setGTTooltip(
() -> mTooltipCache.getData(FLUID_OUTPUT_TOOLTIP, GT_Utility.formatNumbers(getCapacity())))
- .setTooltipShowUpDelay(TOOLTIP_DELAY)
- .setBackground(backgrounds)
- .setPos(pos);
+ .setTooltipShowUpDelay(TOOLTIP_DELAY).setBackground(backgrounds).setPos(pos);
}
@Override
@@ -1464,35 +1391,26 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
}
protected CycleButtonWidget createItemAutoOutputButton() {
- return (CycleButtonWidget) new CycleButtonWidget()
- .setToggle(() -> mItemTransfer, val -> mItemTransfer = val)
+ 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);
+ .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)
+ 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);
+ .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) {
+ protected ProgressBar createProgressBar(UITexture texture, int imageSize, ProgressBar.Direction direction,
+ 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;
}
@@ -1505,13 +1423,13 @@ 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);
+ widget.setNEITransferRect(transferRectID, new Object[] { powerInfo }, transferRectTooltip);
}
return widget;
}
@@ -1519,30 +1437,25 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
protected void addProgressBarSpecialTextures(ModularWindow.Builder builder) {
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()));
+ builder.widget(
+ 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()));
+ builder.widget(
+ 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)
+ 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,
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 468566e582..9bccd8f093 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
@@ -4,8 +4,16 @@ import static gregtech.api.enums.GT_Values.D1;
import static gregtech.api.enums.Textures.BlockIcons.*;
import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
+import java.util.ArrayList;
+
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraftforge.common.util.ForgeDirection;
+
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.Dyes;
import gregtech.api.enums.ParticleFX;
@@ -22,30 +30,20 @@ import gregtech.api.util.GT_Utility;
import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder;
import gregtech.common.power.Power;
import gregtech.common.power.SteamPower;
-import java.util.ArrayList;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.AxisAlignedBB;
-import net.minecraftforge.common.util.ForgeDirection;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
* <p/>
- * This is the main construct for my Basic Machines such as the Automatic Extractor
- * Extend this class to make a simple Machine
+ * This is the main construct for my Basic Machines such as the Automatic Extractor Extend this class to make a simple
+ * Machine
*/
public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileEntity_BasicMachine {
+
private static final int NEEDS_STEAM_VENTING = 64;
public boolean mNeedsSteamVenting = false;
- public GT_MetaTileEntity_BasicMachine_Bronze(
- int aID,
- String aName,
- String aNameRegional,
- String aDescription,
- int aInputSlotCount,
- int aOutputSlotCount,
- boolean aHighPressure) {
+ public GT_MetaTileEntity_BasicMachine_Bronze(int aID, String aName, String aNameRegional, String aDescription,
+ int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) {
super(
aID,
aName,
@@ -59,23 +57,13 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE
"");
}
- public GT_MetaTileEntity_BasicMachine_Bronze(
- String aName,
- String aDescription,
- ITexture[][][] aTextures,
- int aInputSlotCount,
- int aOutputSlotCount,
- boolean aHighPressure) {
+ public GT_MetaTileEntity_BasicMachine_Bronze(String aName, String aDescription, ITexture[][][] aTextures,
+ 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) {
+ public GT_MetaTileEntity_BasicMachine_Bronze(String aName, String[] aDescription, ITexture[][][] aTextures,
+ int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) {
super(aName, aHighPressure ? 2 : 1, 0, aDescription, aTextures, aInputSlotCount, aOutputSlotCount, "", "");
}
@@ -173,51 +161,27 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE
@Override
public boolean allowToCheckRecipe() {
if (mNeedsSteamVenting
- && getBaseMetaTileEntity()
- .getCoverIDAtSide(getBaseMetaTileEntity().getFrontFacing())
- == 0
+ && 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().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 1),
+ getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 1),
+ getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 1))) {
sendSound((byte) 9);
mNeedsSteamVenting = false;
try {
- for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) getBaseMetaTileEntity()
- .getWorld()
+ for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) 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)
+ 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)
+ getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 1)
+ 1,
- getBaseMetaTileEntity()
- .getOffsetZ(
- getBaseMetaTileEntity()
- .getFrontFacing(),
- 1)
+ getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 1)
+ 1))) {
GT_Utility.applyHeatDamage(tLiving, getSteamDamage());
}
@@ -230,11 +194,13 @@ 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());
- if ((tRecipe != null)
- && (canOutput(tRecipe.mOutputs))
+ 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()))) {
this.mOutputItems[0] = tRecipe.getOutput(0);
calculateOverclockedNess(tRecipe);
@@ -261,27 +227,17 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE
if (aIndex == 9) {
GT_Utility.doSoundAtClient(SoundResource.RANDOM_FIZZ, 5, 1.0F, aX, aY, aZ);
- new ParticleEventBuilder()
- .setIdentifier(ParticleFX.CLOUD)
- .setWorld(getBaseMetaTileEntity().getWorld())
+ 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(
+ 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());
+ aZ - 0.5 + XSTR_INSTANCE.nextFloat()).run());
}
}
@@ -302,134 +258,100 @@ 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))
- };
+ return new ITexture[] { TextureFactory.of(
+ 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))
- };
+ return new ITexture[] { TextureFactory.of(
+ 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))
- };
+ return new ITexture[] { TextureFactory.of(
+ 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))
- };
+ return new ITexture[] { TextureFactory.of(
+ 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))
- };
+ return new ITexture[] { TextureFactory.of(
+ 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))
- };
+ return new ITexture[] { TextureFactory.of(
+ 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))
- };
+ return new ITexture[] { TextureFactory.of(
+ 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))
- };
+ return new ITexture[] { TextureFactory.of(
+ 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)
- };
+ return new ITexture[] { TextureFactory.of(
+ 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)
- };
+ return new ITexture[] { TextureFactory.of(
+ 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)
- };
+ return new ITexture[] { TextureFactory.of(
+ 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)
- };
+ return new ITexture[] { TextureFactory.of(
+ 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)
- };
+ return new ITexture[] { TextureFactory.of(
+ 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)
- };
+ return new ITexture[] { TextureFactory.of(
+ isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) };
}
@Override
@@ -444,9 +366,7 @@ 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));
+ builder.widget(
+ new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()).setSize(17, 17).setPos(152, 63));
}
}
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 75b055324a..7976ea94c6 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
@@ -6,11 +6,23 @@ import static gregtech.api.enums.GT_Values.W;
import static gregtech.api.enums.GT_Values.ticksBetweenSounds;
import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
+import java.util.Locale;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.ResourceLocation;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.oredict.OreDictionary;
+
import com.gtnewhorizons.modularui.api.drawable.FallbackableUITexture;
import com.gtnewhorizons.modularui.api.drawable.UITexture;
import com.gtnewhorizons.modularui.api.math.Pos2d;
import com.gtnewhorizons.modularui.api.math.Size;
import com.gtnewhorizons.modularui.common.widget.ProgressBar;
+
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -31,23 +43,15 @@ import gregtech.api.util.GT_Utility;
import gregtech.api.util.WorldSpawnedEventBuilder;
import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder;
import ic2.core.Ic2Items;
-import java.util.Locale;
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.ResourceLocation;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.oredict.OreDictionary;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
* <p/>
- * This is the main construct for my Basic Machines such as the Automatic Extractor
- * Extend this class to make a simple Machine
+ * This is the main construct for my Basic Machines such as the Automatic Extractor Extend this class to make a simple
+ * Machine
*/
public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_BasicMachine {
+
private final GT_Recipe.GT_Recipe_Map mRecipes;
private final int mTankCapacity;
private final SpecialEffects mSpecialEffect;
@@ -56,25 +60,10 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
private final byte mGUIParameterA, mGUIParameterB;
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) {
+ 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) {
super(
aID,
aName,
@@ -87,69 +76,89 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
aGUIName,
aRecipes.mNEIName,
TextureFactory.of(
- TextureFactory.of(new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE_ACTIVE")),
+ 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()),
+ .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.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()),
+ .addIcon(
+ (new CustomIcon(
+ "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
+ + "/OVERLAY_SIDE_GLOW")))
+ .glow().build()),
TextureFactory.of(
- TextureFactory.of(new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT_ACTIVE")),
+ 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()),
+ .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.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()),
+ .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.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()),
+ .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.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()),
+ .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.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()),
+ .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.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()));
+ .addIcon(
+ (new CustomIcon(
+ "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
+ + "/OVERLAY_BOTTOM_GLOW")))
+ .glow().build()));
this.mSharedTank = aSharedTank;
this.mTankCapacity = aTankCapacity;
this.mSpecialEffect = aSpecialEffect;
@@ -891,36 +900,19 @@ 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.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());
+ 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) {
+ 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) {
this(
aID,
aName,
@@ -944,31 +936,15 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
/**
* @inheritDoc
- * @deprecated Use {@link #GT_MetaTileEntity_BasicMachine_GT_Recipe(
- * int aID, String, String, int, String, GT_Recipe.GT_Recipe_Map,
- * int, int, int, int, int, String, ResourceLocation, boolean,
- * boolean, SpecialEffects, String , Object[])}
+ * @deprecated Use {@link #GT_MetaTileEntity_BasicMachine_GT_Recipe( int aID, String, String, int, String,
+ * GT_Recipe.GT_Recipe_Map, int, int, int, int, int, String, ResourceLocation, boolean, boolean,
+ * SpecialEffects, String , Object[])}
*/
@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) {
+ 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) {
this(
aID,
aName,
@@ -990,24 +966,10 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
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) {
+ 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) {
super(aName, aTier, aAmperage, aDescription, aTextures, aInputSlots, aOutputSlots, aGUIName, aNEIName);
this.mSharedTank = aSharedTank;
this.mTankCapacity = aTankCapacity;
@@ -1019,24 +981,10 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
this.mGUIParameterB = (byte) aGUIParameterB;
}
- 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) {
+ 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) {
super(aName, aTier, aAmperage, aDescription, aTextures, aInputSlots, aOutputSlots, aGUIName, aNEIName);
this.mSharedTank = aSharedTank;
this.mTankCapacity = aTankCapacity;
@@ -1051,24 +999,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) {
@@ -1097,67 +1044,61 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
aBaseMetaTileEntity,
this.getLocalName(),
this.mGUIName,
- GT_Utility.isStringValid(this.mNEIName)
- ? this.mNEIName
+ 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) {
+ protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide,
+ ItemStack aStack) {
if (!super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack)) return false;
switch (this.mInputSlotCount) {
case 0:
return false;
case 1:
if (this.getFillableStack() == null)
- return !this.mRequiresFluidForFiltering
- && this.getRecipeList().containsInput(aStack);
- else
- return this.getRecipeList()
- .findRecipe(
- this.getBaseMetaTileEntity(),
- this.mLastRecipe,
- true,
- true,
- V[this.mTier],
- new FluidStack[] {this.getFillableStack()},
- this.getSpecialSlot(),
- appendSelectedCircuit(aStack))
- != null;
+ return !this.mRequiresFluidForFiltering && this.getRecipeList().containsInput(aStack);
+ else return this.getRecipeList().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,
- true,
- V[this.mTier],
- new FluidStack[] {this.getFillableStack()},
- this.getSpecialSlot(),
- aIndex == this.getInputSlot()
- ? appendSelectedCircuit(
- aStack, this.getInputAt(1))
- : appendSelectedCircuit(
- this.getInputAt(0), aStack))
- != null))));
+ 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))));
default: {
int tID = this.getBaseMetaTileEntity().getMetaTileID();
- if (tID >= 211 && tID <= 218
- || tID >= 1180 && tID <= 1187
- || tID >= 10780
- && tID <= 10786) { // assembler lv-iv; circuit asseblers lv - uv; assemblers luv-uev
- if (GT_Utility.isStackValid(aStack))
- for (int oreID : OreDictionary.getOreIDs(aStack)) {
- if (OreDictionary.getOreName(oreID).startsWith("circuit")) return true;
- }
+ if (tID >= 211 && tID <= 218 || tID >= 1180 && tID <= 1187 || tID >= 10780 && tID <= 10786) { // assembler
+ // lv-iv;
+ // circuit
+ // asseblers
+ // lv -
+ // uv;
+ // assemblers
+ // luv-uev
+ if (GT_Utility.isStackValid(aStack)) for (int oreID : OreDictionary.getOreIDs(aStack)) {
+ if (OreDictionary.getOreName(oreID).startsWith("circuit")) return true;
+ }
}
return this.getRecipeList().containsInput(aStack);
}
@@ -1173,7 +1114,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
super.onPreTick(aBaseMetaTileEntity, aTick);
if (aBaseMetaTileEntity.isClientSide() && aBaseMetaTileEntity.isActive()) {
- //noinspection SwitchStatementWithTooFewBranches
+ // noinspection SwitchStatementWithTooFewBranches
switch (this.mSpecialEffect) {
case TOP_SMOKE:
final byte topFacing = (byte) ForgeDirection.UP.ordinal();
@@ -1182,15 +1123,13 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
&& aBaseMetaTileEntity.getCoverIDAtSide(topFacing) == 0
&& !aBaseMetaTileEntity.getOpacityAtSide(topFacing)) {
- new WorldSpawnedEventBuilder.ParticleEventBuilder()
- .setMotion(0.0D, 0.0D, 0.0D)
+ new WorldSpawnedEventBuilder.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();
+ .setWorld(aBaseMetaTileEntity.getWorld()).run();
}
break;
default:
@@ -1208,7 +1147,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
@Override
public void onRandomDisplayTick(IGregTechTileEntity aBaseMetaTileEntity) {
- //noinspection SwitchStatementWithTooFewBranches
+ // noinspection SwitchStatementWithTooFewBranches
switch (this.mSpecialEffect) {
case MAIN_RANDOM_SPARKS:
// Random Sparkles at main face
@@ -1216,8 +1155,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
final byte mainFacing = (byte) this.mMainFacing;
- if (mainFacing > 1
- && aBaseMetaTileEntity.getCoverIDAtSide(mainFacing) == 0
+ if (mainFacing > 1 && aBaseMetaTileEntity.getCoverIDAtSide(mainFacing) == 0
&& !aBaseMetaTileEntity.getOpacityAtSide(mainFacing)) {
final double oX = aBaseMetaTileEntity.getXCoord();
@@ -1253,10 +1191,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
mZ = .05D;
}
- ParticleEventBuilder particleEventBuilder = (new ParticleEventBuilder())
- .setMotion(mX, 0, mZ)
- .setPosition(x, y, z)
- .setWorld(getBaseMetaTileEntity().getWorld());
+ ParticleEventBuilder particleEventBuilder = (new ParticleEventBuilder()).setMotion(mX, 0, mZ)
+ .setPosition(x, y, z).setWorld(getBaseMetaTileEntity().getWorld());
particleEventBuilder.setIdentifier(ParticleFX.LAVA).run();
}
}
@@ -1279,8 +1215,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
@Override
public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1
- && this.mSoundResourceLocation != null
+ if (aIndex == 1 && this.mSoundResourceLocation != null
&& GT_Utility.isStringValid(this.mSoundResourceLocation.getResourceDomain())
&& GT_Utility.isStringValid(this.mSoundResourceLocation.getResourcePath()))
GT_Utility.doSoundAtClient(this.mSoundResourceLocation, 100, 1.0F, aX, aY, aZ);
@@ -1316,8 +1251,8 @@ 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) {
+ 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());
}
@@ -1352,11 +1287,12 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
* Special Effects
*/
public enum SpecialEffects {
+
NONE,
TOP_SMOKE,
MAIN_RANDOM_SPARKS;
- static final SpecialEffects[] VALID_SPECIAL_EFFECTS = {NONE, TOP_SMOKE, MAIN_RANDOM_SPARKS};
+ static final SpecialEffects[] VALID_SPECIAL_EFFECTS = { NONE, TOP_SMOKE, MAIN_RANDOM_SPARKS };
static SpecialEffects fromId(int id) {
return id >= 0 && id < VALID_SPECIAL_EFFECTS.length ? VALID_SPECIAL_EFFECTS[id] : NONE;
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 592d27f74f..3488ab25c1 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
@@ -19,39 +19,24 @@ import gregtech.common.power.SteamPower;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
* <p/>
- * This is the main construct for my Basic Machines such as the Automatic Extractor
- * Extend this class to make a simple Machine
+ * This is the main construct for my Basic Machines such as the Automatic Extractor Extend this class to make a simple
+ * Machine
*/
public abstract class GT_MetaTileEntity_BasicMachine_Steel extends GT_MetaTileEntity_BasicMachine_Bronze
implements IGetTitleColor {
- public GT_MetaTileEntity_BasicMachine_Steel(
- int aID,
- String aName,
- String aNameRegional,
- String aDescription,
- int aInputSlotCount,
- int aOutputSlotCount,
- boolean aHighPressure) {
+
+ public GT_MetaTileEntity_BasicMachine_Steel(int aID, String aName, String aNameRegional, String aDescription,
+ 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) {
+ public GT_MetaTileEntity_BasicMachine_Steel(String aName, String aDescription, ITexture[][][] aTextures,
+ 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) {
+ public GT_MetaTileEntity_BasicMachine_Steel(String aName, String[] aDescription, ITexture[][][] aTextures,
+ int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) {
super(aName, aDescription, aTextures, aInputSlotCount, aOutputSlotCount, aHighPressure);
}
@@ -62,134 +47,100 @@ 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))
- };
+ return new ITexture[] { TextureFactory.of(
+ 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))
- };
+ return new ITexture[] { TextureFactory.of(
+ 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))
- };
+ return new ITexture[] { TextureFactory.of(
+ 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))
- };
+ return new ITexture[] { TextureFactory.of(
+ 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))
- };
+ return new ITexture[] { TextureFactory.of(
+ 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))
- };
+ return new ITexture[] { TextureFactory.of(
+ 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))
- };
+ return new ITexture[] { TextureFactory.of(
+ 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))
- };
+ return new ITexture[] { TextureFactory.of(
+ 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)
- };
+ return new ITexture[] { TextureFactory.of(
+ 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)
- };
+ return new ITexture[] { TextureFactory.of(
+ 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)
- };
+ return new ITexture[] { TextureFactory.of(
+ 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)
- };
+ return new ITexture[] { TextureFactory.of(
+ 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)
- };
+ return new ITexture[] { TextureFactory.of(
+ 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)
- };
+ return new ITexture[] { TextureFactory.of(
+ 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 0207178559..1286c84c9b 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
@@ -1,11 +1,19 @@
package gregtech.api.metatileentity.implementations;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.FluidTankInfo;
+
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
import com.gtnewhorizons.modularui.common.internal.network.NetworkUtils;
import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
import com.gtnewhorizons.modularui.common.widget.SlotWidget;
import com.gtnewhorizons.modularui.common.widget.TextWidget;
+
import gregtech.api.enums.ItemList;
import gregtech.api.gui.GT_Container_BasicTank;
import gregtech.api.gui.GT_GUIContainer_BasicTank;
@@ -17,12 +25,6 @@ import gregtech.api.interfaces.modularui.IAddUIWidgets;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Utility;
import gregtech.common.gui.modularui.widget.FluidDisplaySlotWidget;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.FluidTankInfo;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
@@ -38,35 +40,23 @@ 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) {
+ public GT_MetaTileEntity_BasicTank(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount,
+ 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) {
+ public GT_MetaTileEntity_BasicTank(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount,
+ 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) {
+ public GT_MetaTileEntity_BasicTank(String aName, int aTier, int aInvSlotCount, String aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
- public GT_MetaTileEntity_BasicTank(
- String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_BasicTank(String aName, int aTier, int aInvSlotCount, String[] aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
@@ -135,7 +125,8 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier
}
/**
- * If you override this and change the field returned, be sure to override {@link #isDrainableStackSeparate()} as well!
+ * If you override this and change the field returned, be sure to override {@link #isDrainableStackSeparate()} as
+ * well!
*/
public FluidStack getDrainableStack() {
return mFluid;
@@ -217,8 +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);
@@ -236,8 +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());
}
}
}
@@ -254,11 +245,11 @@ 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
+ if (aFluid == null || aFluid.getFluid().getID() <= 0
|| aFluid.amount <= 0
|| !canTankBeFilled()
- || !isFluidInputAllowed(aFluid)) return 0;
+ || !isFluidInputAllowed(aFluid))
+ return 0;
if (getFillableStack() == null || getFillableStack().getFluid().getID() <= 0) {
if (aFluid.amount <= getCapacity()) {
@@ -322,12 +313,10 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier
public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
if (getCapacity() <= 0 && !getBaseMetaTileEntity().hasSteamEngineUpgrade()) return new FluidTankInfo[] {};
if (isDrainableStackSeparate()) {
- return new FluidTankInfo[] {
- new FluidTankInfo(getFillableStack(), getCapacity()),
- new FluidTankInfo(getDrainableStack(), getCapacity())
- };
+ return new FluidTankInfo[] { new FluidTankInfo(getFillableStack(), getCapacity()),
+ new FluidTankInfo(getDrainableStack(), getCapacity()) };
} else {
- return new FluidTankInfo[] {new FluidTankInfo(this)};
+ return new FluidTankInfo[] { new FluidTankInfo(this) };
}
}
@@ -347,44 +336,32 @@ 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));
+ 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));
}
protected FluidDisplaySlotWidget createDrainableFluidSlot() {
return new FluidDisplaySlotWidget(inventoryHandler, getStackDisplaySlot())
- .setFluidAccessConstructor(() -> constructFluidAccess(false))
- .setIHasFluidDisplay(this)
- .setCanDrain(true)
- .setCanFill(!isDrainableStackSeparate())
- .setActionRealClick(FluidDisplaySlotWidget.Action.TRANSFER)
- .setBeforeRealClick((clickData, widget) -> {
+ .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()));
+ setDrainableStack(GT_Utility.getFluidFromDisplayStack(widget.getMcSlot().getStack()));
}
return true;
});
@@ -395,6 +372,7 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier
}
protected static class BasicTankFluidAccess implements IFluidAccess {
+
protected final GT_MetaTileEntity_BasicTank mTank;
protected final boolean mIsFillableStack;
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 6d327646fe..827f2b2ec9 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
@@ -3,22 +3,26 @@ package gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.GT_Values.V;
import static gregtech.api.enums.Textures.BlockIcons.*;
+import java.util.*;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.common.util.ForgeDirection;
+
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.common.widget.ButtonWidget;
import com.gtnewhorizons.modularui.common.widget.SlotGroup;
+
import gregtech.api.gui.modularui.GT_UIInfos;
import gregtech.api.gui.modularui.GT_UITextures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Utility;
-import java.util.*;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.common.util.ForgeDirection;
public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredMachineBlock {
+
private static final int OUTPUT_INDEX = 0;
private static final int ARROW_RIGHT_INDEX = 1;
private static final int ARROW_DOWN_INDEX = 2;
@@ -28,30 +32,27 @@ 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,
+ public boolean bOutput = false, bRedstoneIfFull = false, bInvert = false, bStockingMode = 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) {
+ public GT_MetaTileEntity_Buffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount,
+ 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) {
+ public GT_MetaTileEntity_Buffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount,
+ String[] aDescription) {
super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
}
- public GT_MetaTileEntity_Buffer(
- String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_Buffer(String aName, int aTier, int aInvSlotCount, String aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
- public GT_MetaTileEntity_Buffer(
- String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_Buffer(String aName, int aTier, int aInvSlotCount, String[] aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
@@ -60,37 +61,28 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
ITexture[][][] rTextures = new ITexture[ForgeDirection.VALID_DIRECTIONS.length][17][];
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());
- ITexture tDown = TextureFactory.of(
- 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());
- ITexture tRight = TextureFactory.of(
- TextureFactory.of(ARROW_RIGHT),
- TextureFactory.builder().addIcon(ARROW_RIGHT_GLOW).glow().build());
+ ITexture tUp = TextureFactory
+ .of(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());
+ ITexture tLeft = TextureFactory
+ .of(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());
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};
- rTextures[ARROW_DOWN_INDEX][i] = new ITexture[] {MACHINE_CASINGS[mTier][i], tDown, tIcon};
- rTextures[ARROW_LEFT_INDEX][i] = new ITexture[] {MACHINE_CASINGS[mTier][i], tLeft, tIcon};
- rTextures[ARROW_UP_INDEX][i] = new ITexture[] {MACHINE_CASINGS[mTier][i], tUp, tIcon};
- rTextures[FRONT_INDEX][i] = new ITexture[] {MACHINE_CASINGS[mTier][i], tIcon};
+ rTextures[OUTPUT_INDEX][i] = new ITexture[] { MACHINE_CASINGS[mTier][i], tOut };
+ rTextures[ARROW_RIGHT_INDEX][i] = new ITexture[] { MACHINE_CASINGS[mTier][i], tRight, tIcon };
+ rTextures[ARROW_DOWN_INDEX][i] = new ITexture[] { MACHINE_CASINGS[mTier][i], tDown, tIcon };
+ rTextures[ARROW_LEFT_INDEX][i] = new ITexture[] { MACHINE_CASINGS[mTier][i], tLeft, tIcon };
+ rTextures[ARROW_UP_INDEX][i] = new ITexture[] { MACHINE_CASINGS[mTier][i], tUp, tIcon };
+ rTextures[FRONT_INDEX][i] = new ITexture[] { MACHINE_CASINGS[mTier][i], tIcon };
}
return rTextures;
}
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- boolean aActive,
- boolean aRedstone) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ boolean aActive, boolean aRedstone) {
int colorIndex = aColorIndex + 1;
ForgeDirection side = ForgeDirection.VALID_DIRECTIONS[aSide];
ForgeDirection facing = ForgeDirection.VALID_DIRECTIONS[aFacing];
@@ -278,14 +270,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) {
+ public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
+ float aZ) {
aWrenchingSide = GT_Utility.getOppositeSide(aWrenchingSide);
if (getBaseMetaTileEntity().isValidFacing(aWrenchingSide)) {
getBaseMetaTileEntity().setFrontFacing(aWrenchingSide);
@@ -313,10 +306,8 @@ 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()
+ if (aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.isServerSide()
+ && (aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified()
|| aTimer % 200 == 0
|| mSuccess > 0)) {
mSuccess--;
@@ -337,32 +328,30 @@ 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);
- 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);
+ 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);
+ 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);
if (tCost > 0 || aBaseMetaTileEntity.hasInventoryBeenModified()) {
mSuccess = 50;
@@ -420,8 +409,8 @@ 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) {
+ public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
+ float aZ) {
if (aPlayer.isSneaking()) {
// I was so proud of all this but I literally just copied code from OutputBus
bSortStacks = !bSortStacks;
@@ -440,84 +429,73 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
}
protected void addEmitEnergyButton(ModularWindow.Builder builder) {
- builder.widget(new ButtonWidget()
- .setOnClick((clickData, widget) -> {
- bOutput = !bOutput;
- if (bOutput) {
- GT_Utility.sendChatToPlayer(
- 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"));
- }
- })
- .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_EMIT_ENERGY)
- .setPos(7, 62)
+ builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> {
+ bOutput = !bOutput;
+ if (bOutput) {
+ GT_Utility.sendChatToPlayer(
+ 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"));
+ }
+ }).setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_EMIT_ENERGY).setPos(7, 62)
.setSize(18, 18));
}
protected void addEmitRedstoneButton(ModularWindow.Builder builder) {
- builder.widget(new ButtonWidget()
- .setOnClick((clickData, widget) -> {
- bRedstoneIfFull = !bRedstoneIfFull;
- if (bRedstoneIfFull) {
- GT_Utility.sendChatToPlayer(
- 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"));
- }
- })
- .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_EMIT_REDSTONE)
- .setPos(25, 62)
+ builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> {
+ bRedstoneIfFull = !bRedstoneIfFull;
+ if (bRedstoneIfFull) {
+ GT_Utility.sendChatToPlayer(
+ 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"));
+ }
+ }).setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_EMIT_REDSTONE).setPos(25, 62)
.setSize(18, 18));
}
protected void addInvertRedstoneButton(ModularWindow.Builder builder) {
- builder.widget(new ButtonWidget()
- .setOnClick((clickData, widget) -> {
- bInvert = !bInvert;
- if (bInvert) {
- GT_Utility.sendChatToPlayer(
- widget.getContext().getPlayer(), GT_Utility.trans("120", "Invert Redstone"));
- } else {
- GT_Utility.sendChatToPlayer(
- 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)
+ builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> {
+ bInvert = !bInvert;
+ if (bInvert) {
+ GT_Utility
+ .sendChatToPlayer(widget.getContext().getPlayer(), GT_Utility.trans("120", "Invert Redstone"));
+ } else {
+ GT_Utility.sendChatToPlayer(
+ 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));
}
protected void addStockingModeButton(ModularWindow.Builder builder) {
- builder.widget(new ButtonWidget()
- .setOnClick((clickData, widget) -> {
- 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."));
- } 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."));
- }
- })
- .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_STOCKING_MODE)
- .setPos(61, 62)
+ builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> {
+ 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."));
+ } 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."));
+ }
+ }).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));
+ builder.widget(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 3e3433e52c..830706f8fe 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
@@ -6,62 +6,63 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElement
import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
import static gregtech.api.enums.GT_HatchElement.*;
+import java.util.List;
+
+import net.minecraft.item.ItemStack;
+
import com.google.common.collect.ImmutableList;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.IStructureElement;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+
import gregtech.api.interfaces.IHatchElement;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_StructureUtility;
-import java.util.List;
-import net.minecraft.item.ItemStack;
/**
- * A simple 3x3x3 hollow cubic multiblock, that can be arbitrarily rotated, made of a single type of machine casing and accepts hatches everywhere.
- * Controller will be placed in front center of the structure.
+ * A simple 3x3x3 hollow cubic multiblock, that can be arbitrarily rotated, made of a single type of machine casing and
+ * accepts hatches everywhere. Controller will be placed in front center of the structure.
* <p>
- * Note: You cannot use different casing for the same Class. Make a new subclass for it. You also should not change the casing
- * dynamically, i.e. it should be a dumb method returning some sort of constant.
+ * Note: You cannot use different casing for the same Class. Make a new subclass for it. You also should not change the
+ * casing dynamically, i.e. it should be a dumb method returning some sort of constant.
* <p>
- * Implementation tips:
- * 1. To restrict hatches, override {@link #addDynamoToMachineList(IGregTechTileEntity, int)} and its cousins instead of overriding the whole
- * {@link #getStructureDefinition()} or change {@link #checkHatches(IGregTechTileEntity, ItemStack)}. The former is a total overkill, while the later cannot
- * stop the structure check early.
- * 2. To limit rotation, override {@link #getInitialAlignmentLimits()}
+ * Implementation tips: 1. To restrict hatches, override {@link #addDynamoToMachineList(IGregTechTileEntity, int)} and
+ * its cousins instead of overriding the whole {@link #getStructureDefinition()} or change
+ * {@link #checkHatches(IGregTechTileEntity, ItemStack)}. The former is a total overkill, while the later cannot stop
+ * the structure check early. 2. To limit rotation, override {@link #getInitialAlignmentLimits()}
*
* @param <T>
*/
public abstract class GT_MetaTileEntity_CubicMultiBlockBase<T extends GT_MetaTileEntity_CubicMultiBlockBase<T>>
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<IStructureDefinition<GT_MetaTileEntity_CubicMultiBlockBase<?>>>() {
- @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();
- }
- };
+ protected static final ClassValue<IStructureDefinition<GT_MetaTileEntity_CubicMultiBlockBase<?>>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GT_MetaTileEntity_CubicMultiBlockBase<?>>>() {
+
+ @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();
+ }
+ };
private int mCasingAmount = 0;
protected GT_MetaTileEntity_CubicMultiBlockBase(int aID, String aName, String aNameRegional) {
@@ -73,7 +74,8 @@ public abstract class GT_MetaTileEntity_CubicMultiBlockBase<T extends GT_MetaTil
}
/**
- * Create a simple 3x3x3 hollow cubic structure made of a single type of machine casing and accepts hatches everywhere.
+ * Create a simple 3x3x3 hollow cubic structure made of a single type of machine casing and accepts hatches
+ * everywhere.
* <p>
* The created definition contains a single piece named {@link #STRUCTURE_PIECE_MAIN}.
*/
@@ -97,8 +99,7 @@ public abstract class GT_MetaTileEntity_CubicMultiBlockBase<T extends GT_MetaTil
@Override
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
mCasingAmount = 0;
- return checkPiece(STRUCTURE_PIECE_MAIN, 1, 1, 0)
- && mCasingAmount >= getRequiredCasingCount()
+ return checkPiece(STRUCTURE_PIECE_MAIN, 1, 1, 0) && mCasingAmount >= getRequiredCasingCount()
&& 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 32f607c0a7..0b1827bcdb 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
@@ -1,5 +1,11 @@
package gregtech.api.metatileentity.implementations;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.common.util.ForgeDirection;
+
import com.gtnewhorizon.structurelib.StructureLibAPI;
import com.gtnewhorizon.structurelib.alignment.IAlignment;
import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits;
@@ -11,25 +17,22 @@ import com.gtnewhorizon.structurelib.alignment.enumerable.Rotation;
import com.gtnewhorizon.structurelib.structure.IItemSource;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
+
import cpw.mods.fml.common.network.NetworkRegistry;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.common.util.ForgeDirection;
/**
* Enhanced multiblock base class, featuring following improvement over {@link GT_MetaTileEntity_MultiBlockBase}
* <p>
- * 1. TecTech style declarative structure check utilizing StructureLib.
- * 2. Arbitrarily rotating the whole structure, if allowed to.
+ * 1. TecTech style declarative structure check utilizing StructureLib. 2. Arbitrarily rotating the whole structure, if
+ * allowed to.
*
* @param <T> type of this
*/
public abstract class GT_MetaTileEntity_EnhancedMultiBlockBase<T extends GT_MetaTileEntity_EnhancedMultiBlockBase<T>>
extends GT_MetaTileEntity_TooltipMultiBlockBase implements IAlignment, IConstructable {
+
private ExtendedFacing mExtendedFacing = ExtendedFacing.DEFAULT;
private IAlignmentLimits mLimits = getInitialAlignmentLimits();
@@ -76,8 +79,8 @@ 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) {
+ public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
+ float aZ) {
if (aWrenchingSide != getBaseMetaTileEntity().getFrontFacing())
return super.onWrenchRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ);
if (aPlayer.isSneaking()) {
@@ -106,9 +109,9 @@ public abstract class GT_MetaTileEntity_EnhancedMultiBlockBase<T extends GT_Meta
}
/**
- * Due to limitation of Java type system, you might need to do an unchecked cast.
- * HOWEVER, the returned IStructureDefinition is expected to be evaluated against current instance only, and should
- * not be used against other instances, even for those of the same class.
+ * Due to limitation of Java type system, you might need to do an unchecked cast. HOWEVER, the returned
+ * IStructureDefinition is expected to be evaluated against current instance only, and should not be used against
+ * other instances, even for those of the same class.
*/
public abstract IStructureDefinition<T> getStructureDefinition();
@@ -149,142 +152,118 @@ public abstract class GT_MetaTileEntity_EnhancedMultiBlockBase<T extends GT_Meta
*
* Imagine you stand in front of the controller, with controller facing towards you not rotated or flipped.
*
- * The horizontalOffset would be the number of blocks on the left side of the controller, not counting controller itself.
- * The verticalOffset would be the number of blocks on the top side of the controller, not counting controller itself.
- * The depthOffset would be the number of blocks between you and controller, not counting controller itself.
+ * The horizontalOffset would be the number of blocks on the left side of the controller, not counting controller
+ * itself. The verticalOffset would be the number of blocks on the top side of the controller, not counting
+ * controller itself. The depthOffset would be the number of blocks between you and controller, not counting
+ * controller itself.
*
* All these offsets can be negative.
*/
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);
+ return getCastedStructureDefinition().check(
+ 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) {
+ protected final boolean buildPiece(String piece, ItemStack trigger, boolean hintOnly, int horizontalOffset,
+ 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);
+ return getCastedStructureDefinition().buildOrHints(
+ 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) {
+ protected final int survivialBuildPiece(String piece, ItemStack trigger, int horizontalOffset, int verticalOffset,
+ 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);
+ return getCastedStructureDefinition().survivalBuild(
+ 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) {
+ protected final int survivialBuildPiece(String piece, ItemStack trigger, int horizontalOffset, int verticalOffset,
+ 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);
+ return getCastedStructureDefinition().survivalBuild(
+ 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,
+ 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 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) {
+ protected final int survivialBuildPiece(String piece, ItemStack trigger, int horizontalOffset, int verticalOffset,
+ 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 329ba45df5..11f3eeb9cc 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
@@ -2,11 +2,9 @@ package gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.GT_Values.*;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.util.GT_ExoticEnergyInputHelper;
-import gregtech.api.util.GT_Utility;
import java.util.ArrayList;
import java.util.List;
+
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -15,11 +13,14 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.util.GT_ExoticEnergyInputHelper;
+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>>
+public abstract class GT_MetaTileEntity_ExtendedPowerMultiBlockBase<T extends GT_MetaTileEntity_EnhancedMultiBlockBase<T>>
extends GT_MetaTileEntity_EnhancedMultiBlockBase<T> {
public long lEUt;
@@ -46,8 +47,8 @@ public abstract class GT_MetaTileEntity_ExtendedPowerMultiBlockBase<
}
@Override
- protected void calculateOverclockedNessMultiInternal(
- long aEUt, int aDuration, int mAmperage, long maxInputVoltage, boolean perfectOC) {
+ protected void calculateOverclockedNessMultiInternal(long aEUt, int aDuration, int mAmperage, long maxInputVoltage,
+ boolean perfectOC) {
// 5% space for cable loss
long zMaxInputVoltage = maxInputVoltage / 100L * 95L;
long zTime = aDuration;
@@ -112,8 +113,8 @@ public abstract class GT_MetaTileEntity_ExtendedPowerMultiBlockBase<
}
@Override
- public void getWailaNBTData(
- EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, int z) {
+ public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y,
+ int z) {
super.getWailaNBTData(player, tile, tag, world, x, y, z);
final IGregTechTileEntity tileEntity = getBaseMetaTileEntity();
@@ -145,29 +146,57 @@ public abstract class GT_MetaTileEntity_ExtendedPowerMultiBlockBase<
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
- + Float.toString(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
+ + Float.toString(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 f1ccdd04e4..a8e505b806 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
@@ -1,10 +1,11 @@
package gregtech.api.metatileentity.implementations;
+import net.minecraft.nbt.NBTTagCompound;
+
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.nbt.NBTTagCompound;
/**
* Handles texture changes internally. No special calls are necessary other than updateTexture in add***ToMachineList.
@@ -26,35 +27,23 @@ public abstract class GT_MetaTileEntity_Hatch extends GT_MetaTileEntity_BasicTan
private byte mTexturePage = 0;
private byte actualTexture = 0;
- public GT_MetaTileEntity_Hatch(
- int aID,
- String aName,
- String aNameRegional,
- int aTier,
- int aInvSlotCount,
- String aDescription,
- ITexture... aTextures) {
+ public GT_MetaTileEntity_Hatch(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount,
+ 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) {
+ public GT_MetaTileEntity_Hatch(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount,
+ 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) {
+ public GT_MetaTileEntity_Hatch(String aName, int aTier, int aInvSlotCount, String aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
- public GT_MetaTileEntity_Hatch(
- String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_Hatch(String aName, int aTier, int aInvSlotCount, String[] aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
@@ -72,35 +61,29 @@ public abstract class GT_MetaTileEntity_Hatch extends GT_MetaTileEntity_BasicTan
public abstract ITexture[] getTexturesInactive(ITexture aBaseTexture);
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- boolean aActive,
- boolean aRedstone) {
- int texturePointer =
- (byte) (actualTexture & 0x7F); // just to be sure, from my testing the 8th bit cannot be set clientside
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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!
try {
if (aSide != aFacing) {
if (textureIndex > 0)
- return new ITexture[] {Textures.BlockIcons.casingTexturePages[mTexturePage][texturePointer]};
- else return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1]};
+ return new ITexture[] { Textures.BlockIcons.casingTexturePages[mTexturePage][texturePointer] };
+ else return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1] };
} else {
if (textureIndex > 0) {
if (aActive)
return getTexturesActive(Textures.BlockIcons.casingTexturePages[mTexturePage][texturePointer]);
- else
- return getTexturesInactive(
- Textures.BlockIcons.casingTexturePages[mTexturePage][texturePointer]);
+ else return getTexturesInactive(
+ 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]);
}
}
} catch (NullPointerException npe) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[0][0]};
+ return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[0][0] };
}
}
@@ -117,13 +100,15 @@ public abstract class GT_MetaTileEntity_Hatch extends GT_MetaTileEntity_BasicTan
actualTexture = aNBT.getByte("mMachineBlock");
mTexturePage = aNBT.getByte("mTexturePage");
- if (mTexturePage != 0 && GT_Values.GT.isServerSide())
- actualTexture |= 0x80; // <- lets just hope no one needs the correct value for that on server
+ if (mTexturePage != 0 && GT_Values.GT.isServerSide()) actualTexture |= 0x80; // <- lets just hope no one needs
+ // the correct value for that on
+ // server
mMachineBlock = actualTexture;
}
/**
* Sets texture with page and index, called on add to machine list
+ *
* @param id (page<<7)+index of the texture
*/
public final void updateTexture(int id) {
@@ -133,7 +118,8 @@ public abstract class GT_MetaTileEntity_Hatch extends GT_MetaTileEntity_BasicTan
/**
* Sets texture with page and index, rather unusable, but kept FFS
- * @param page page of texure
+ *
+ * @param page page of texure
* @param index index of texure
*/
@Deprecated
@@ -149,7 +135,8 @@ public abstract class GT_MetaTileEntity_Hatch extends GT_MetaTileEntity_BasicTan
mTexturePage = 0;
}
- /** Get the maximum amount of amperes to work with, which excludes the additional amps in for loss
+ /**
+ * Get the maximum amount of amperes to work with, which excludes the additional amps in for loss
*
* @return Working amps
*/
@@ -157,7 +144,8 @@ public abstract class GT_MetaTileEntity_Hatch extends GT_MetaTileEntity_BasicTan
return maxAmperesIn();
}
- /** Get the type of connection this hatch allows
+ /**
+ * Get the type of connection this hatch allows
*
* @return Connection type
*/
@@ -215,13 +203,13 @@ public abstract class GT_MetaTileEntity_Hatch extends GT_MetaTileEntity_BasicTan
}
@Override
- public void onPreTick(
- IGregTechTileEntity aBaseMetaTileEntity,
- long aTick) { // in that method since it is usually not overriden, especially for hatches.
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { // in that method since it is usually
+ // not overriden, especially for
+ // hatches.
if (actualTexture != mMachineBlock) { // revert to page 0 on edition of the field - old code way
actualTexture = (byte) (mMachineBlock & 0x7F);
- mMachineBlock =
- actualTexture; // clear last bit in mMachineBlock since now we are at page 0 after the direct field
+ mMachineBlock = actualTexture; // clear last bit in mMachineBlock since now we are at page 0 after the
+ // direct field
// change
mTexturePage = 0; // assuming old code only supports page 0
}
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 e60ffe0f58..fc25a15beb 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
@@ -2,8 +2,13 @@ package gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_DATA_ACCESS;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
+
import gregtech.api.gui.modularui.GT_UIInfos;
import gregtech.api.gui.modularui.GT_UITextures;
import gregtech.api.interfaces.ITexture;
@@ -12,36 +17,39 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_AssemblyLineUtils;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
public class GT_MetaTileEntity_Hatch_DataAccess extends GT_MetaTileEntity_Hatch implements IAddUIWidgets {
+
private int timeout = 4;
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"
- });
+ super(
+ 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) {
super(aName, aTier, aTier == 4 ? 4 : 16, aDescription, aTextures);
}
- public GT_MetaTileEntity_Hatch_DataAccess(
- String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_Hatch_DataAccess(String aName, int aTier, String[] aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aTier == 4 ? 4 : 16, aDescription, aTextures);
}
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_DATA_ACCESS)};
+ return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_DATA_ACCESS) };
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_DATA_ACCESS)};
+ return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_DATA_ACCESS) };
}
@Override
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 e9ba5ec512..84c1327a91 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
@@ -2,22 +2,28 @@ package gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.GT_Values.V;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
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"
- });
+ super(
+ 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) {
+ public GT_MetaTileEntity_Hatch_Dynamo(int aID, String aName, String aNameRegional, int aTier,
+ String[] aDescription) {
super(aID, aName, aNameRegional, aTier, 0, aDescription);
}
@@ -31,12 +37,12 @@ public class GT_MetaTileEntity_Hatch_Dynamo extends GT_MetaTileEntity_Hatch {
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[] {aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]};
+ return new ITexture[] { aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] };
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[] {aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]};
+ return new ITexture[] { aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] };
}
@Override
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 1b4def6dc3..dda6fb5716 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
@@ -2,34 +2,33 @@ package gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.GT_Values.V;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
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) {
+ public GT_MetaTileEntity_Hatch_Energy(int aID, String aName, String aNameRegional, int aTier,
+ 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"
- });
- }
-
- public GT_MetaTileEntity_Hatch_Energy(
- int aID,
- String aName,
- String aNameRegional,
- int aTier,
- int aInvSlotCount,
- String[] aDescription,
- ITexture... aTextures) {
+ super(
+ 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) {
super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures);
}
@@ -41,19 +40,19 @@ public class GT_MetaTileEntity_Hatch_Energy extends GT_MetaTileEntity_Hatch {
super(aName, aTier, 0, aDescription, aTextures);
}
- public GT_MetaTileEntity_Hatch_Energy(
- String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_Hatch_Energy(String aName, int aTier, int aInvSlotCount, String[] aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[] {aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier]};
+ return new ITexture[] { aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier] };
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[] {aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier]};
+ return new ITexture[] { aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier] };
}
@Override
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 ead36c10ab..4b53946e7a 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
@@ -3,6 +3,11 @@ package gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.Textures.BlockIcons.FLUID_IN_SIGN;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_IN;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.fluids.FluidStack;
+
import gregtech.GT_Mod;
import gregtech.api.gui.modularui.GT_UIInfos;
import gregtech.api.interfaces.ITexture;
@@ -11,26 +16,32 @@ import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_Hatch_Input extends GT_MetaTileEntity_Hatch {
+
public GT_Recipe_Map mRecipeMap = null;
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"
- });
+ super(
+ 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."
- });
+ 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." });
}
public GT_MetaTileEntity_Hatch_Input(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
@@ -41,23 +52,23 @@ public class GT_MetaTileEntity_Hatch_Input extends GT_MetaTileEntity_Hatch {
super(aName, aTier, 3, aDescription, aTextures);
}
- public GT_MetaTileEntity_Hatch_Input(
- String aName, int aSlots, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_Hatch_Input(String aName, int aSlots, int aTier, String[] aDescription,
+ 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
@@ -146,10 +157,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)
+ return aSide == aBaseMetaTileEntity.getFrontFacing() && aIndex == 0
+ && (mRecipeMap == null || mRecipeMap.containsInput(aStack)
|| mRecipeMap.containsInput(GT_Utility.getFluidForFilledItem(aStack, true)));
}
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 fdedbad86a..959bcda530 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
@@ -2,8 +2,18 @@ package gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.Textures.BlockIcons.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.StatCollector;
+
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
+
import gregtech.GT_Mod;
import gregtech.api.gui.modularui.GT_UIInfos;
import gregtech.api.interfaces.IConfigurationCircuitSupport;
@@ -17,16 +27,10 @@ import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.extensions.ArrayExt;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.StatCollector;
public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch
implements IConfigurationCircuitSupport, IAddUIWidgets {
+
public GT_Recipe_Map mRecipeMap = null;
public boolean disableSort;
public boolean disableFilter = true;
@@ -36,8 +40,8 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch
this(id, name, nameRegional, tier, getSlots(tier) + 1);
}
- protected GT_MetaTileEntity_Hatch_InputBus(
- int id, String name, String nameRegional, int tier, int slots, String[] description) {
+ protected GT_MetaTileEntity_Hatch_InputBus(int id, String name, String nameRegional, int tier, int slots,
+ String[] description) {
super(id, name, nameRegional, tier, slots, description);
}
@@ -65,23 +69,23 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch
this(aName, aTier, getSlots(aTier) + 1, aDescription, aTextures);
}
- public GT_MetaTileEntity_Hatch_InputBus(
- String aName, int aTier, int aSlots, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_Hatch_InputBus(String aName, int aTier, int aSlots, String[] aDescription,
+ 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
@@ -128,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();
}
}
@@ -216,7 +220,8 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch
} else {
disableFilter = !disableFilter;
GT_Utility.sendChatToPlayer(
- aPlayer, StatCollector.translateToLocal("GT5U.hatch.disableFilter." + disableFilter));
+ aPlayer,
+ StatCollector.translateToLocal("GT5U.hatch.disableFilter." + disableFilter));
}
}
@@ -228,8 +233,7 @@ 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()
+ return aSide == getBaseMetaTileEntity().getFrontFacing() && aIndex != getCircuitSlot()
&& (mRecipeMap == null || disableFilter || mRecipeMap.containsInput(aStack))
&& (disableLimited || limitedAllowPutStack(aIndex, 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 963aa5a0d7..bcc260fd2e 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
@@ -7,12 +7,21 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_AUTOMAINTENANCE_IDL
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_DUCTTAPE;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_MAINTENANCE;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.common.util.FakePlayer;
+
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot;
import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
import com.gtnewhorizons.modularui.common.widget.SlotWidget;
import com.gtnewhorizons.modularui.common.widget.TextWidget;
+
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ItemList;
@@ -30,23 +39,12 @@ import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
import ic2.core.IHasGui;
import ic2.core.item.ItemToolbox;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.common.util.FakePlayer;
public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch implements IAddUIWidgets {
+
private static ItemStack[] sAutoMaintenanceInputs;
- public boolean mWrench = false,
- mScrewdriver = false,
- mSoftHammer = false,
- mHardHammer = false,
- mSolderingTool = false,
- mCrowbar = false,
- mAuto;
+ public boolean mWrench = false, mScrewdriver = false, mSoftHammer = false, mHardHammer = false,
+ 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");
@@ -58,26 +56,23 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch
mAuto = aAuto;
}
- public GT_MetaTileEntity_Hatch_Maintenance(
- String aName, int aTier, String aDescription, ITexture[][][] aTextures, boolean aAuto) {
+ public GT_MetaTileEntity_Hatch_Maintenance(String aName, int aTier, String aDescription, ITexture[][][] aTextures,
+ 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) {
+ public GT_MetaTileEntity_Hatch_Maintenance(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures,
+ 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),
+ 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.circuit, Materials.Advanced, 2) };
return sAutoMaintenanceInputs;
}
@@ -100,31 +95,17 @@ 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()
- };
- return new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_MAINTENANCE)};
+ if (mAuto) return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_AUTOMAINTENANCE_IDLE),
+ 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()
- };
- return new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_MAINTENANCE), TextureFactory.of(OVERLAY_DUCTTAPE)
- };
+ if (mAuto) return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_AUTOMAINTENANCE),
+ TextureFactory.builder().addIcon(OVERLAY_AUTOMAINTENANCE_GLOW).glow().build() };
+ return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_MAINTENANCE),
+ TextureFactory.of(OVERLAY_DUCTTAPE) };
}
@Override
@@ -160,13 +141,12 @@ 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) {
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX,
+ 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;
+ if (aPlayer instanceof FakePlayer && !aPlayer.getGameProfile().getName().endsWith(".robot")) return false;
ItemStack tStack = aPlayer.getCurrentEquippedItem();
if (tStack != null) {
if (tStack.getItem() instanceof ItemToolbox) {
@@ -213,9 +193,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;
@@ -232,9 +211,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;
@@ -267,21 +245,21 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch
return;
}
- if (GT_Utility.isStackInList(aStack, GregTech_API.sWrenchList)
- && !mWrench
- && 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;
- if (GT_Utility.isStackInList(aStack, GregTech_API.sSoftHammerList)
- && !mSoftHammer
- && 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;
- if (GT_Utility.isStackInList(aStack, GregTech_API.sCrowbarList)
- && !mCrowbar
- && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mCrowbar = true;
+ if (GT_Utility.isStackInList(aStack, GregTech_API.sWrenchList) && !mWrench
+ && 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;
+ if (GT_Utility.isStackInList(aStack, GregTech_API.sSoftHammerList) && !mSoftHammer
+ && 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;
+ if (GT_Utility.isStackInList(aStack, GregTech_API.sCrowbarList) && !mCrowbar
+ && 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")) {
@@ -293,8 +271,7 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch
EntityPlayerMP tPlayer = (EntityPlayerMP) aPlayer;
try {
GT_Mod.achievements.issueAchievement(tPlayer, "maintainance");
- } catch (Exception ignored) {
- }
+ } catch (Exception ignored) {}
}
}
@@ -322,10 +299,10 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch
@Override
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;
+ 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;
for (ItemStack tInput : getAutoMaintenanceInputs())
if (GT_Utility.areUnificationsEqual(tInput, aStack, true)
|| GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tInput, true))
@@ -344,34 +321,29 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch
if (mAuto) {
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()
- .setBackground(GT_UITextures.TRANSPARENT)
- .setPos(79, 34))
- .widget(new TextWidget("Click with Tool to repair.")
- .setDefaultColor(COLOR_TEXT_GRAY.get())
- .setPos(8, 12));
+ 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().setBackground(GT_UITextures.TRANSPARENT).setPos(79, 34)).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 3e1b39c1fd..b41f45e6d2 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
@@ -3,6 +3,13 @@ package gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_MUFFLER;
import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
+import java.util.Arrays;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.GT_Mod;
@@ -15,14 +22,10 @@ import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.WorldSpawnedEventBuilder;
import gregtech.common.GT_Pollution;
import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_Cleanroom;
-import java.util.Arrays;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
@SuppressWarnings("unused") // Unused API is expected within scope
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"
@@ -38,27 +41,21 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
super(aID, aName, aNameRegional, aTier, 0, "");
}
- public GT_MetaTileEntity_Hatch_Muffler(
- int aID,
- String aName,
- String aNameRegional,
- int aTier,
- int aInvSlotCount,
- String[] aDescription,
- ITexture... aTextures) {
+ public GT_MetaTileEntity_Hatch_Muffler(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount,
+ String[] aDescription, ITexture... aTextures) {
super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures);
}
public GT_MetaTileEntity_Hatch_Muffler(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- this(aName, aTier, new String[] {aDescription}, aTextures);
+ this(aName, aTier, new String[] { aDescription }, aTextures);
}
public GT_MetaTileEntity_Hatch_Muffler(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
this(aName, aTier, 0, aDescription, aTextures);
}
- public GT_MetaTileEntity_Hatch_Muffler(
- String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_Hatch_Muffler(String aName, int aTier, int aInvSlotCount, String[] aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
setInValidFacings(ForgeDirection.DOWN);
}
@@ -70,12 +67,12 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_MUFFLER)};
+ return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_MUFFLER) };
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_MUFFLER)};
+ return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_MUFFLER) };
}
@Override
@@ -163,30 +160,25 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
}
WorldSpawnedEventBuilder.ParticleEventBuilder events = new WorldSpawnedEventBuilder.ParticleEventBuilder()
- .setIdentifier(name)
- .setWorld(aWorld)
- .setMotion(xSpd, ySpd, zSpd);
+ .setIdentifier(name).setWorld(aWorld).setMotion(xSpd, ySpd, zSpd);
if (chk1) {
events.setPosition(
- xPos + ran1 * 0.5F,
- yPos + XSTR_INSTANCE.nextFloat() * 0.5F,
- zPos + XSTR_INSTANCE.nextFloat() * 0.5F)
- .run();
+ xPos + ran1 * 0.5F,
+ yPos + XSTR_INSTANCE.nextFloat() * 0.5F,
+ zPos + XSTR_INSTANCE.nextFloat() * 0.5F).run();
}
if (chk2) {
events.setPosition(
- xPos + ran2 * 0.5F,
- yPos + XSTR_INSTANCE.nextFloat() * 0.5F,
- zPos + XSTR_INSTANCE.nextFloat() * 0.5F)
- .run();
+ xPos + ran2 * 0.5F,
+ yPos + XSTR_INSTANCE.nextFloat() * 0.5F,
+ zPos + XSTR_INSTANCE.nextFloat() * 0.5F).run();
}
if (chk3) {
events.setPosition(
- xPos + ran3 * 0.5F,
- yPos + XSTR_INSTANCE.nextFloat() * 0.5F,
- zPos + XSTR_INSTANCE.nextFloat() * 0.5F)
- .run();
+ xPos + ran3 * 0.5F,
+ yPos + XSTR_INSTANCE.nextFloat() * 0.5F,
+ zPos + XSTR_INSTANCE.nextFloat() * 0.5F).run();
}
}
@@ -207,8 +199,8 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
}
/**
- * @param mte The multi-block controller's {@link MetaTileEntity}
- * MetaTileEntity is passed so newer muffler hatches can do wacky things with the multis
+ * @param mte The multi-block controller's {@link MetaTileEntity} MetaTileEntity is passed so newer muffler hatches
+ * can do wacky things with the multis
* @return pollution success
*/
public boolean polluteEnvironment(MetaTileEntity mte) {
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 66c5401bd7..7d95e0b17c 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
@@ -2,11 +2,18 @@ package gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_INPUT_HATCH_2x2;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.FluidTankInfo;
+
import com.gtnewhorizons.modularui.api.ModularUITextures;
import com.gtnewhorizons.modularui.api.math.Pos2d;
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
import com.gtnewhorizons.modularui.common.internal.network.NetworkUtils;
+
import gregtech.api.enums.ItemList;
import gregtech.api.interfaces.IFluidAccess;
import gregtech.api.interfaces.ITexture;
@@ -16,11 +23,6 @@ import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Utility;
import gregtech.common.gui.modularui.widget.FluidDisplaySlotWidget;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.FluidTankInfo;
public class GT_MetaTileEntity_Hatch_MultiInput extends GT_MetaTileEntity_Hatch_Input implements IAddUIWidgets {
@@ -33,8 +35,8 @@ public class GT_MetaTileEntity_Hatch_MultiInput extends GT_MetaTileEntity_Hatch_
mCapacityPer = 8000 * (1 << aTier) / aSlot;
}
- public GT_MetaTileEntity_Hatch_MultiInput(
- String aName, int aSlot, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_Hatch_MultiInput(String aName, int aSlot, int aTier, String[] aDescription,
+ ITexture[][][] aTextures) {
super(aName, aSlot, aTier, aDescription, aTextures);
this.mStoredFluid = new FluidStack[aSlot];
mCapacityPer = 8000 * (1 << aTier) / aSlot;
@@ -79,12 +81,12 @@ public class GT_MetaTileEntity_Hatch_MultiInput extends GT_MetaTileEntity_Hatch_
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_INPUT_HATCH_2x2)};
+ return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_INPUT_HATCH_2x2) };
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_INPUT_HATCH_2x2)};
+ return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_INPUT_HATCH_2x2) };
}
public int getMaxType() {
@@ -169,11 +171,11 @@ 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
+ if (aFluid == null || aFluid.getFluid().getID() <= 0
|| aFluid.amount <= 0
|| !canTankBeFilled()
- || !isFluidInputAllowed(aFluid)) return 0;
+ || !isFluidInputAllowed(aFluid))
+ return 0;
if (!hasFluid(aFluid) && getFirstEmptySlot() != -1) {
int tFilled = Math.min(aFluid.amount, mCapacityPer);
if (doFill) {
@@ -295,34 +297,28 @@ public class GT_MetaTileEntity_Hatch_MultiInput extends GT_MetaTileEntity_Hatch_
@Override
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),
- };
+ final Pos2d[] positions = new Pos2d[] { new Pos2d(70, 25), new Pos2d(88, 25), new Pos2d(70, 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]));
+ 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]));
}
}
@@ -331,6 +327,7 @@ public class GT_MetaTileEntity_Hatch_MultiInput extends GT_MetaTileEntity_Hatch_
}
protected static class MultiFluidAccess implements IFluidAccess {
+
private final GT_MetaTileEntity_Hatch_MultiInput mTank;
private final int mSlot;
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 2809ab3815..ed29f8fe08 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
@@ -3,6 +3,16 @@ package gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.Textures.BlockIcons.FLUID_OUT_SIGN;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_OUT;
+import java.lang.ref.WeakReference;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.*;
+
import com.gtnewhorizons.modularui.api.math.Alignment;
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
@@ -10,6 +20,7 @@ import com.gtnewhorizons.modularui.common.internal.network.NetworkUtils;
import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget;
import com.gtnewhorizons.modularui.common.widget.TextWidget;
+
import gregtech.GT_Mod;
import gregtech.api.gui.modularui.GT_UIInfos;
import gregtech.api.gui.modularui.GT_UITextures;
@@ -22,28 +33,25 @@ import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
import gregtech.common.gui.modularui.widget.FluidDisplaySlotWidget;
-import java.lang.ref.WeakReference;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.*;
public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch implements IFluidLockable, IAddUIWidgets {
+
private String lockedFluidName = null;
private WeakReference<EntityPlayer> playerThatLockedfluid = null;
public byte mMode = 0;
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"
- });
+ 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" });
}
public GT_MetaTileEntity_Hatch_Output(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
@@ -54,28 +62,30 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
super(aName, aTier, 4, aDescription, aTextures);
}
- public GT_MetaTileEntity_Hatch_Output(
- int aID, String aName, String aNameRegional, int aTier, String[] aDescription, int inventorySize) {
+ public GT_MetaTileEntity_Hatch_Output(int aID, String aName, String aNameRegional, int aTier, String[] aDescription,
+ int inventorySize) {
super(aID, aName, aNameRegional, aTier, inventorySize, aDescription);
}
- public GT_MetaTileEntity_Hatch_Output(
- String name, int tier, int slots, String[] description, ITexture[][][] textures) {
+ public GT_MetaTileEntity_Hatch_Output(String name, int tier, int slots, String[] description,
+ 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
@@ -113,16 +123,16 @@ 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);
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()),
@@ -153,8 +163,7 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
lockedFluidName = aNBT.getString("lockedFluidName");
lockedFluidName = lockedFluidName.length() == 0 ? null : lockedFluidName;
if (GT_Utility.getFluidFromUnlocalizedName(lockedFluidName) != null) {
- lockedFluidName =
- GT_Utility.getFluidFromUnlocalizedName(lockedFluidName).getName();
+ lockedFluidName = GT_Utility.getFluidFromUnlocalizedName(lockedFluidName).getName();
}
}
@@ -285,7 +294,8 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
aPlayer,
String.format(
"%s (%s)",
- GT_Utility.trans("151.1", "Outputs items and 1 specific Fluid"), inBrackets));
+ GT_Utility.trans("151.1", "Outputs items and 1 specific Fluid"),
+ inBrackets));
break;
case 9:
playerThatLockedfluid = new WeakReference<>(aPlayer);
@@ -314,8 +324,7 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
if (tFluid == null && tCurrentItem.getItem() instanceof IFluidContainerItem)
tFluid = ((IFluidContainerItem) tCurrentItem.getItem()).getFluid(tCurrentItem);
if (tFluid != null) {
- if (getLockedFluidName() != null
- && !getLockedFluidName().equals(tFluid.getFluid().getName())) {
+ if (getLockedFluidName() != null && !getLockedFluidName().equals(tFluid.getFluid().getName())) {
GT_Utility.sendChatToPlayer(
aPlayer,
String.format(
@@ -326,19 +335,18 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
StatCollector.translateToLocal(getLockedFluidName())));
} else {
setLockedFluidName(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()));
- else
- GT_Utility.sendChatToPlayer(
- aPlayer,
- String.format(
- "%s (%s)",
- GT_Utility.trans("151.2", "Outputs 1 specific Fluid"), tFluid.getLocalizedName()));
+ if (mMode == 8) GT_Utility.sendChatToPlayer(
+ 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()));
}
return true;
}
@@ -350,8 +358,8 @@ 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) {
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX,
+ float aY, float aZ) {
if (tryToLockHatch(aPlayer, aSide)) return true;
return super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ);
}
@@ -425,7 +433,8 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
GT_Utility.sendChatToPlayer(
player,
String.format(
- GT_Utility.trans("151.4", "Successfully locked Fluid to %s"), mFluid.getLocalizedName()));
+ GT_Utility.trans("151.4", "Successfully locked Fluid to %s"),
+ mFluid.getLocalizedName()));
playerThatLockedfluid = null;
}
}
@@ -437,21 +446,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()))
- };
+ 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())) };
}
@Override
@@ -462,36 +470,26 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
@Override
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))
+ 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))
+ 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))
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 ad1c799708..094ad29471 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
@@ -4,8 +4,13 @@ import static gregtech.api.enums.Textures.BlockIcons.ITEM_OUT_SIGN;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_OUT;
import static gregtech.api.util.GT_Utility.moveMultipleItemStacks;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
+
import gregtech.GT_Mod;
import gregtech.api.gui.modularui.GT_UIInfos;
import gregtech.api.interfaces.ITexture;
@@ -15,11 +20,9 @@ import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.extensions.ArrayExt;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch implements IAddUIWidgets {
+
public GT_MetaTileEntity_Hatch_OutputBus(int aID, String aName, String aNameRegional, int aTier) {
this(aID, aName, aNameRegional, aTier, getSlots(aTier));
}
@@ -36,13 +39,13 @@ public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch i
"Capacity: " + getSlots(tier) + " stack" + (getSlots(tier) >= 2 ? "s" : "")));
}
- public GT_MetaTileEntity_Hatch_OutputBus(
- int aID, String aName, String aNameRegional, int aTier, String[] aDescription) {
+ public GT_MetaTileEntity_Hatch_OutputBus(int aID, String aName, String aNameRegional, int aTier,
+ 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) {
+ public GT_MetaTileEntity_Hatch_OutputBus(int aID, String aName, String aNameRegional, int aTier,
+ String[] aDescription, int inventorySize) {
super(aID, aName, aNameRegional, aTier, inventorySize, aDescription);
}
@@ -57,23 +60,23 @@ public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch i
super(aName, aTier, getSlots(aTier), aDescription, aTextures);
}
- public GT_MetaTileEntity_Hatch_OutputBus(
- String name, int tier, int slots, String[] description, ITexture[][][] textures) {
+ public GT_MetaTileEntity_Hatch_OutputBus(String name, int tier, int slots, String[] description,
+ 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
@@ -108,11 +111,11 @@ public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch i
}
/**
- * Attempt to store as many items as possible into the internal inventory of this output bus.
- * If you need atomicity you should use {@link gregtech.api.interfaces.tileentity.IHasInventory#addStackToSlot(int, ItemStack)}
- * @param aStack Assume valid.
- * Will be mutated.
- * Take over the ownership. Caller should not retain a reference to this stack if the call returns true.
+ * Attempt to store as many items as possible into the internal inventory of this output bus. If you need atomicity
+ * you should use {@link gregtech.api.interfaces.tileentity.IHasInventory#addStackToSlot(int, ItemStack)}
+ *
+ * @param aStack Assume valid. Will be mutated. Take over the ownership. Caller should not retain a reference to
+ * this stack if the call returns true.
* @return true if stack is fully accepted. false is stack is partially accepted or nothing is accepted
*/
public boolean storeAll(ItemStack aStack) {
@@ -127,8 +130,7 @@ public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch i
mInventory[i] = aStack.splitStack(getInventoryStackLimit());
} else {
int tRealStackLimit = Math.min(getInventoryStackLimit(), tSlot.getMaxStackSize());
- if (tSlot.stackSize < tRealStackLimit
- && tSlot.isItemEqual(aStack)
+ if (tSlot.stackSize < tRealStackLimit && tSlot.isItemEqual(aStack)
&& ItemStack.areItemStackTagsEqual(tSlot, aStack)) {
if (aStack.stackSize + tSlot.stackSize <= tRealStackLimit) {
mInventory[i].stackSize += aStack.stackSize;
@@ -158,8 +160,8 @@ 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,
@@ -175,9 +177,9 @@ public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch i
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,
- // aBaseMetaTileEntity.getFrontFacing(), aBaseMetaTileEntity.getBackFacing(),
- // null, false, (byte) 64, (byte) 1, (byte)( 64 *
+ // GT_Utility.moveOneItemStack(aBaseMetaTileEntity, tTileEntity,
+ // aBaseMetaTileEntity.getFrontFacing(), aBaseMetaTileEntity.getBackFacing(),
+ // null, false, (byte) 64, (byte) 1, (byte)( 64 *
// aBaseMetaTileEntity.getSizeInventory()), (byte) 1);
}
}
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 ae08a5eb02..e6ea51c59d 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
@@ -5,6 +5,25 @@ import static mcp.mobius.waila.api.SpecialChars.GREEN;
import static mcp.mobius.waila.api.SpecialChars.RED;
import static mcp.mobius.waila.api.SpecialChars.RESET;
+import java.util.ArrayList;
+import java.util.List;
+
+import mcp.mobius.waila.api.IWailaConfigHandler;
+import mcp.mobius.waila.api.IWailaDataAccessor;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
+import org.lwjgl.input.Keyboard;
+
import com.google.common.collect.Iterables;
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
@@ -13,6 +32,7 @@ import com.gtnewhorizons.modularui.common.widget.DynamicPositionedColumn;
import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget;
import com.gtnewhorizons.modularui.common.widget.SlotWidget;
import com.gtnewhorizons.modularui.common.widget.TextWidget;
+
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ConfigCategories;
@@ -31,43 +51,16 @@ import gregtech.common.GT_Pollution;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase;
import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeTurbine;
-import java.util.ArrayList;
-import java.util.List;
-import mcp.mobius.waila.api.IWailaConfigHandler;
-import mcp.mobius.waila.api.IWailaDataAccessor;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
-import org.lwjgl.input.Keyboard;
public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
implements IAddGregtechLogo, IAddUIWidgets {
public static boolean disableMaintenance;
- public boolean mMachine = false,
- mWrench = false,
- mScrewdriver = false,
- mSoftHammer = false,
- mHardHammer = false,
- mSolderingTool = false,
- mCrowbar = false,
- mRunningOnLoad = false;
+ public boolean mMachine = false, mWrench = false, mScrewdriver = false, mSoftHammer = false, mHardHammer = 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;
+ public int mPollution = 0, mProgresstime = 0, mMaxProgresstime = 0, mEUt = 0, mEfficiencyIncrease = 0,
+ mStartUpCheck = 100, mRuntime = 0, mEfficiency = 0;
public volatile boolean mUpdated = false;
public int mUpdate = 0;
public ItemStack[] mOutputItems = null;
@@ -91,23 +84,23 @@ 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) {
@@ -137,7 +130,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;
@@ -193,19 +187,17 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
if (mOutputItems != null) {
aNBT.setInteger("mOutputItemsLength", mOutputItems.length);
- for (int i = 0; i < mOutputItems.length; i++)
- if (mOutputItems[i] != null) {
- GT_Utility.saveItem(aNBT, "mOutputItem" + i, mOutputItems[i]);
- }
+ for (int i = 0; i < mOutputItems.length; i++) if (mOutputItems[i] != null) {
+ GT_Utility.saveItem(aNBT, "mOutputItem" + i, mOutputItems[i]);
+ }
}
if (mOutputFluids != null) {
aNBT.setInteger("mOutputFluidsLength", mOutputFluids.length);
- for (int i = 0; i < mOutputFluids.length; i++)
- if (mOutputFluids[i] != null) {
- NBTTagCompound tNBT = new NBTTagCompound();
- mOutputFluids[i].writeToNBT(tNBT);
- aNBT.setTag("mOutputFluids" + i, tNBT);
- }
+ for (int i = 0; i < mOutputFluids.length; i++) if (mOutputFluids[i] != null) {
+ NBTTagCompound tNBT = new NBTTagCompound();
+ mOutputFluids[i].writeToNBT(tNBT);
+ aNBT.setTag("mOutputFluids" + i, tNBT);
+ }
}
aNBT.setBoolean("mWrench", mWrench);
aNBT.setBoolean("mScrewdriver", mScrewdriver);
@@ -273,8 +265,8 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
}
/**
- * ClearHatches as a part of structure check.
- * If your multiblock has any hatches that need clearing override this method, call super, and clear your own hatches
+ * ClearHatches as a part of structure check. If your multiblock has any hatches that need clearing override this
+ * method, call super, and clear your own hatches
*/
public void clearHatches() {
mInputHatches.clear();
@@ -327,14 +319,14 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
stopMachine();
}
}
- 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.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.setActive(mMaxProgresstime > 0);
boolean active = aBaseMetaTileEntity.isActive() && mPollution > 0;
setMufflers(active);
@@ -389,19 +381,15 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
stopMachine();
}
if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime) {
- if (mOutputItems != null)
- for (ItemStack tStack : mOutputItems)
- if (tStack != null) {
- try {
- GT_Mod.achievements.issueAchivementHatch(
- aBaseMetaTileEntity
- .getWorld()
- .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()),
- tStack);
- } catch (Exception ignored) {
- }
- addOutput(tStack);
- }
+ if (mOutputItems != null) for (ItemStack tStack : mOutputItems) if (tStack != null) {
+ try {
+ GT_Mod.achievements.issueAchivementHatch(
+ aBaseMetaTileEntity.getWorld()
+ .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()),
+ tStack);
+ } catch (Exception ignored) {}
+ addOutput(tStack);
+ }
if (mOutputFluids != null) {
addFluidOutputs(mOutputFluids);
}
@@ -421,19 +409,16 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
if (mOutputFluids.length > 1) {
try {
GT_Mod.achievements.issueAchievement(
- aBaseMetaTileEntity
- .getWorld()
+ aBaseMetaTileEntity.getWorld()
.getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()),
"oilplant");
- } catch (Exception ignored) {
- }
+ } catch (Exception ignored) {}
}
}
}
}
} else {
- if (aTick % 100 == 0
- || aBaseMetaTileEntity.hasWorkJustBeenEnabled()
+ if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()
|| aBaseMetaTileEntity.hasInventoryBeenModified()) {
if (aBaseMetaTileEntity.isAllowedToWork()) {
@@ -511,8 +496,8 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
}
/**
- * Gets the pollution produced per second by this multiblock, default to 0. Override this with
- * its actual value in the code of the multiblock.
+ * Gets the pollution produced per second by this multiblock, default to 0. Override this with its actual value in
+ * the code of the multiblock.
*/
public int getPollutionPerSecond(ItemStack aStack) {
return 0;
@@ -544,8 +529,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
}
public int getRepairStatus() {
- return (mWrench ? 1 : 0)
- + (mScrewdriver ? 1 : 0)
+ return (mWrench ? 1 : 0) + (mScrewdriver ? 1 : 0)
+ (mSoftHammer ? 1 : 0)
+ (mHardHammer ? 1 : 0)
+ (mSolderingTool ? 1 : 0)
@@ -590,18 +574,14 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
break;
}
}
- if (mInventory[1] != null
- && getBaseMetaTileEntity().getRandomNumber(2) == 0
+ if (mInventory[1] != null && getBaseMetaTileEntity().getRandomNumber(2) == 0
&& !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)));
+ ((GT_MetaGenerated_Tool) mInventory[1].getItem()).doDamage(
+ 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;
}
}
@@ -612,10 +592,14 @@ 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;
@@ -703,21 +687,21 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
public long getMaxInputVoltage() {
long rVoltage = 0;
for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches)
- if (isValidMetaTileEntity(tHatch))
- rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage();
+ if (isValidMetaTileEntity(tHatch)) rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage();
return rVoltage;
}
/**
* Calcualtes the overclockedness using long integers
- * @param aEUt - recipe EUt
- * @param aDuration - recipe Duration
- * @param mAmperage - should be 1 ?
- * @param maxInputVoltage - Multiblock Max input voltage
- * @param perfectOC - If the Multiblock OCs perfectly, i.e. the large Chemical Reactor
+ *
+ * @param aEUt - recipe EUt
+ * @param aDuration - recipe Duration
+ * @param mAmperage - should be 1 ?
+ * @param maxInputVoltage - Multiblock Max input voltage
+ * @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) {
+ protected void calculateOverclockedNessMultiInternal(long aEUt, int aDuration, int mAmperage, long maxInputVoltage,
+ boolean perfectOC) {
byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage));
if (mTier == 0) {
// Long time calculation
@@ -784,16 +768,13 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
public boolean drainEnergyInput(long aEU) {
if (aEU <= 0) return true;
- for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches)
- if (isValidMetaTileEntity(tHatch)) {
- if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)) return true;
- }
+ for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) if (isValidMetaTileEntity(tHatch)) {
+ if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)) return true;
+ }
return false;
}
- protected static boolean dumpFluid(
- List<GT_MetaTileEntity_Hatch_Output> aOutputHatches,
- FluidStack copiedFluidStack,
+ protected static boolean dumpFluid(List<GT_MetaTileEntity_Hatch_Output> aOutputHatches, FluidStack copiedFluidStack,
boolean restrictiveHatchesOnly) {
for (GT_MetaTileEntity_Hatch_Output tHatch : aOutputHatches) {
if (!isValidMetaTileEntity(tHatch) || (restrictiveHatchesOnly && tHatch.mMode == 0)) {
@@ -871,8 +852,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) {
tHatch.mRecipeMap = getRecipeMap();
if (isValidMetaTileEntity(tHatch)) {
- if (GT_Utility.areStacksEqual(
- aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(0))) {
+ if (GT_Utility.areStacksEqual(aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(0))) {
if (tHatch.getBaseMetaTileEntity().getStackInSlot(0).stackSize >= aStack.stackSize) {
tHatch.getBaseMetaTileEntity().decrStackSize(0, aStack.stackSize);
return true;
@@ -884,8 +864,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
tHatch.mRecipeMap = getRecipeMap();
if (isValidMetaTileEntity(tHatch)) {
for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
- if (GT_Utility.areStacksEqual(
- aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(i))) {
+ if (GT_Utility.areStacksEqual(aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(i))) {
if (tHatch.getBaseMetaTileEntity().getStackInSlot(i).stackSize >= aStack.stackSize) {
tHatch.getBaseMetaTileEntity().decrStackSize(i, aStack.stackSize);
return true;
@@ -899,11 +878,11 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
public ArrayList<ItemStack> getStoredOutputs() {
ArrayList<ItemStack> rList = new ArrayList<>();
- // for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) {
- // if (isValidMetaTileEntity(tHatch)) {
- // rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(1));
- // }
- // }
+ // for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) {
+ // if (isValidMetaTileEntity(tHatch)) {
+ // rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(1));
+ // }
+ // }
for (GT_MetaTileEntity_Hatch_OutputBus tHatch : mOutputBusses) {
if (isValidMetaTileEntity(tHatch)) {
for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
@@ -974,8 +953,8 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
if (isValidMetaTileEntity(tHatch)) tHatch.endRecipeProcessing();
}
- protected static <T extends GT_MetaTileEntity_Hatch> T identifyHatch(
- IGregTechTileEntity aTileEntity, int aBaseCasingIndex, Class<T> clazz) {
+ protected static <T extends GT_MetaTileEntity_Hatch> T identifyHatch(IGregTechTileEntity aTileEntity,
+ int aBaseCasingIndex, Class<T> clazz) {
if (aTileEntity == null) return null;
IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
if (!clazz.isInstance(aMetaTileEntity)) return null;
@@ -1148,29 +1127,55 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
}
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
- + Float.toString(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
+ + Float.toString(mEfficiency / 100.0F)
+ + EnumChatFormatting.RESET
+ + " %",
+ /* 6 */ StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": "
+ + EnumChatFormatting.GREEN
+ + mPollutionReduction
+ + EnumChatFormatting.RESET
+ + " %" };
}
@Override
@@ -1230,29 +1235,34 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
}
@Override
- public void getWailaBody(
- ItemStack itemStack, List<String> currentTip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
+ public void getWailaBody(ItemStack itemStack, List<String> currentTip, IWailaDataAccessor accessor,
+ 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") + "%");
+ currentTip.add(
+ (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)));
+ currentTip.add(
+ 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)));
+ currentTip.add(
+ StatCollector.translateToLocalFormatted(
+ "GT5U.waila.energy.produce",
+ GT_Utility.formatNumbers(-actualEnergyUsage),
+ GT_Utility.getColoredTierNameFromVoltage(-actualEnergyUsage)));
}
}
currentTip.add(
@@ -1262,8 +1272,8 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
}
@Override
- public void getWailaNBTData(
- EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, int z) {
+ public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y,
+ int z) {
super.getWailaNBTData(player, tile, tag, world, x, y, z);
tag.setBoolean("hasProblems", (getIdealStatus() - getRepairStatus()) > 0);
@@ -1334,10 +1344,8 @@ 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(7, 4)
- .setSize(143, 75));
+ builder.widget(
+ new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(7, 4).setSize(143, 75));
final SlotWidget inventorySlot = new SlotWidget(inventoryHandler, 1);
builder.widget(inventorySlot.setPos(151, 4));
@@ -1353,94 +1361,99 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
screenElements.setSynced(false).setSpace(0).setPos(10, 7);
screenElements
- .widget(new TextWidget(GT_Utility.trans("132", "Pipe is loose."))
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mWrench))
+ .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(new TextWidget(GT_Utility.trans("133", "Screws are loose."))
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mScrewdriver))
+ .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(new TextWidget(GT_Utility.trans("134", "Something is stuck."))
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mSoftHammer))
+ .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(new TextWidget(GT_Utility.trans("135", "Platings are dented."))
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mHardHammer))
+ .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(new TextWidget(GT_Utility.trans("136", "Circuitry burned out."))
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mSolderingTool))
+ .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(new TextWidget(GT_Utility.trans("137", "That doesn't belong there."))
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mCrowbar))
+ .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(new TextWidget(GT_Utility.trans("138", "Incomplete Structure."))
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mMachine))
+ .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));
- screenElements.widget(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));
+ screenElements.widget(
+ 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));
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)));
- 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()));
- 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()));
- screenElements.widget(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;
- }));
- 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
+ .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)));
+ 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()));
+ 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()));
+ screenElements.widget(
+ 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;
+ }));
+ 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;
- }));
+ }
+ return false;
+ }));
}
}
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 f146b39635..6becb5e806 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
@@ -1,5 +1,11 @@
package gregtech.api.metatileentity.implementations;
+import java.util.Collections;
+import java.util.List;
+
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+
import com.gtnewhorizons.modularui.api.drawable.Text;
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
@@ -8,35 +14,33 @@ import com.gtnewhorizons.modularui.common.widget.ButtonWidget;
import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
import com.gtnewhorizons.modularui.common.widget.SlotGroup;
import com.gtnewhorizons.modularui.common.widget.SlotWidget;
+
import gregtech.api.gui.modularui.GT_UITextures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.modularui.IAddUIWidgets;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Utility;
-import java.util.Collections;
-import java.util.List;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
public abstract class GT_MetaTileEntity_SpecialFilter extends GT_MetaTileEntity_Buffer implements IAddUIWidgets {
+
public static final int BUFFER_SLOT_COUNT = 9;
public static final int SPECIAL_SLOT_INDEX = 9;
public boolean bNBTAllowed = false;
public boolean bInvertFilter = false;
- public GT_MetaTileEntity_SpecialFilter(
- int aID, String aName, String aNameRegional, int aTier, String[] aDescription) {
+ public GT_MetaTileEntity_SpecialFilter(int aID, String aName, String aNameRegional, int aTier,
+ 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) {
+ public GT_MetaTileEntity_SpecialFilter(String aName, int aTier, int aInvSlotCount, String aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
- public GT_MetaTileEntity_SpecialFilter(
- String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_SpecialFilter(String aName, int aTier, int aInvSlotCount, String[] aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
@@ -83,73 +87,61 @@ public abstract class GT_MetaTileEntity_SpecialFilter extends GT_MetaTileEntity_
addEmitEnergyButton(builder);
addEmitRedstoneButton(builder);
addInvertRedstoneButton(builder);
- builder.widget(new ButtonWidget()
- .setOnClick((clickData, widget) -> {
- bInvertFilter = !bInvertFilter;
- if (bInvertFilter) {
- GT_Utility.sendChatToPlayer(
- widget.getContext().getPlayer(), GT_Utility.trans("124", "Invert Filter"));
- } else {
- GT_Utility.sendChatToPlayer(
- 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)
+ builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> {
+ bInvertFilter = !bInvertFilter;
+ if (bInvertFilter) {
+ GT_Utility.sendChatToPlayer(widget.getContext().getPlayer(), GT_Utility.trans("124", "Invert Filter"));
+ } else {
+ GT_Utility.sendChatToPlayer(
+ 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 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));
+ 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));
}
}
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 21267f983e..9c069bbd5f 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
@@ -6,6 +6,7 @@ import static gregtech.api.metatileentity.BaseTileEntity.BATTERY_SLOT_TOOLTIP_AL
import static gregtech.api.metatileentity.BaseTileEntity.TOOLTIP_DELAY;
import com.gtnewhorizons.modularui.common.widget.SlotWidget;
+
import gregtech.api.enums.GT_Values;
import gregtech.api.gui.modularui.GT_UITextures;
import gregtech.api.interfaces.ITexture;
@@ -14,9 +15,9 @@ import gregtech.api.util.GT_Utility;
import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_Cleanroom;
public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntity {
+
/**
- * Value between [0 - 9] to describe the Tier of this Machine.
- * PLZ [0-15] works - READ! GT_Values class.
+ * Value between [0 - 9] to describe the Tier of this Machine. PLZ [0-15] works - READ! GT_Values class.
*/
public final byte mTier;
@@ -33,31 +34,19 @@ 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) {
+ public GT_MetaTileEntity_TieredMachineBlock(int aID, String aName, String aNameRegional, int aTier,
+ 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};
+ mDescriptionArray = aDescription == null ? new String[0] : new String[] { aDescription };
mDescription = mDescriptionArray.length > 0 ? mDescriptionArray[0] : "";
// must always be the last call!
if (GT.isClientSide()) mTextures = getTextureSet(aTextures);
else mTextures = null;
}
- public GT_MetaTileEntity_TieredMachineBlock(
- int aID,
- String aName,
- String aNameRegional,
- int aTier,
- int aInvSlotCount,
- String[] aDescription,
- ITexture... aTextures) {
+ public GT_MetaTileEntity_TieredMachineBlock(int aID, String aName, String aNameRegional, int aTier,
+ 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;
@@ -73,17 +62,17 @@ public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntit
return GT_MetaTileEntity_Cleanroom.class;
}
- public GT_MetaTileEntity_TieredMachineBlock(
- String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_TieredMachineBlock(String aName, int aTier, int aInvSlotCount, String aDescription,
+ ITexture[][][] aTextures) {
super(aName, aInvSlotCount);
mTier = (byte) aTier;
- mDescriptionArray = aDescription == null ? new String[0] : new String[] {aDescription};
+ mDescriptionArray = aDescription == null ? new String[0] : new String[] { aDescription };
mDescription = mDescriptionArray.length > 0 ? mDescriptionArray[0] : "";
mTextures = aTextures;
}
- public GT_MetaTileEntity_TieredMachineBlock(
- String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_TieredMachineBlock(String aName, int aTier, int aInvSlotCount, String[] aDescription,
+ ITexture[][][] aTextures) {
super(aName, aInvSlotCount);
mTier = (byte) aTier;
mDescriptionArray = aDescription == null ? new String[0] : aDescription;
@@ -112,8 +101,8 @@ public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntit
}
/**
- * Used Client Side to get a Texture Set for this Block.
- * Called after setting the Tier and the Description so that those two are accessible.
+ * Used Client Side to get a Texture Set for this Block. Called after setting the Tier and the Description so that
+ * those two are accessible.
*
* @param aTextures is the optional Array you can give to the Constructor.
*/
@@ -125,20 +114,17 @@ public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntit
final String pTier1 = GT_Utility.getColoredTierNameFromTier(mTier);
if (mTier == GT_Values.VN.length - 1) {
batterySlotTooltipKey = BATTERY_SLOT_TOOLTIP_ALT;
- batterySlotTooltipArgs = new String[] {pTier1};
+ batterySlotTooltipArgs = new String[] { pTier1 };
} else {
batterySlotTooltipKey = BATTERY_SLOT_TOOLTIP;
- batterySlotTooltipArgs = new String[] {pTier1, GT_Utility.getColoredTierNameFromTier((byte) (mTier + 1))};
+ batterySlotTooltipArgs = new String[] { pTier1, GT_Utility.getColoredTierNameFromTier((byte) (mTier + 1)) };
}
return createChargerSlot(x, y, batterySlotTooltipKey, batterySlotTooltipArgs);
}
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);
+ 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);
}
}
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 e564c65d21..a4c42dd14d 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
@@ -1,18 +1,21 @@
package gregtech.api.metatileentity.implementations;
+import java.util.concurrent.atomic.AtomicReferenceArray;
+
+import org.lwjgl.input.Keyboard;
+
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.ISecondaryDescribable;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
-import java.util.concurrent.atomic.AtomicReferenceArray;
-import org.lwjgl.input.Keyboard;
/**
* A multiblock with tooltip {@link GT_Multiblock_Tooltip_Builder}
*/
public abstract class GT_MetaTileEntity_TooltipMultiBlockBase extends GT_MetaTileEntity_MultiBlockBase
implements ISecondaryDescribable {
- private static final AtomicReferenceArray<GT_Multiblock_Tooltip_Builder> tooltips =
- new AtomicReferenceArray<>(GregTech_API.METATILEENTITIES.length);
+
+ private static final AtomicReferenceArray<GT_Multiblock_Tooltip_Builder> tooltips = new AtomicReferenceArray<>(
+ 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 0f6f6249a5..a70ee0d5e7 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
@@ -7,6 +7,19 @@ import static mcp.mobius.waila.api.SpecialChars.GREEN;
import static mcp.mobius.waila.api.SpecialChars.RED;
import static mcp.mobius.waila.api.SpecialChars.RESET;
+import java.util.List;
+
+import mcp.mobius.waila.api.IWailaConfigHandler;
+import mcp.mobius.waila.api.IWailaDataAccessor;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+
import cofh.api.energy.IEnergyProvider;
import cofh.api.energy.IEnergyStorage;
import crazypants.enderio.machine.capbank.TileCapBank;
@@ -19,24 +32,15 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Utility;
-import java.util.List;
-import mcp.mobius.waila.api.IWailaConfigHandler;
-import mcp.mobius.waila.api.IWailaDataAccessor;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
* <p/>
- * This is the main construct for my Basic Machines such as the Automatic Extractor
- * Extend this class to make a simple Machine
+ * This is the main construct for my Basic Machines such as the Automatic Extractor Extend this class to make a simple
+ * Machine
*/
public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachineBlock {
+
public GT_MetaTileEntity_Transformer(int aID, String aName, String aNameRegional, int aTier, String aDescription) {
super(aID, aName, aNameRegional, aTier, 0, aDescription);
}
@@ -53,57 +57,39 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi
public ITexture[][][] getTextureSet(ITexture[] aTextures) {
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]
- };
- rTextures[1][i + 1] = new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], 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]
- };
- rTextures[3][i + 1] = new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], 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]
- };
- rTextures[5][i + 1] = new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], 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]
- };
- rTextures[7][i + 1] = new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], 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]
- };
- rTextures[9][i + 1] = new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], 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]
- };
- rTextures[11][i + 1] = new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]
- };
+ rTextures[0][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
+ 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] };
+ rTextures[2][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
+ 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] };
+ rTextures[4][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
+ 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] };
+ rTextures[6][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
+ 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] };
+ rTextures[8][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
+ 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] };
+ rTextures[10][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1],
+ 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] };
}
return rTextures;
}
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- boolean aActive,
- boolean aRedstone) {
- return mTextures[
- Math.min(2, aSide) + (aSide == aFacing ? 3 : 0) + (aBaseMetaTileEntity.isAllowedToWork() ? 0 : 6)][
- aColorIndex + 1];
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ boolean aActive, boolean aRedstone) {
+ return mTextures[Math.min(2, aSide) + (aSide == aFacing ? 3 : 0)
+ + (aBaseMetaTileEntity.isAllowedToWork() ? 0 : 6)][aColorIndex + 1];
}
@Override
@@ -138,8 +124,7 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi
@Override
public boolean isInputFacing(byte aSide) {
- return getBaseMetaTileEntity().isAllowedToWork()
- ? aSide == getBaseMetaTileEntity().getFrontFacing()
+ return getBaseMetaTileEntity().isAllowedToWork() ? aSide == getBaseMetaTileEntity().getFrontFacing()
: aSide != getBaseMetaTileEntity().getFrontFacing();
}
@@ -190,55 +175,50 @@ 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) {
- long tEU = (long) ((IEnergyProvider) tTileEntity)
- .extractEnergy(
- ForgeDirection.getOrientation(GT_Utility.getOppositeSide(i)),
- GT_Utility.safeInt(maxEUInput() * 100L / GregTech_API.mRFtoEU),
- false);
+ if (tTileEntity instanceof IEnergyProvider && ((IEnergyProvider) tTileEntity)
+ .extractEnergy(ForgeDirection.getOrientation(GT_Utility.getOppositeSide(i)), 1, true)
+ == 1) {
+ long tEU = (long) ((IEnergyProvider) tTileEntity).extractEnergy(
+ 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 = (long) ((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 {
- ((IPowerContainer) tTileEntity).setEnergyStored(0);
- tEU = storedRF * (long) GregTech_API.mRFtoEU / 100L;
- }
- }
- aBaseMetaTileEntity.injectEnergyUnits((byte) 6, Math.min(tEU, maxEUInput()), 1);
- }
+ long tEU = (long) ((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 {
+ ((IPowerContainer) tTileEntity).setEnergyStored(0);
+ tEU = storedRF * (long) GregTech_API.mRFtoEU / 100L;
+ }
+ }
+ aBaseMetaTileEntity.injectEnergyUnits((byte) 6, Math.min(tEU, maxEUInput()), 1);
+ }
}
}
}
@@ -270,10 +250,8 @@ 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()
+ 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: ")
@@ -289,8 +267,8 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi
}
@Override
- public void getWailaBody(
- ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
+ public void getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
+ IWailaConfigHandler config) {
final int facing = getBaseMetaTileEntity().getFrontFacing();
final NBTTagCompound tag = accessor.getNBTData();
final int side = (byte) accessor.getSide().ordinal();
@@ -299,40 +277,43 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi
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")));
+ 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")));
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")));
+ currenttip.add(
+ 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")));
+ currenttip.add(
+ 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);
}
@Override
- public void getWailaNBTData(
- EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, int z) {
+ public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y,
+ 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 41b898b582..997898a34e 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
@@ -2,15 +2,16 @@ package gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.GT_Values.*;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.IGlobalWirelessEnergy;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.interfaces.tileentity.IWirelessEnergyHatchInformation;
import gregtech.api.metatileentity.MetaTileEntity;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
public class GT_MetaTileEntity_Wireless_Dynamo extends GT_MetaTileEntity_Hatch_Dynamo
implements IGlobalWirelessEnergy, IWirelessEnergyHatchInformation {
@@ -18,23 +19,23 @@ public class GT_MetaTileEntity_Wireless_Dynamo extends GT_MetaTileEntity_Hatch_D
private String owner_uuid;
private String owner_name;
- public GT_MetaTileEntity_Wireless_Dynamo(
- String aName, byte aTier, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_Wireless_Dynamo(String aName, byte aTier, String[] aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
}
public GT_MetaTileEntity_Wireless_Dynamo(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, new String[] {""});
+ super(aID, aName, aNameRegional, aTier, new String[] { "" });
}
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[] {aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI_WIRELESS_ON[mTier]};
+ return new ITexture[] { aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI_WIRELESS_ON[mTier] };
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[] {aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI_WIRELESS_ON[mTier]};
+ return new ITexture[] { aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI_WIRELESS_ON[mTier] };
}
@Override
@@ -84,11 +85,9 @@ 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
- };
+ 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 };
}
@Override
@@ -103,7 +102,7 @@ public class GT_MetaTileEntity_Wireless_Dynamo extends GT_MetaTileEntity_Hatch_D
@Override
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Wireless_Dynamo(mName, mTier, new String[] {""}, mTextures);
+ return new GT_MetaTileEntity_Wireless_Dynamo(mName, mTier, new String[] { "" }, mTextures);
}
@Override
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 218f15c8c0..756a1b138a 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
@@ -2,22 +2,24 @@ package gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.GT_Values.*;
+import java.math.BigInteger;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.IGlobalWirelessEnergy;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.interfaces.tileentity.IWirelessEnergyHatchInformation;
import gregtech.api.metatileentity.MetaTileEntity;
-import java.math.BigInteger;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
public class GT_MetaTileEntity_Wireless_Hatch extends GT_MetaTileEntity_Hatch_Energy
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;
@@ -28,26 +30,24 @@ public class GT_MetaTileEntity_Wireless_Hatch extends GT_MetaTileEntity_Hatch_En
}
public GT_MetaTileEntity_Wireless_Hatch(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, new String[] {""});
+ super(aID, aName, aNameRegional, aTier, new String[] { "" });
}
@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
- };
+ 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 };
}
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[] {aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI_WIRELESS_ON[mTier]};
+ return new ITexture[] { aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI_WIRELESS_ON[mTier] };
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[] {aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI_WIRELESS_ON[mTier]};
+ return new ITexture[] { aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI_WIRELESS_ON[mTier] };
}
@Override
@@ -107,7 +107,7 @@ public class GT_MetaTileEntity_Wireless_Hatch extends GT_MetaTileEntity_Hatch_En
@Override
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Wireless_Hatch(mName, mTier, new String[] {""}, mTextures);
+ return new GT_MetaTileEntity_Wireless_Hatch(mName, mTier, new String[] { "" }, mTextures);
}
@Override