diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-11-06 19:32:27 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-11-06 19:32:27 +1000 |
commit | cbe0e497be8e466c380a5b4fa781b314ede9ada3 (patch) | |
tree | b85848b432adf458e3abda466ee46d9dfc3e454b /src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaEnergyBuffer.java | |
parent | c40416b036c0e89451e1558253ccf07bbee028d0 (diff) | |
download | GT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.tar.gz GT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.tar.bz2 GT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.zip |
Revert "$ Cleaned up the entire project."
This reverts commit 0669f5eb9d5029a8b94ec552171b0837605f7747.
# Conflicts:
# src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java
# src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java
Revert "% Cleaned up Imports."
This reverts commit 3654052fb63a571c5eaca7f20714b87c17f7e966.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaEnergyBuffer.java')
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaEnergyBuffer.java | 563 |
1 files changed, 230 insertions, 333 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaEnergyBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaEnergyBuffer.java index 9236d091fc..4f4f3f931f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaEnergyBuffer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaEnergyBuffer.java @@ -1,6 +1,6 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; -import gregtech.api.enums.GT_Values; +import static gregtech.api.enums.GT_Values.V; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_Container_1by1; import gregtech.api.gui.GT_GUIContainer_1by1; @@ -30,92 +30,113 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { * setCreativeTab(GregTech_API.TAB_GREGTECH); } */ - public boolean mCharge = false, mDecharge = false; - public int mBatteryCount = 1, mChargeableCount = 1; + public boolean mCharge = false, mDecharge = false; + public int mBatteryCount = 1, mChargeableCount = 1; - private long count = 0; - - private long mStored = 0; - - private long mMax = 0; - - /* - * MACHINE_STEEL_SIDE - */ - - public GregtechMetaEnergyBuffer(final int aID, final String aName, final String aNameRegional, final int aTier, - final String aDescription, final int aSlotCount) { + public GregtechMetaEnergyBuffer(int aID, String aName, String aNameRegional, int aTier, String aDescription, int aSlotCount) { super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription); } - public GregtechMetaEnergyBuffer(final String aName, final int aTier, final String aDescription, - final ITexture[][][] aTextures, final int aSlotCount) { + public GregtechMetaEnergyBuffer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, int aSlotCount) { super(aName, aTier, aSlotCount, aDescription, aTextures); } @Override - public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, - final ItemStack aStack) { - return false; - } - - @Override - public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, - final ItemStack aStack) { - return false; - } - - @Override - public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) { - return false; - } - - @Override - public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) { - return false; - } - - @Override - public void closeInventory() { - } - - @Override - public int dechargerSlotCount() { - return this.mDecharge ? this.mInventory.length : 0; - } - - @Override - public int dechargerSlotStartIndex() { - return 0; - } - - @Override - public ItemStack decrStackSize(final int p_70298_1_, final int p_70298_2_) { - return null; - } - - @Override - public int[] getAccessibleSlotsFromSide(final int p_94128_1_) { - return null; - } - - public ITexture[] getBack(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) - }; + public String[] getDescription() { + return new String[] {mDescription, CORE.GT_Tooltip}; } /* - * @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { - * ITexture[][][] rTextures = new ITexture[2][17][]; for (byte i = -1; i < - * 16; i++) { rTextures[0][i + 1] = new ITexture[] { new GT_RenderedTexture( - * Textures.BlockIcons.MACHINE_HEATPROOFCASING) }; rTextures[1][i + 1] = new - * ITexture[] { new GT_RenderedTexture( - * Textures.BlockIcons.MACHINE_HEATPROOFCASING), mInventory.length > 4 ? - * Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] : - * Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; } return rTextures; } + * MACHINE_STEEL_SIDE */ + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + ITexture[][][] rTextures = new ITexture[10][17][]; + for (byte i = -1; i < 16; i++) { + rTextures[0][i + 1] = getFront(i); + rTextures[1][i + 1] = getBack(i); + rTextures[2][i + 1] = getBottom(i); + rTextures[3][i + 1] = getTop(i); + rTextures[4][i + 1] = getSides(i); + rTextures[5][i + 1] = getFrontActive(i); + rTextures[6][i + 1] = getBackActive(i); + rTextures[7][i + 1] = getBottomActive(i); + rTextures[8][i + 1] = getTopActive(i); + rTextures[9][i + 1] = getSidesActive(i); + } + return rTextures; + } + + @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[] getFront(byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; + } + + + public ITexture[] getBack(byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)}; + } + + + public ITexture[] getBottom(byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)}; + } + + + public ITexture[] getTop(byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Screen_Logo)}; + } + + + public ITexture[] getSides(byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)}; + } + + + public ITexture[] getFrontActive(byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; + } + + + public ITexture[] getBackActive(byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)}; + } + + + public ITexture[] getBottomActive(byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)}; + } + + + public ITexture[] getTopActive(byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Screen_Logo)}; + } + + + public ITexture[] getSidesActive(byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)}; + } + + /*@Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + ITexture[][][] rTextures = new ITexture[2][17][]; + for (byte i = -1; i < 16; i++) { + rTextures[0][i + 1] = new ITexture[] { new GT_RenderedTexture( + Textures.BlockIcons.MACHINE_HEATPROOFCASING) }; + rTextures[1][i + 1] = new ITexture[] { + new GT_RenderedTexture( + Textures.BlockIcons.MACHINE_HEATPROOFCASING), + mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] + : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; + } + return rTextures; + }*/ /* * @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { @@ -139,226 +160,174 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { * } return rTextures; } */ - /* - * @Override public ITexture[] getTexture(IGregTechTileEntity - * aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean - * aActive, boolean aRedstone) { return mTextures[aSide == aFacing ? 1 : - * 0][aColorIndex+1]; } - */ - - public ITexture[] getBackActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) - }; - } + /*@Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return mTextures[aSide == aFacing ? 1 : 0][aColorIndex+1]; + }*/ - public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) - }; + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GregtechMetaEnergyBuffer(mName, mTier, mDescription, mTextures, mInventory.length); } - public ITexture[] getBottomActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) - }; - } + @Override public boolean isSimpleMachine() {return false;} + @Override public boolean isElectric() {return true;} + @Override public boolean isValidSlot(int aIndex) {return true;} + @Override public boolean isFacingValid(byte aFacing) {return true;} + @Override public boolean isEnetInput() {return true;} + @Override public boolean isEnetOutput() {return true;} + @Override public boolean isInputFacing(byte aSide) {return aSide!=getBaseMetaTileEntity().getFrontFacing();} + @Override public boolean isOutputFacing(byte aSide) {return aSide==getBaseMetaTileEntity().getFrontFacing();} + @Override public boolean isTeleporterCompatible() {return false;} + @Override public long getMinimumStoredEU() {return V[mTier]*2;} + @Override public long maxEUStore() {return V[mTier]*250000;} @Override - public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, - final IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_1by1(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName()); + public long maxEUInput() { + return V[mTier]; } @Override - public String[] getDescription() { - return new String[] { - this.mDescription, CORE.GT_Tooltip - }; - } - - public ITexture[] getFront(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] - }; + public long maxEUOutput() { + return V[mTier]; } - public ITexture[] getFrontActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] - }; + @Override + public long maxAmperesIn() { + return mChargeableCount * 4; } @Override - public String[] getInfoData() { - this.count++; - if (this.mMax == 0 || this.count % 20 == 0) { - final long[] tmp = this.getStoredEnergy(); - this.mStored = tmp[0]; - this.mMax = tmp[1]; - } - - return new String[] { - this.getLocalName(), GT_Utility.formatNumbers(this.mStored) + " EU /", - GT_Utility.formatNumbers(this.mMax) + " EU" - }; + public long maxAmperesOut() { + return mChargeableCount * 4; } + @Override public int rechargerSlotStartIndex() {return 0;} + @Override public int dechargerSlotStartIndex() {return 0;} + @Override public int rechargerSlotCount() {return mCharge?mInventory.length:0;} + @Override public int dechargerSlotCount() {return mDecharge?mInventory.length:0;} + @Override public int getProgresstime() {return (int)getBaseMetaTileEntity().getUniversalEnergyStored();} + @Override public int maxProgresstime() {return (int)getBaseMetaTileEntity().getUniversalEnergyCapacity();} + @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;} @Override - public String getInventoryName() { - return null; + public void saveNBTData(NBTTagCompound aNBT) { + // } @Override - public int getInventoryStackLimit() { - return 0; + public void loadNBTData(NBTTagCompound aNBT) { + // } @Override - public long getMinimumStoredEU() { - return GT_Values.V[this.mTier] * 2; + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + Utils.LOG_WARNING("Right Click on MTE by Player"); + if (aBaseMetaTileEntity.isClientSide()) return true; + //aBaseMetaTileEntity.openGUI(aPlayer); + + Utils.LOG_WARNING("MTE is Client-side"); + showEnergy(aPlayer.getEntityWorld(), aPlayer); + return true; } - @Override - public int getProgresstime() { - return (int) this.getBaseMetaTileEntity().getUniversalEnergyStored(); + private void showEnergy(World worldIn, EntityPlayer playerIn){ + long tempStorage = getStoredEnergy()[0]; + final double c = ((double) tempStorage / maxEUStore()) * 100; + final double roundOff = Math.round(c * 100.00) / 100.00; + PlayerUtils.messagePlayer(playerIn, "Energy: " + tempStorage + " EU at "+V[mTier]+"v ("+roundOff+"%)"); + } + //Utils.LOG_WARNING("Begin Show Energy"); + /* + * + //Utils.LOG_INFO("getProgresstime: "+tempStorage+" maxProgresstime: "+maxEUStore()+" C: "+c); + Utils.LOG_INFO("getProgressTime: "+getProgresstime()); + Utils.LOG_INFO("maxProgressTime: "+maxProgresstime()); + Utils.LOG_INFO("getMinimumStoredEU: "+getMinimumStoredEU()); + Utils.LOG_INFO("maxEUStore: "+maxEUStore());*/ + /*final long d = (tempStorage * 100L) / maxEUStore(); + Utils.LOG_INFO("getProgresstime: "+tempStorage+" maxProgresstime: "+maxEUStore()+" D: "+d); + final double roundOff2 = Math.round(d * 100.00) / 100.00; + Utils.messagePlayer(playerIn, "Energy: " + tempStorage + " EU at "+V[mTier]+"v ("+roundOff2+"%)"); + Utils.LOG_WARNING("Making new instance of Guihandler"); + GuiHandler block = new GuiHandler(); + Utils.LOG_WARNING("Guihandler.toString(): "+block.toString()); + block.getClientGuiElement(1, playerIn, worldIn, (int) playerIn.posX, (int) playerIn.posY, (int) playerIn.posZ);*/ + @Override - public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, - final IGregTechTileEntity aBaseMetaTileEntity) { + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_Container_1by1(aPlayerInventory, aBaseMetaTileEntity); } - public ITexture[] getSides(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) - }; - } - - public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) - }; + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_1by1(aPlayerInventory, aBaseMetaTileEntity, getLocalName()); } @Override - public int getSizeInventory() { - return 0; + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + } @Override - public ItemStack getStackInSlot(final int p_70301_1_) { - return null; + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; } @Override - public ItemStack getStackInSlotOnClosing(final int p_70304_1_) { - return null; + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; } - public long[] getStoredEnergy() { - long tScale = this.getBaseMetaTileEntity().getEUCapacity(); - long tStored = this.getBaseMetaTileEntity().getStoredEU(); - if (this.mInventory != null) { - for (final ItemStack aStack : this.mInventory) { + public long[] getStoredEnergy(){ + long tScale = getBaseMetaTileEntity().getEUCapacity(); + long tStored = getBaseMetaTileEntity().getStoredEU(); + if (mInventory != null) { + for (ItemStack aStack : mInventory) { if (GT_ModHandler.isElectricItem(aStack)) { if (aStack.getItem() instanceof GT_MetaBase_Item) { - final Long[] stats = ((GT_MetaBase_Item) aStack.getItem()).getElectricStats(aStack); + Long[] stats = ((GT_MetaBase_Item) aStack.getItem()) + .getElectricStats(aStack); if (stats != null) { tScale = tScale + stats[0]; - tStored = tStored + ((GT_MetaBase_Item) aStack.getItem()).getRealCharge(aStack); + tStored = tStored + + ((GT_MetaBase_Item) aStack.getItem()) + .getRealCharge(aStack); } - } - else if (aStack.getItem() instanceof IElectricItem) { - tStored = tStored + (long) ic2.api.item.ElectricItem.manager.getCharge(aStack); - tScale = tScale + (long) ((IElectricItem) aStack.getItem()).getMaxCharge(aStack); + } else if (aStack.getItem() instanceof IElectricItem) { + tStored = tStored + + (long) ic2.api.item.ElectricItem.manager + .getCharge(aStack); + tScale = tScale + + (long) ((IElectricItem) aStack.getItem()) + .getMaxCharge(aStack); } } } } - return new long[] { - tStored, tScale - }; + return new long[] { tStored, tScale }; } - @Override - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, - final byte aColorIndex, final boolean aActive, final boolean aRedstone) { - return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 - : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex - + 1]; - } + private long count=0; + private long mStored=0; + private long mMax=0; @Override - public ITexture[][][] getTextureSet(final ITexture[] aTextures) { - final ITexture[][][] rTextures = new ITexture[10][17][]; - for (byte i = -1; i < 16; i++) { - rTextures[0][i + 1] = this.getFront(i); - rTextures[1][i + 1] = this.getBack(i); - rTextures[2][i + 1] = this.getBottom(i); - rTextures[3][i + 1] = this.getTop(i); - rTextures[4][i + 1] = this.getSides(i); - rTextures[5][i + 1] = this.getFrontActive(i); - rTextures[6][i + 1] = this.getBackActive(i); - rTextures[7][i + 1] = this.getBottomActive(i); - rTextures[8][i + 1] = this.getTopActive(i); - rTextures[9][i + 1] = this.getSidesActive(i); + public String[] getInfoData() { + count++; + if(mMax==0||count%20==0){ + long[] tmp = getStoredEnergy(); + mStored=tmp[0]; + mMax=tmp[1]; } - return rTextures; - } - - public ITexture[] getTop(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Screen_Logo) - }; - } - - public ITexture[] getTopActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Screen_Logo) - }; - } - - @Override - public boolean hasCustomInventoryName() { - return false; - } - - @Override - public boolean isAccessAllowed(final EntityPlayer aPlayer) { - return true; - } - - @Override - public boolean isElectric() { - return true; - } - - @Override - public boolean isEnetInput() { - return true; - } - - @Override - public boolean isEnetOutput() { - return true; - } - @Override - public boolean isFacingValid(final byte aFacing) { - return true; + return new String[] { + getLocalName(), + GT_Utility.formatNumbers(mStored)+" EU /", + GT_Utility.formatNumbers(mMax)+" EU"}; } @Override @@ -367,95 +336,62 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { } @Override - public boolean isInputFacing(final byte aSide) { - return aSide != this.getBaseMetaTileEntity().getFrontFacing(); + public int[] getAccessibleSlotsFromSide(int p_94128_1_) { + return null; } @Override - public boolean isItemValidForSlot(final int p_94041_1_, final ItemStack p_94041_2_) { + public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) { return false; } @Override - public boolean isOutputFacing(final byte aSide) { - return aSide == this.getBaseMetaTileEntity().getFrontFacing(); - } - - @Override - public boolean isSimpleMachine() { - return false; - } - @Override - public boolean isTeleporterCompatible() { - return false; - } - @Override - public boolean isUseableByPlayer(final EntityPlayer p_70300_1_) { + public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) { return false; } @Override - public boolean isValidSlot(final int aIndex) { - return true; - } - - @Override - public void loadNBTData(final NBTTagCompound aNBT) { - // - } - - @Override - public long maxAmperesIn() { - return this.mChargeableCount * 4; + public int getSizeInventory() { + return 0; } @Override - public long maxAmperesOut() { - return this.mChargeableCount * 4; + public ItemStack getStackInSlot(int p_70301_1_) { + return null; } @Override - public long maxEUInput() { - return GT_Values.V[this.mTier]; + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { + return null; } @Override - public long maxEUOutput() { - return GT_Values.V[this.mTier]; + public ItemStack getStackInSlotOnClosing(int p_70304_1_) { + return null; } @Override - public long maxEUStore() { - return GT_Values.V[this.mTier] * 250000; + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { } @Override - public int maxProgresstime() { - return (int) this.getBaseMetaTileEntity().getUniversalEnergyCapacity(); + public String getInventoryName() { + return null; } @Override - public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GregtechMetaEnergyBuffer(this.mName, this.mTier, this.mDescription, this.mTextures, - this.mInventory.length); + public boolean hasCustomInventoryName() { + return false; } @Override - public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { - + public int getInventoryStackLimit() { + return 0; } @Override - public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { - Utils.LOG_WARNING("Right Click on MTE by Player"); - if (aBaseMetaTileEntity.isClientSide()) { - return true; - // aBaseMetaTileEntity.openGUI(aPlayer); - } - - Utils.LOG_WARNING("MTE is Client-side"); - this.showEnergy(aPlayer.getEntityWorld(), aPlayer); - return true; + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return false; } @Override @@ -463,51 +399,12 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { } @Override - public int rechargerSlotCount() { - return this.mCharge ? this.mInventory.length : 0; - } - - @Override - public int rechargerSlotStartIndex() { - return 0; - } - - @Override - public void saveNBTData(final NBTTagCompound aNBT) { - // + public void closeInventory() { } @Override - public void setInventorySlotContents(final int p_70299_1_, final ItemStack p_70299_2_) { - } - - private void showEnergy(final World worldIn, final EntityPlayer playerIn) { - final long tempStorage = this.getStoredEnergy()[0]; - final double c = (double) tempStorage / this.maxEUStore() * 100; - final double roundOff = Math.round(c * 100.00) / 100.00; - PlayerUtils.messagePlayer(playerIn, - "Energy: " + tempStorage + " EU at " + GT_Values.V[this.mTier] + "v (" + roundOff + "%)"); - + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { + return false; } - // Utils.LOG_WARNING("Begin Show Energy"); - /* - * - * //Utils.LOG_INFO("getProgresstime: "+tempStorage+" maxProgresstime: " - * +maxEUStore()+" C: "+c); Utils.LOG_INFO("getProgressTime: " - * +getProgresstime()); Utils.LOG_INFO("maxProgressTime: " - * +maxProgresstime()); Utils.LOG_INFO("getMinimumStoredEU: " - * +getMinimumStoredEU()); Utils.LOG_INFO("maxEUStore: "+maxEUStore()); - */ - /* - * final long d = (tempStorage * 100L) / maxEUStore(); Utils.LOG_INFO( - * "getProgresstime: "+tempStorage+" maxProgresstime: "+maxEUStore()+ - * " D: "+d); final double roundOff2 = Math.round(d * 100.00) / 100.00; - * Utils.messagePlayer(playerIn, "Energy: " + tempStorage + " EU at " - * +V[mTier]+"v ("+roundOff2+"%)"); Utils.LOG_WARNING( - * "Making new instance of Guihandler"); GuiHandler block = new - * GuiHandler(); Utils.LOG_WARNING("Guihandler.toString(): " - * +block.toString()); block.getClientGuiElement(1, playerIn, worldIn, (int) - * playerIn.posX, (int) playerIn.posY, (int) playerIn.posZ); - */ }
\ No newline at end of file |