aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2017-03-04 12:58:47 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2017-03-04 12:58:47 +1000
commitae21012d216df71f31aed6fbc9d76215fc24ceed (patch)
treecc89accbe6ce5c04b72ed3c5e46b2a185f88be6a /src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java
parentba89972a22a316030f8c3bd99974f915b1d7aefc (diff)
downloadGT5-Unofficial-ae21012d216df71f31aed6fbc9d76215fc24ceed.tar.gz
GT5-Unofficial-ae21012d216df71f31aed6fbc9d76215fc24ceed.tar.bz2
GT5-Unofficial-ae21012d216df71f31aed6fbc9d76215fc24ceed.zip
+ New texture for the slow builders ring.
+ Added the Alkalus Disk. $ Fixed Frame Box Assembler Recipes. $ Fixed Missing 7Li material. $ Fixed Tiered Tanks not showing their capacity in the tooltip. $ Fixed tooltips for alloys containing Bronze or Steel. $ Fixed Clay Pipe Extruder Recipes. - Removed a handful of Plasma cells for misc. materials. % Changed the Industrial Coke Oven's tooltip, to better describe the input/output requirements. % Cleaned up The Entire Project.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java291
1 files changed, 159 insertions, 132 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java
index 3dbf274393..a3a800fa59 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java
@@ -1,6 +1,11 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.GT_Values.D1;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map.Entry;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.*;
import gregtech.api.interfaces.ITexture;
@@ -14,10 +19,6 @@ import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
-
-import java.util.*;
-import java.util.Map.Entry;
-
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
@@ -36,55 +37,55 @@ public class GregtechMetaPipeEntityFluid extends MetaPipeEntity {
public FluidStack mFluid;
public byte mLastReceivedFrom = 0, oLastReceivedFrom = 0;
- public GregtechMetaPipeEntityFluid(int aID, String aName, String aNameRegional, float aThickNess, GT_Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof) {
+ public GregtechMetaPipeEntityFluid(final int aID, final String aName, final String aNameRegional, final float aThickNess, final GT_Materials aMaterial, final int aCapacity, final int aHeatResistance, final boolean aGasProof) {
super(aID, aName, aNameRegional, 0);
- mThickNess = aThickNess;
- mMaterial = aMaterial;
- mCapacity = aCapacity;
- mGasProof = aGasProof;
- mHeatResistance = aHeatResistance;
+ this.mThickNess = aThickNess;
+ this.mMaterial = aMaterial;
+ this.mCapacity = aCapacity;
+ this.mGasProof = aGasProof;
+ this.mHeatResistance = aHeatResistance;
}
- public GregtechMetaPipeEntityFluid(String aName, float aThickNess, GT_Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof) {
+ public GregtechMetaPipeEntityFluid(final String aName, final float aThickNess, final GT_Materials aMaterial, final int aCapacity, final int aHeatResistance, final boolean aGasProof) {
super(aName, 0);
- mThickNess = aThickNess;
- mMaterial = aMaterial;
- mCapacity = aCapacity;
- mGasProof = aGasProof;
- mHeatResistance = aHeatResistance;
+ this.mThickNess = aThickNess;
+ this.mMaterial = aMaterial;
+ this.mCapacity = aCapacity;
+ this.mGasProof = aGasProof;
+ this.mHeatResistance = aHeatResistance;
}
@Override
public byte getTileEntityBaseType() {
- return mMaterial == null ? 4 : (byte) ((mMaterial.contains(SubTag.WOOD) ? 12 : 4) + Math.max(0, Math.min(3, mMaterial.mToolQuality)));
+ return this.mMaterial == null ? 4 : (byte) ((this.mMaterial.contains(SubTag.WOOD) ? 12 : 4) + Math.max(0, Math.min(3, this.mMaterial.mToolQuality)));
}
@Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMetaPipeEntityFluid(mName, mThickNess, mMaterial, mCapacity, mHeatResistance, mGasProof);
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaPipeEntityFluid(this.mName, this.mThickNess, this.mMaterial, this.mCapacity, this.mHeatResistance, this.mGasProof);
}
@Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
+ public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aConnections, final byte aColorIndex, final boolean aConnected, final boolean aRedstone) {
- short[] colours = Dyes.getModulation(aColorIndex, mMaterial.mRGBa);
+ final short[] colours = Dyes.getModulation(aColorIndex, this.mMaterial.mRGBa);
if (aConnected) {
- float tThickNess = getThickNess();
+ final float tThickNess = this.getThickNess();
if (tThickNess < 0.37F){
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], colours)};
+ return new ITexture[]{new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], colours)};
}
if (tThickNess < 0.49F){
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], colours)};
+ return new ITexture[]{new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], colours)};
}
if (tThickNess < 0.74F){
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], colours)};
+ return new ITexture[]{new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], colours)};
}
if (tThickNess < 0.99F){
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], colours)};
- }
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], colours)};
+ return new ITexture[]{new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], colours)};
+ }
+ return new ITexture[]{new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], colours)};
}
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], colours)};
+ return new ITexture[]{new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], colours)};
}
@Override
@@ -93,46 +94,48 @@ public class GregtechMetaPipeEntityFluid extends MetaPipeEntity {
}
@Override
- public boolean isFacingValid(byte aFacing) {
+ public boolean isFacingValid(final byte aFacing) {
return false;
}
@Override
- public boolean isValidSlot(int aIndex) {
+ public boolean isValidSlot(final int aIndex) {
return false;
}
@Override
- public final boolean renderInside(byte aSide) {
+ public final boolean renderInside(final byte aSide) {
return false;
}
@Override
public int getProgresstime() {
- return getFluidAmount();
+ return this.getFluidAmount();
}
@Override
public int maxProgresstime() {
- return getCapacity();
+ return this.getCapacity();
}
@Override
- public void saveNBTData(NBTTagCompound aNBT) {
- if (mFluid != null) aNBT.setTag("mFluid", mFluid.writeToNBT(new NBTTagCompound()));
- aNBT.setByte("mLastReceivedFrom", mLastReceivedFrom);
+ public void saveNBTData(final NBTTagCompound aNBT) {
+ if (this.mFluid != null) {
+ aNBT.setTag("mFluid", this.mFluid.writeToNBT(new NBTTagCompound()));
+ }
+ aNBT.setByte("mLastReceivedFrom", this.mLastReceivedFrom);
}
@Override
- public void loadNBTData(NBTTagCompound aNBT) {
- mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"));
- mLastReceivedFrom = aNBT.getByte("mLastReceivedFrom");
+ public void loadNBTData(final NBTTagCompound aNBT) {
+ this.mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"));
+ this.mLastReceivedFrom = aNBT.getByte("mLastReceivedFrom");
}
@Override
- public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) {
- if (mFluid != null && (((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0 && aEntity instanceof EntityLivingBase) {
- int tTemperature = mFluid.getFluid().getTemperature(mFluid);
+ public void onEntityCollidedWithBlock(final World aWorld, final int aX, final int aY, final int aZ, final Entity aEntity) {
+ if ((this.mFluid != null) && ((((BaseMetaPipeEntity) this.getBaseMetaTileEntity()).mConnections & -128) == 0) && (aEntity instanceof EntityLivingBase)) {
+ final int tTemperature = this.mFluid.getFluid().getTemperature(this.mFluid);
if (tTemperature > 320) {
GT_Utility.applyHeatDamage((EntityLivingBase) aEntity, (tTemperature - 300) / 50.0F);
} else if (tTemperature < 260) {
@@ -142,217 +145,241 @@ public class GregtechMetaPipeEntityFluid extends MetaPipeEntity {
}
@Override
- public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(final World aWorld, final int aX, final int aY, final int aZ) {
return AxisAlignedBB.getBoundingBox(aX + 0.125D, aY + 0.125D, aZ + 0.125D, aX + 0.875D, aY + 0.875D, aZ + 0.875D);
}
@Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (aBaseMetaTileEntity.isServerSide() && aTick % 5 == 0) {
- mLastReceivedFrom &= 63;
- if (mLastReceivedFrom == 63) {
- mLastReceivedFrom = 0;
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ if (aBaseMetaTileEntity.isServerSide() && ((aTick % 5) == 0)) {
+ this.mLastReceivedFrom &= 63;
+ if (this.mLastReceivedFrom == 63) {
+ this.mLastReceivedFrom = 0;
}
- if (mFluid != null && mFluid.amount > 0) {
- int tTemperature = mFluid.getFluid().getTemperature(mFluid);
- if (tTemperature > mHeatResistance) {
+ if ((this.mFluid != null) && (this.mFluid.amount > 0)) {
+ final int tTemperature = this.mFluid.getFluid().getTemperature(this.mFluid);
+ if (tTemperature > this.mHeatResistance) {
if (aBaseMetaTileEntity.getRandomNumber(100) == 0) {
aBaseMetaTileEntity.setToFire();
return;
}
aBaseMetaTileEntity.setOnFire();
}
- if (!mGasProof && mFluid.getFluid().isGaseous(mFluid)) {
- mFluid.amount -= 5;
- sendSound((byte) 9);
+ if (!this.mGasProof && this.mFluid.getFluid().isGaseous(this.mFluid)) {
+ this.mFluid.amount -= 5;
+ this.sendSound((byte) 9);
if (tTemperature > 320) {
try {
- for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getXCoord() - 2, getBaseMetaTileEntity().getYCoord() - 2, getBaseMetaTileEntity().getZCoord() - 2, getBaseMetaTileEntity().getXCoord() + 3, getBaseMetaTileEntity().getYCoord() + 3, getBaseMetaTileEntity().getZCoord() + 3))) {
+ for (final EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) this.getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(this.getBaseMetaTileEntity().getXCoord() - 2, this.getBaseMetaTileEntity().getYCoord() - 2, this.getBaseMetaTileEntity().getZCoord() - 2, this.getBaseMetaTileEntity().getXCoord() + 3, this.getBaseMetaTileEntity().getYCoord() + 3, this.getBaseMetaTileEntity().getZCoord() + 3))) {
GT_Utility.applyHeatDamage(tLiving, (tTemperature - 300) / 25.0F);
}
- } catch (Throwable e) {
- if (D1) e.printStackTrace(GT_Log.err);
+ } catch (final Throwable e) {
+ if (D1) {
+ e.printStackTrace(GT_Log.err);
+ }
}
} else if (tTemperature < 260) {
try {
- for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getXCoord() - 2, getBaseMetaTileEntity().getYCoord() - 2, getBaseMetaTileEntity().getZCoord() - 2, getBaseMetaTileEntity().getXCoord() + 3, getBaseMetaTileEntity().getYCoord() + 3, getBaseMetaTileEntity().getZCoord() + 3))) {
+ for (final EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) this.getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(this.getBaseMetaTileEntity().getXCoord() - 2, this.getBaseMetaTileEntity().getYCoord() - 2, this.getBaseMetaTileEntity().getZCoord() - 2, this.getBaseMetaTileEntity().getXCoord() + 3, this.getBaseMetaTileEntity().getYCoord() + 3, this.getBaseMetaTileEntity().getZCoord() + 3))) {
GT_Utility.applyFrostDamage(tLiving, (270 - tTemperature) / 12.5F);
}
- } catch (Throwable e) {
- if (D1) e.printStackTrace(GT_Log.err);
+ } catch (final Throwable e) {
+ if (D1) {
+ e.printStackTrace(GT_Log.err);
+ }
}
}
- if (mFluid.amount <= 0) mFluid = null;
+ if (this.mFluid.amount <= 0) {
+ this.mFluid = null;
+ }
}
}
- if (mLastReceivedFrom == oLastReceivedFrom) {
- HashMap<IFluidHandler, ForgeDirection> tTanks = new HashMap<IFluidHandler, ForgeDirection>();
+ if (this.mLastReceivedFrom == this.oLastReceivedFrom) {
+ final HashMap<IFluidHandler, ForgeDirection> tTanks = new HashMap<>();
- mConnections = 0;
+ this.mConnections = 0;
for (byte tSide = 0, i = 0, j = (byte) aBaseMetaTileEntity.getRandomNumber(6); i < 6; i++) {
tSide = (byte) ((j + i) % 6);
- IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(tSide);
+ final IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(tSide);
if (tTileEntity != null) {
if (tTileEntity instanceof IGregTechTileEntity) {
if (aBaseMetaTileEntity.getColorization() >= 0) {
- byte tColor = ((IGregTechTileEntity) tTileEntity).getColorization();
- if (tColor >= 0 && (tColor & 15) != (aBaseMetaTileEntity.getColorization() & 15)) {
+ final byte tColor = ((IGregTechTileEntity) tTileEntity).getColorization();
+ if ((tColor >= 0) && ((tColor & 15) != (aBaseMetaTileEntity.getColorization() & 15))) {
continue;
}
}
}
- FluidTankInfo[] tInfo = tTileEntity.getTankInfo(ForgeDirection.getOrientation(tSide).getOpposite());
- if (tInfo != null && tInfo.length > 0) {
- if (tTileEntity instanceof ICoverable && ((ICoverable) tTileEntity).getCoverBehaviorAtSide(GT_Utility.getOppositeSide(tSide)).alwaysLookConnected(GT_Utility.getOppositeSide(tSide), ((ICoverable) tTileEntity).getCoverIDAtSide(GT_Utility.getOppositeSide(tSide)), ((ICoverable) tTileEntity).getCoverDataAtSide(GT_Utility.getOppositeSide(tSide)), ((ICoverable) tTileEntity))) {
- mConnections |= (1 << tSide);
+ final FluidTankInfo[] tInfo = tTileEntity.getTankInfo(ForgeDirection.getOrientation(tSide).getOpposite());
+ if ((tInfo != null) && (tInfo.length > 0)) {
+ if ((tTileEntity instanceof ICoverable) && ((ICoverable) tTileEntity).getCoverBehaviorAtSide(GT_Utility.getOppositeSide(tSide)).alwaysLookConnected(GT_Utility.getOppositeSide(tSide), ((ICoverable) tTileEntity).getCoverIDAtSide(GT_Utility.getOppositeSide(tSide)), ((ICoverable) tTileEntity).getCoverDataAtSide(GT_Utility.getOppositeSide(tSide)), ((ICoverable) tTileEntity))) {
+ this.mConnections |= (1 << tSide);
}
if (aBaseMetaTileEntity.getCoverBehaviorAtSide(tSide).letsFluidIn(tSide, aBaseMetaTileEntity.getCoverIDAtSide(tSide), aBaseMetaTileEntity.getCoverDataAtSide(tSide), null, aBaseMetaTileEntity)) {
- mConnections |= (1 << tSide);
+ this.mConnections |= (1 << tSide);
}
if (aBaseMetaTileEntity.getCoverBehaviorAtSide(tSide).letsFluidOut(tSide, aBaseMetaTileEntity.getCoverIDAtSide(tSide), aBaseMetaTileEntity.getCoverDataAtSide(tSide), null, aBaseMetaTileEntity)) {
- mConnections |= (1 << tSide);
- if (((1 << tSide) & mLastReceivedFrom) == 0)
+ this.mConnections |= (1 << tSide);
+ if (((1 << tSide) & this.mLastReceivedFrom) == 0) {
tTanks.put(tTileEntity, ForgeDirection.getOrientation(tSide).getOpposite());
+ }
}
if (aBaseMetaTileEntity.getCoverBehaviorAtSide(tSide).alwaysLookConnected(tSide, aBaseMetaTileEntity.getCoverIDAtSide(tSide), aBaseMetaTileEntity.getCoverDataAtSide(tSide), aBaseMetaTileEntity)) {
- mConnections |= (1 << tSide);
+ this.mConnections |= (1 << tSide);
}
}
}
}
- if (mFluid != null && mFluid.amount > 0) {
- int tAmount = Math.max(1, Math.min(mCapacity * 10, mFluid.amount / 2)), tSuccessfulTankAmount = 0;
+ if ((this.mFluid != null) && (this.mFluid.amount > 0)) {
+ int tAmount = Math.max(1, Math.min(this.mCapacity * 10, this.mFluid.amount / 2)), tSuccessfulTankAmount = 0;
- for (Entry<IFluidHandler, ForgeDirection> tEntry : tTanks.entrySet())
- if (tEntry.getKey().fill(tEntry.getValue(), drain(tAmount, false), false) > 0)
+ for (final Entry<IFluidHandler, ForgeDirection> tEntry : tTanks.entrySet()) {
+ if (tEntry.getKey().fill(tEntry.getValue(), this.drain(tAmount, false), false) > 0) {
tSuccessfulTankAmount++;
+ }
+ }
if (tSuccessfulTankAmount > 0) {
if (tAmount >= tSuccessfulTankAmount) {
tAmount /= tSuccessfulTankAmount;
- for (Entry<IFluidHandler, ForgeDirection> tTileEntity : tTanks.entrySet()) {
- if (mFluid == null || mFluid.amount <= 0) break;
- int tFilledAmount = tTileEntity.getKey().fill(tTileEntity.getValue(), drain(tAmount, false), false);
- if (tFilledAmount > 0)
- tTileEntity.getKey().fill(tTileEntity.getValue(), drain(tFilledAmount, true), true);
+ for (final Entry<IFluidHandler, ForgeDirection> tTileEntity : tTanks.entrySet()) {
+ if ((this.mFluid == null) || (this.mFluid.amount <= 0)) {
+ break;
+ }
+ final int tFilledAmount = tTileEntity.getKey().fill(tTileEntity.getValue(), this.drain(tAmount, false), false);
+ if (tFilledAmount > 0) {
+ tTileEntity.getKey().fill(tTileEntity.getValue(), this.drain(tFilledAmount, true), true);
+ }
}
} else {
- for (Entry<IFluidHandler, ForgeDirection> tTileEntity : tTanks.entrySet()) {
- if (mFluid == null || mFluid.amount <= 0) break;
- int tFilledAmount = tTileEntity.getKey().fill(tTileEntity.getValue(), drain(mFluid.amount, false), false);
- if (tFilledAmount > 0)
- tTileEntity.getKey().fill(tTileEntity.getValue(), drain(tFilledAmount, true), true);
+ for (final Entry<IFluidHandler, ForgeDirection> tTileEntity : tTanks.entrySet()) {
+ if ((this.mFluid == null) || (this.mFluid.amount <= 0)) {
+ break;
+ }
+ final int tFilledAmount = tTileEntity.getKey().fill(tTileEntity.getValue(), this.drain(this.mFluid.amount, false), false);
+ if (tFilledAmount > 0) {
+ tTileEntity.getKey().fill(tTileEntity.getValue(), this.drain(tFilledAmount, true), true);
+ }
}
}
}
}
- mLastReceivedFrom = 0;
+ this.mLastReceivedFrom = 0;
}
- oLastReceivedFrom = mLastReceivedFrom;
+ this.oLastReceivedFrom = this.mLastReceivedFrom;
}
}
@Override
- public void doSound(byte aIndex, double aX, double aY, double aZ) {
+ public void doSound(final byte aIndex, final double aX, final double aY, final double aZ) {
super.doSound(aIndex, aX, aY, aZ);
if (aIndex == 9) {
GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(4), 5, 1.0F, aX, aY, aZ);
- for (byte i = 0; i < 6; i++)
- for (int l = 0; l < 2; ++l)
- getBaseMetaTileEntity().getWorld().spawnParticle("largesmoke", aX - 0.5 + Math.random(), aY - 0.5 + Math.random(), aZ - 0.5 + Math.random(), ForgeDirection.getOrientation(i).offsetX / 5.0, ForgeDirection.getOrientation(i).offsetY / 5.0, ForgeDirection.getOrientation(i).offsetZ / 5.0);
+ for (byte i = 0; i < 6; i++) {
+ for (int l = 0; l < 2; ++l) {
+ this.getBaseMetaTileEntity().getWorld().spawnParticle("largesmoke", (aX - 0.5) + Math.random(), (aY - 0.5) + Math.random(), (aZ - 0.5) + Math.random(), ForgeDirection.getOrientation(i).offsetX / 5.0, ForgeDirection.getOrientation(i).offsetY / 5.0, ForgeDirection.getOrientation(i).offsetZ / 5.0);
+ }
+ }
}
}
@Override
public final int getCapacity() {
- return mCapacity * 20;
+ return this.mCapacity * 20;
}
@Override
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
return false;
}
@Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
return false;
}
@Override
public final FluidStack getFluid() {
- return mFluid;
+ return this.mFluid;
}
@Override
public final int getFluidAmount() {
- return mFluid != null ? mFluid.amount : 0;
+ return this.mFluid != null ? this.mFluid.amount : 0;
}
@Override
- public final int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
- if (aFluid == null || aFluid.getFluid().getID() <= 0) return 0;
+ public final int fill_default(final ForgeDirection aSide, final FluidStack aFluid, final boolean doFill) {
+ if ((aFluid == null) || (aFluid.getFluid().getID() <= 0)) {
+ return 0;
+ }
- if (mFluid == null || mFluid.getFluid().getID() <= 0) {
- if (aFluid.amount <= getCapacity()) {
+ if ((this.mFluid == null) || (this.mFluid.getFluid().getID() <= 0)) {
+ if (aFluid.amount <= this.getCapacity()) {
if (doFill) {
- mFluid = aFluid.copy();
- mLastReceivedFrom |= (1 << aSide.ordinal());
+ this.mFluid = aFluid.copy();
+ this.mLastReceivedFrom |= (1 << aSide.ordinal());
}
return aFluid.amount;
}
if (doFill) {
- mFluid = aFluid.copy();
- mLastReceivedFrom |= (1 << aSide.ordinal());
- mFluid.amount = getCapacity();
+ this.mFluid = aFluid.copy();
+ this.mLastReceivedFrom |= (1 << aSide.ordinal());
+ this.mFluid.amount = this.getCapacity();
}
- return getCapacity();
+ return this.getCapacity();
}
- if (!mFluid.isFluidEqual(aFluid)) return 0;
+ if (!this.mFluid.isFluidEqual(aFluid)) {
+ return 0;
+ }
- int space = getCapacity() - mFluid.amount;
+ final int space = this.getCapacity() - this.mFluid.amount;
if (aFluid.amount <= space) {
if (doFill) {
- mFluid.amount += aFluid.amount;
- mLastReceivedFrom |= (1 << aSide.ordinal());
+ this.mFluid.amount += aFluid.amount;
+ this.mLastReceivedFrom |= (1 << aSide.ordinal());
}
return aFluid.amount;
}
if (doFill) {
- mFluid.amount = getCapacity();
- mLastReceivedFrom |= (1 << aSide.ordinal());
+ this.mFluid.amount = this.getCapacity();
+ this.mLastReceivedFrom |= (1 << aSide.ordinal());
}
return space;
}
@Override
- public final FluidStack drain(int maxDrain, boolean doDrain) {
- if (mFluid == null) return null;
- if (mFluid.amount <= 0) {
- mFluid = null;
+ public final FluidStack drain(final int maxDrain, final boolean doDrain) {
+ if (this.mFluid == null) {
+ return null;
+ }
+ if (this.mFluid.amount <= 0) {
+ this.mFluid = null;
return null;
}
int used = maxDrain;
- if (mFluid.amount < used)
- used = mFluid.amount;
+ if (this.mFluid.amount < used) {
+ used = this.mFluid.amount;
+ }
if (doDrain) {
- mFluid.amount -= used;
+ this.mFluid.amount -= used;
}
- FluidStack drained = mFluid.copy();
+ final FluidStack drained = this.mFluid.copy();
drained.amount = used;
- if (mFluid.amount <= 0) {
- mFluid = null;
+ if (this.mFluid.amount <= 0) {
+ this.mFluid = null;
}
return drained;
@@ -360,21 +387,21 @@ public class GregtechMetaPipeEntityFluid extends MetaPipeEntity {
@Override
public int getTankPressure() {
- return (mFluid == null ? 0 : mFluid.amount) - (getCapacity() / 2);
+ return (this.mFluid == null ? 0 : this.mFluid.amount) - (this.getCapacity() / 2);
}
@Override
public String[] getDescription() {
return new String[]{
- EnumChatFormatting.BLUE + "Fluid Capacity: " + (mCapacity * 20) + "L/sec" + EnumChatFormatting.GRAY,
- EnumChatFormatting.RED + "Heat Limit: " + mHeatResistance + " K" + EnumChatFormatting.GRAY,
- EnumChatFormatting.DARK_GREEN + "Gas Proof: " + (mGasProof) + EnumChatFormatting.GRAY,
+ EnumChatFormatting.BLUE + "Fluid Capacity: " + (this.mCapacity * 20) + "L/sec" + EnumChatFormatting.GRAY,
+ EnumChatFormatting.RED + "Heat Limit: " + this.mHeatResistance + " K" + EnumChatFormatting.GRAY,
+ EnumChatFormatting.DARK_GREEN + "Gas Proof: " + (this.mGasProof) + EnumChatFormatting.GRAY,
CORE.GT_Tooltip
};
}
@Override
public float getThickNess() {
- return mThickNess;
+ return this.mThickNess;
}
} \ No newline at end of file