diff options
Diffstat (limited to 'main/java/gregtech/api')
3 files changed, 82 insertions, 7 deletions
diff --git a/main/java/gregtech/api/enums/Materials.java b/main/java/gregtech/api/enums/Materials.java index efd3e9a865..99e9db3d31 100644 --- a/main/java/gregtech/api/enums/Materials.java +++ b/main/java/gregtech/api/enums/Materials.java @@ -231,7 +231,7 @@ public enum Materials implements IColorModulationContainer, ISubTagContainer { CertusQuartz ( 516, TextureSet.SET_QUARTZ , 5.0F, 32, 1, 1 |4|8 |64 , 210, 210, 230, 0, "Certus Quartz" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeLightGray , Arrays.asList(new TC_AspectStack(TC_Aspects.POTENTIA, 1), new TC_AspectStack(TC_Aspects.VITREUS, 1))), Ceruclase ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 |8 , 255, 255, 255, 0, "Ceruclase" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), Citrine ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Citrine" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), - ChargedCertusQuartz ( 517, TextureSet.SET_QUARTZ , 5.0F, 32, 1, 1 |4|8 |64 , 210, 210, 230, 0, "Charged Certus Quartz" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeLightGray , Arrays.asList(new TC_AspectStack(TC_Aspects.POTENTIA, 2), new TC_AspectStack(TC_Aspects.VITREUS, 1))), + //ChargedCertusQuartz ( 517, TextureSet.SET_QUARTZ , 5.0F, 32, 1, 1 |4|8 |64 , 210, 210, 230, 0, "Charged Certus Quartz" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeLightGray , Arrays.asList(new TC_AspectStack(TC_Aspects.POTENTIA, 2), new TC_AspectStack(TC_Aspects.VITREUS, 1))), CobaltHexahydrate ( 853, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1 |16 , 80, 80, 250, 0, "Cobalt Hexahydrate" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBlue ), ConstructionFoam ( 854, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |16 , 128, 128, 128, 0, "Construction Foam" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeGray ), Chert ( 857, TextureSet.SET_DULL , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Chert" , 0, 0, -1, 0, F, F, 0, 1, 1, Dyes._NULL ), @@ -830,7 +830,7 @@ public enum Materials implements IColorModulationContainer, ISubTagContainer { NetherQuartz .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE, SubTag.QUARTZ); CertusQuartz .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE, SubTag.QUARTZ); Fluix .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE, SubTag.QUARTZ); - ChargedCertusQuartz .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.QUARTZ); + //ChargedCertusQuartz .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.QUARTZ); Phosphorus .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.FLAMMABLE, SubTag.EXPLOSIVE); Phosphate .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.FLAMMABLE, SubTag.EXPLOSIVE); InfusedAir .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.MAGICAL, SubTag.UNBURNABLE); @@ -943,7 +943,7 @@ public enum Materials implements IColorModulationContainer, ISubTagContainer { CassiteriteSand .setOreMultiplier( 2).setSmeltingMultiplier( 2); NetherQuartz .setOreMultiplier( 2).setSmeltingMultiplier( 2); CertusQuartz .setOreMultiplier( 2).setSmeltingMultiplier( 2); - ChargedCertusQuartz .setOreMultiplier( 2).setSmeltingMultiplier( 2); + //ChargedCertusQuartz .setOreMultiplier( 2).setSmeltingMultiplier( 2); Phosphorus .setOreMultiplier( 3).setSmeltingMultiplier( 3); Saltpeter .setOreMultiplier( 4).setSmeltingMultiplier( 4); Apatite .setOreMultiplier( 4).setSmeltingMultiplier( 4).setByProductMultiplier(2); @@ -1083,9 +1083,9 @@ public enum Materials implements IColorModulationContainer, ISubTagContainer { Tungstate .addOreByProducts(Manganese , Silver , Lithium ); Bauxite .addOreByProducts(Grossular , Titanium , Gallium ); QuartzSand .addOreByProducts(CertusQuartz , Quartzite , Barite ); - Quartzite .addOreByProducts(CertusQuartz , Barite , ChargedCertusQuartz ); - CertusQuartz .addOreByProducts(Quartzite , ChargedCertusQuartz , Barite ); - ChargedCertusQuartz .addOreByProducts(CertusQuartz , Quartzite , Barite ); + Quartzite .addOreByProducts(CertusQuartz , Barite ); + CertusQuartz .addOreByProducts(Quartzite , Barite ); + //ChargedCertusQuartz .addOreByProducts(CertusQuartz , Quartzite , Barite ); Redstone .addOreByProducts(Cinnabar , RareEarth , Glowstone ); Monazite .addOreByProducts(Thorium , Neodymium , RareEarth ); Forcicium .addOreByProducts(Thorium , Neodymium , RareEarth ); diff --git a/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java b/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java index 7d8264d94a..63cd01f54d 100644 --- a/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java +++ b/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java @@ -1,12 +1,16 @@ package gregtech.api.metatileentity.implementations; import static gregtech.api.enums.GT_Values.V; +import ic2.api.item.IElectricItem; +import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; import gregtech.api.gui.*; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -133,11 +137,76 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + if(GT_ModHandler.isElectricItem(aStack)&&aStack.getUnlocalizedName().startsWith("gt.metaitem.01.")){ + String name = aStack.getUnlocalizedName(); + if(name.equals("gt.metaitem.01.32510")|| + name.equals("gt.metaitem.01.32511")|| + name.equals("gt.metaitem.01.32520")|| + name.equals("gt.metaitem.01.32521")|| + name.equals("gt.metaitem.01.32530")|| + name.equals("gt.metaitem.01.32531")){ + return true;} + } return false; } @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + if(!GT_Utility.isStackValid(aStack)){ + return false; + } + if(GT_ModHandler.isElectricItem(aStack, this.mTier)){ + return true; + } return false; } + + 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){ + 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); + } + }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}; + } + + private long count=0; + private long mStored=0; + private long mMax=0; + + @Override + public String[] getInfoData() { + count++; + if(mMax==0||count%20==0){ + long[] tmp = getStoredEnergy(); + mStored=tmp[0]; + mMax=tmp[1]; + } + + return new String[] { + getMetaName(), + "Stored Items:", + Long.toString(mStored), + Long.toString(mMax)}; + } + + @Override + public boolean isGivingInformation() { + return true; + } }
\ No newline at end of file diff --git a/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java b/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java index 97b2c2f9f0..b0cba5024c 100644 --- a/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java +++ b/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java @@ -467,7 +467,13 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B @Override public String[] getInfoData() { - return new String[] {"Progress:", (mProgresstime/20)+" secs", (mMaxProgresstime/20)+" secs"}; + return new String[] { + mNEIName, + "Progress:", (mProgresstime/20)+" secs", + (mMaxProgresstime/20)+" secs", + "Stored Energy:", + getBaseMetaTileEntity().getStoredEU()+"EU", + getBaseMetaTileEntity().getEUCapacity()+"EU"}; } @Override |