diff options
author | draknyte1 <draknyte1@hotmail.com> | 2016-11-04 15:23:26 +1000 |
---|---|---|
committer | draknyte1 <draknyte1@hotmail.com> | 2016-11-04 15:23:26 +1000 |
commit | 0669f5eb9d5029a8b94ec552171b0837605f7747 (patch) | |
tree | 6b40e64c04d51b7a33cf2f0b35f7232cf37c4247 /src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage | |
parent | 3654052fb63a571c5eaca7f20714b87c17f7e966 (diff) | |
download | GT5-Unofficial-0669f5eb9d5029a8b94ec552171b0837605f7747.tar.gz GT5-Unofficial-0669f5eb9d5029a8b94ec552171b0837605f7747.tar.bz2 GT5-Unofficial-0669f5eb9d5029a8b94ec552171b0837605f7747.zip |
$ Cleaned up the entire project.
> Much neat, very nices.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage')
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java | 258 |
1 files changed, 133 insertions, 125 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java index 7508391f93..eede58d65b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java @@ -12,130 +12,108 @@ import gtPlusPlus.core.util.fluid.FluidUtils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; -public class GT_MetaTileEntity_TieredTank -extends GT_MetaTileEntity_BasicTank { +public class GT_MetaTileEntity_TieredTank extends GT_MetaTileEntity_BasicTank { - private NBTTagCompound mRecipeStuff = new NBTTagCompound(); - private String mFluidName; - private int mFluidAmount; + private NBTTagCompound mRecipeStuff = new NBTTagCompound(); + private String mFluidName; + private int mFluidAmount; - public GT_MetaTileEntity_TieredTank(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 3, "Stores " + ((int) (Math.pow(2, aTier) * 32000)) + "L of fluid"); + public GT_MetaTileEntity_TieredTank(final int aID, final String aName, final String aNameRegional, + final int aTier) { + super(aID, aName, aNameRegional, aTier, 3, "Stores " + (int) (Math.pow(2, aTier) * 32000) + "L of fluid"); } - public GT_MetaTileEntity_TieredTank(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_TieredTank(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); } @Override - public ITexture[][][] getTextureSet(ITexture[] aTextures) { - return new ITexture[0][0][0]; + public boolean canTankBeEmptied() { + return true; } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == 1 ? new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER_ACTIVE)} : new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER)}; + public boolean canTankBeFilled() { + return true; } - - private boolean setVars(){ - //Utils.LOG_INFO("setting Vars."); - if (mFluidName.equals("") || !mFluidName.equals(null)){ - if (mFluid != null) mFluidName = mFluid.getFluid().getName(); - } - else{ - if (mFluid != null){ - if (!mFluidName.equalsIgnoreCase(mFluid.getFluid().getName())){ - mFluidName = mFluid.getFluid().getName(); - } - } - else { - // Leave Values Blank. - return false; - } - } - - if (mFluidAmount <= 0){ - if (mFluid != null) mFluidAmount = mFluid.amount; - } - else { - if (mFluid != null){ - if (mFluidAmount != mFluid.amount){ - mFluidAmount = mFluid.amount; - } - } - else { - // Leave Values Blank. - return false; - } - } + @Override + public boolean displaysItemStack() { return true; } - @Override - public String[] getDescription() { - - setVars(); - - - if ((mFluidName.equals("Empty")||mFluidName.equals("")) || mFluidAmount <= 0){ - return new String[] {mDescription, CORE.GT_Tooltip}; - } - return new String[] {mDescription, "Stored Fluid: "+mFluidName, "Stored Amount: "+mFluidAmount+"l", CORE.GT_Tooltip}; + public boolean displaysStackSize() { + return false; } - @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - setVars(); - mRecipeStuff.setString("mFluidName", mFluidName); - mRecipeStuff.setInteger("mFluidAmount", mFluidAmount); - aNBT.setTag("GT.CraftingComponents", mRecipeStuff); + public boolean doesEmptyContainers() { + return true; } @Override - public void loadNBTData(NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - mRecipeStuff = aNBT.getCompoundTag("GT.CraftingComponents"); - mFluidName = mRecipeStuff.getString("mFluidName"); - mFluidAmount = mRecipeStuff.getInteger("mFluidAmount"); - mFluid = FluidUtils.getFluidStack(mFluidName, mFluidAmount); - setItemNBT(aNBT); + public boolean doesFillContainers() { + return true; } @Override - public void setItemNBT(NBTTagCompound aNBT) { - super.setItemNBT(aNBT); - mRecipeStuff.setString("mFluidName", mFluidName); - mRecipeStuff.setInteger("mFluidAmount", mFluidAmount); - aNBT.setTag("GT.CraftingComponents", mRecipeStuff); + public int getCapacity() { + return (int) (Math.pow(2, this.mTier) * 32000); } + @Override + public String[] getDescription() { + + this.setVars(); + + if (this.mFluidName.equals("Empty") || this.mFluidName.equals("") || this.mFluidAmount <= 0) { + return new String[] { + this.mDescription, CORE.GT_Tooltip + }; + } + return new String[] { + this.mDescription, "Stored Fluid: " + this.mFluidName, "Stored Amount: " + this.mFluidAmount + "l", + CORE.GT_Tooltip + }; + } @Override - public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()){ - return true; + public String[] getInfoData() { + + if (this.mFluid == null) { + return new String[] { + GT_Values.VOLTAGE_NAMES[this.mTier] + " Fluid Tank", "Stored Fluid:", "No Fluid", + Integer.toString(0) + "L", Integer.toString(this.getCapacity()) + "L" + }; } - aBaseMetaTileEntity.openGUI(aPlayer); - return true; + return new String[] { + GT_Values.VOLTAGE_NAMES[this.mTier] + " Fluid Tank", "Stored Fluid:", this.mFluid.getLocalizedName(), + Integer.toString(this.mFluid.amount) + "L", Integer.toString(this.getCapacity()) + "L" + }; } @Override - public boolean isSimpleMachine() { - return true; + public int getTankPressure() { + return 100; } @Override - public boolean isFacingValid(byte aFacing) { - return true; + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return aSide == 1 ? new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER_ACTIVE) + } : new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER) + }; } @Override - public boolean isAccessAllowed(EntityPlayer aPlayer) { - return true; + public ITexture[][][] getTextureSet(final ITexture[] aTextures) { + return new ITexture[0][0][0]; } @Override @@ -144,84 +122,114 @@ extends GT_MetaTileEntity_BasicTank { } @Override - public boolean doesFillContainers() { + public boolean isAccessAllowed(final EntityPlayer aPlayer) { return true; } @Override - public boolean doesEmptyContainers() { + public boolean isFacingValid(final byte aFacing) { return true; } @Override - public boolean canTankBeFilled() { + public boolean isGivingInformation() { return true; } @Override - public boolean canTankBeEmptied() { + public boolean isSimpleMachine() { return true; } @Override - public boolean displaysItemStack() { - return true; + public void loadNBTData(final NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + this.mRecipeStuff = aNBT.getCompoundTag("GT.CraftingComponents"); + this.mFluidName = this.mRecipeStuff.getString("mFluidName"); + this.mFluidAmount = this.mRecipeStuff.getInteger("mFluidAmount"); + this.mFluid = FluidUtils.getFluidStack(this.mFluidName, this.mFluidAmount); + this.setItemNBT(aNBT); } @Override - public boolean displaysStackSize() { - return false; + public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_TieredTank(this.mName, this.mTier, this.mDescription, this.mTextures); } @Override - public String[] getInfoData() { - - if (mFluid == null) { - return new String[]{ - GT_Values.VOLTAGE_NAMES[mTier]+" Fluid Tank", - "Stored Fluid:", - "No Fluid", - Integer.toString(0) + "L", - Integer.toString(getCapacity()) + "L"}; - } - return new String[]{ - GT_Values.VOLTAGE_NAMES[mTier]+" Fluid Tank", - "Stored Fluid:", - mFluid.getLocalizedName(), - Integer.toString(mFluid.amount) + "L", - Integer.toString(getCapacity()) + "L"}; + public void onMachineBlockUpdate() { + this.getBaseMetaTileEntity().markDirty(); + super.onMachineBlockUpdate(); } @Override - public boolean isGivingInformation() { - return true; + public void onRemoval() { + this.getBaseMetaTileEntity().markDirty(); + super.onRemoval(); } @Override - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_TieredTank(mName, mTier, mDescription, mTextures); + public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } + aBaseMetaTileEntity.openGUI(aPlayer); + return true; } @Override - public int getCapacity() { - return (int) (Math.pow(2, mTier) * 32000); + public void saveNBTData(final NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + this.setVars(); + this.mRecipeStuff.setString("mFluidName", this.mFluidName); + this.mRecipeStuff.setInteger("mFluidAmount", this.mFluidAmount); + aNBT.setTag("GT.CraftingComponents", this.mRecipeStuff); } @Override - public int getTankPressure() { - return 100; + public void setItemNBT(final NBTTagCompound aNBT) { + super.setItemNBT(aNBT); + this.mRecipeStuff.setString("mFluidName", this.mFluidName); + this.mRecipeStuff.setInteger("mFluidAmount", this.mFluidAmount); + aNBT.setTag("GT.CraftingComponents", this.mRecipeStuff); } - @Override - public void onMachineBlockUpdate() { - this.getBaseMetaTileEntity().markDirty(); - super.onMachineBlockUpdate(); - } + private boolean setVars() { + // Utils.LOG_INFO("setting Vars."); + if (this.mFluidName.equals("") || !this.mFluidName.equals(null)) { + if (this.mFluid != null) { + this.mFluidName = this.mFluid.getFluid().getName(); + } + } + else { + if (this.mFluid != null) { + if (!this.mFluidName.equalsIgnoreCase(this.mFluid.getFluid().getName())) { + this.mFluidName = this.mFluid.getFluid().getName(); + } + } + else { + // Leave Values Blank. + return false; + } + } - @Override - public void onRemoval() { - this.getBaseMetaTileEntity().markDirty(); - super.onRemoval(); + if (this.mFluidAmount <= 0) { + if (this.mFluid != null) { + this.mFluidAmount = this.mFluid.amount; + } + } + else { + if (this.mFluid != null) { + if (this.mFluidAmount != this.mFluid.amount) { + this.mFluidAmount = this.mFluid.amount; + } + } + else { + // Leave Values Blank. + return false; + } + } + return true; } }
\ No newline at end of file |