diff options
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/generators')
5 files changed, 357 insertions, 396 deletions
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java index 83c731a632..f01a8c6532 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java @@ -57,7 +57,7 @@ public class GT_MetaTileEntity_DieselGenerator public void onConfigLoad()
{
- this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "DieselGenerator.efficiency.tier."+this.mTier, (100 - this.mTier * 10));
+ this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "DieselGenerator.efficiency.tier."+this.mTier, (100 - this.mTier * 5));
}
public int getEfficiency()
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java index f6c39bbea5..97607c4b9e 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java @@ -51,7 +51,7 @@ onConfigLoad(); public void onConfigLoad()
{
- this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "GasTurbine.efficiency.tier."+this.mTier, (100 - this.mTier * 10));
+ this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "GasTurbine.efficiency.tier."+this.mTier, (100 - this.mTier * 5));
}
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java index 06935e6137..acfd218ab4 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java @@ -51,7 +51,7 @@ onConfigLoad(); public void onConfigLoad() { - this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyConverter.efficiency.tier."+this.mTier, 100-this.mTier*10); + this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyConverter.efficiency.tier."+this.mTier, 100-this.mTier*5); } diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java index 18add4535b..2374ade4a3 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java @@ -1,7 +1,5 @@ package gregtech.common.tileentities.generators; -import static gregtech.api.enums.GT_Values.V; - import java.util.ArrayList; import thaumcraft.api.aspects.Aspect; @@ -21,7 +19,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; +import static gregtech.api.enums.GT_Values.V; import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.TC_Aspects; @@ -36,269 +34,252 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_BasicGenerator -{ +public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_BasicGenerator { + + public int mEfficiency; + public static boolean sAllowMultipleEggs = true; + public static GT_MetaTileEntity_MagicalEnergyAbsorber mActiveSiphon = null; + public static int sEnergyPerEnderCrystal = 32; + public static int sEnergyFromVis = 12800; + public static final ArrayList<EntityEnderCrystal> sUsedDragonCrystalList = new ArrayList(); + public EntityEnderCrystal mTargetedCrystal; + public static int sDragonEggEnergyPerTick = 128; + public static boolean isThaumcraftLoaded; + + public boolean isOutputFacing(byte aSide) { + return aSide == getBaseMetaTileEntity().getFrontFacing(); + } + + public GT_MetaTileEntity_MagicalEnergyAbsorber(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, "Feasts on magic close to it", new ITexture[0]); + onConfigLoad(); + } + + public GT_MetaTileEntity_MagicalEnergyAbsorber(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + onConfigLoad(); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_MagicalEnergyAbsorber(this.mName, this.mTier, this.mDescription, this.mTextures); + } - public int mEfficiency; - public static boolean sAllowMultipleEggs = true; - public static GT_MetaTileEntity_MagicalEnergyAbsorber mActiveSiphon = null; - public static int sEnergyPerEnderCrystal = 32; - public static int sEnergyFromVis = 12800; - public static final ArrayList<EntityEnderCrystal> sUsedDragonCrystalList = new ArrayList(); - public EntityEnderCrystal mTargetedCrystal; - public static int sDragonEggEnergyPerTick = 128; - public static boolean isThaumcraftLoaded; - - public boolean isOutputFacing(byte aSide) - { - return aSide == getBaseMetaTileEntity().getFrontFacing(); - } - - public GT_MetaTileEntity_MagicalEnergyAbsorber(int aID, String aName, String aNameRegional, int aTier) - { - super(aID, aName, aNameRegional, aTier, "Feasts on magic close to it", new ITexture[0]); - onConfigLoad(); - } - - public GT_MetaTileEntity_MagicalEnergyAbsorber(String aName, int aTier, String aDescription, ITexture[][][] aTextures) - { - super(aName, aTier, aDescription, aTextures); - onConfigLoad(); - } - - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) - { - return new GT_MetaTileEntity_MagicalEnergyAbsorber(this.mName, this.mTier, this.mDescription, this.mTextures); - } - - public GT_Recipe.GT_Recipe_Map getRecipes() - { - return GT_Recipe.GT_Recipe_Map.sMagicFuels; - } - - public int getCapacity() - { - return 16000; - } + public GT_Recipe.GT_Recipe_Map getRecipes() { + return GT_Recipe.GT_Recipe_Map.sMagicFuels; + } - public void onConfigLoad() - { - this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.efficiency.tier."+this.mTier, 100-this.mTier*10); - this.sAllowMultipleEggs = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.AllowMultipleEggs", false); - this.sEnergyPerEnderCrystal = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.EnergyPerTick.EnderCrystal", 32); - this.sEnergyFromVis = (GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.EnergyPerVisDivisor", 2500)*10); - this.sDragonEggEnergyPerTick = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.EnergyPerTick", 2048); - this.isThaumcraftLoaded = Loader.isModLoaded("Thaumcraft"); + public int getCapacity() { + return 16000; + } + + public void onConfigLoad() { + this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.efficiency.tier." + this.mTier, + 100 - this.mTier * 10); + this.sAllowMultipleEggs = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.AllowMultipleEggs", false); + this.sEnergyPerEnderCrystal = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.EnergyPerTick.EnderCrystal", 32); + this.sEnergyFromVis = (GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.EnergyPerVisDivisor", 2500) * 10); + this.sDragonEggEnergyPerTick = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.EnergyPerTick", 2048); + this.isThaumcraftLoaded = Loader.isModLoaded("Thaumcraft"); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() + && aBaseMetaTileEntity.getUniversalEnergyStored() < maxEUOutput() + aBaseMetaTileEntity.getEUCapacity()) { + // Dragon Egg + if (hasEgg() && aTick % 10 == 0) { + getBaseMetaTileEntity().increaseStoredEnergyUnits(sDragonEggEnergyPerTick * getEfficiency() * 10, false); + if ((mActiveSiphon != this) && (!sAllowMultipleEggs)) { + if ((mActiveSiphon == null) || (mActiveSiphon.getBaseMetaTileEntity() == null) + || (mActiveSiphon.getBaseMetaTileEntity().isInvalidTileEntity()) || (!mActiveSiphon.hasEgg())) { + mActiveSiphon = this; + } else { + Block tEgg = mActiveSiphon.getBaseMetaTileEntity().getBlockOffset(0, 1, 0); + if(!getBaseMetaTileEntity().getWorld().getChunkFromBlockCoords(mActiveSiphon.getBaseMetaTileEntity().getXCoord(), mActiveSiphon.getBaseMetaTileEntity().getZCoord()).isChunkLoaded&&(tEgg==Blocks.dragon_egg||tEgg.getUnlocalizedName().equals("tile.dragonEgg"))) + {getBaseMetaTileEntity().doExplosion(Integer.MAX_VALUE);}else{ + mActiveSiphon=this; + } + } + } + } + // Energyzed node + if (isThaumcraftLoaded) { + try { + World tmpWorld = this.getBaseMetaTileEntity().getWorld(); + int tmpX = this.getBaseMetaTileEntity().getXCoord(); + int tmpY = this.getBaseMetaTileEntity().getYCoord(); + int tmpZ = this.getBaseMetaTileEntity().getZCoord(); + int fire = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.FIRE, 1000); + int earth = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.EARTH, 1000); + int air = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.AIR, 1000); + int destruction = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.ENTROPY, 1000); + int order = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.ORDER, 1000); + int water = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.WATER, 1000); + int visEU = (int) (Math.pow(fire, 4) + Math.pow(earth, 4) + Math.pow(air, 4) + Math.pow(destruction, 4) + Math.pow(order, 4) + Math.pow( + water, 4)); + int mult = 85; + if (fire > 4) + mult += 15; + if (earth > 4) + mult += 15; + if (air > 4) + mult += 15; + if (destruction > 4) + mult += 15; + if (order > 4) + mult += 15; + if (water > 4) + mult += 15; + visEU = (visEU * mult) / 100; + getBaseMetaTileEntity().increaseStoredEnergyUnits(Math.min(maxEUOutput(), visEU * getEfficiency() / this.sEnergyFromVis), false); + } catch (Throwable e) { } - - @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.getUniversalEnergyStored() < maxEUOutput() + aBaseMetaTileEntity.getEUCapacity()) { - //Dragon Egg - if(hasEgg()&&aTick%10==0){ - getBaseMetaTileEntity().increaseStoredEnergyUnits(sDragonEggEnergyPerTick*getEfficiency()*10, false); - if ((mActiveSiphon != this) && (!sAllowMultipleEggs)) { - if ((mActiveSiphon == null) || (mActiveSiphon.getBaseMetaTileEntity() == null) || (mActiveSiphon.getBaseMetaTileEntity().isInvalidTileEntity()) || (!mActiveSiphon.hasEgg())) { - mActiveSiphon = this; - } else { - Block tEgg = mActiveSiphon.getBaseMetaTileEntity().getBlockOffset(0, 1, 0); - if(!getBaseMetaTileEntity().getWorld().getChunkFromBlockCoords(mActiveSiphon.getBaseMetaTileEntity().getXCoord(), mActiveSiphon.getBaseMetaTileEntity().getZCoord()).isChunkLoaded&&(tEgg==Blocks.dragon_egg||tEgg.getUnlocalizedName().equals("tile.dragonEgg"))) - {getBaseMetaTileEntity().doExplosion(Integer.MAX_VALUE);}else{ - mActiveSiphon=this; - } - - } - } - } - //Energyzed node - if(isThaumcraftLoaded){ - try{ - World tmpWorld = this.getBaseMetaTileEntity().getWorld(); - int tmpX = this.getBaseMetaTileEntity().getXCoord(); - int tmpY = this.getBaseMetaTileEntity().getYCoord(); - int tmpZ = this.getBaseMetaTileEntity().getZCoord(); - int fire = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.FIRE, 1000); - int earth = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.EARTH, 1000); - int air = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.AIR, 1000); - int destruction = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.ENTROPY, 1000); - int order = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.ORDER, 1000); - int water = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.WATER, 1000); - int visEU = (int) (Math.pow(fire, 4)+Math.pow(earth, 4)+Math.pow(air, 4)+Math.pow(destruction, 4)+Math.pow(order, 4)+Math.pow(water, 4)); - int mult = 85; - if(fire>4)mult+=15; - if(earth>4)mult+=15; - if(air>4)mult+=15; - if(destruction>4)mult+=15; - if(order>4)mult+=15; - if(water>4)mult+=15; - visEU = (visEU*mult) / 100; - getBaseMetaTileEntity().increaseStoredEnergyUnits(Math.min(maxEUOutput(), visEU*getEfficiency()/this.sEnergyFromVis), false); - }catch (Throwable e){} - } - //EnderCrystal - - if (sEnergyPerEnderCrystal > 0) { - if (this.mTargetedCrystal == null) - { - ArrayList<EntityEnderCrystal> tList = (ArrayList)getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(EntityEnderCrystal.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getXCoord() - 64, getBaseMetaTileEntity().getYCoord() - 64, getBaseMetaTileEntity().getZCoord() - 64, getBaseMetaTileEntity().getXCoord() + 64, getBaseMetaTileEntity().getYCoord() + 64, getBaseMetaTileEntity().getZCoord() + 64)); - if ((tList != null) && (!tList.isEmpty())) - { - tList.removeAll(sUsedDragonCrystalList); - if (tList.size() > 0) - { - this.mTargetedCrystal = ((EntityEnderCrystal)tList.get(0)); - if (this.mTargetedCrystal != null) { - sUsedDragonCrystalList.add(this.mTargetedCrystal); - } - } - } - } - else if (this.mTargetedCrystal.isEntityAlive()) - { - getBaseMetaTileEntity().increaseStoredEnergyUnits(sEnergyPerEnderCrystal * 10, false); - } - else - { - sUsedDragonCrystalList.remove(this.mTargetedCrystal); - this.mTargetedCrystal = null; - } - } - - //Absorb entchantments - try - { - if ((this.mInventory[0] != null) && (this.mInventory[1] == null)) - { - if(isThaumcraftLoaded && this.mInventory[0].getItem() instanceof IEssentiaContainerItem){ - AspectList tAspect = ((IEssentiaContainerItem)this.mInventory[0].getItem()).getAspects(this.mInventory[0]); - TC_Aspects tValue = TC_Aspects.valueOf(tAspect.getAspects()[0].getTag().toUpperCase()); - int tEU = (tValue.mValue*tAspect.getAmount((Aspect) tValue.mAspect)*100); - getBaseMetaTileEntity().increaseStoredEnergyUnits(tEU, true); - ItemStack tStack = this.mInventory[0].copy(); - tStack.setTagCompound(null); - tStack.setItemDamage(0); - tStack.stackSize=1; - this.mInventory[1]=tStack; - this.mInventory[0].stackSize--; - if(this.mInventory[0].stackSize<1){this.mInventory[0]=null;} - - }else{ - if ((this.mInventory[0].isItemEnchanted()) && (this.mInventory[0].getItem().getItemEnchantability() > 0)) - { - NBTTagList tEnchantments = this.mInventory[0].getEnchantmentTagList(); - if (tEnchantments != null) - { - for (int i = 0; i < tEnchantments.tagCount(); i++) - { - short tID = ((NBTTagCompound)tEnchantments.getCompoundTagAt(i)).getShort("id"); - short tLevel = ((NBTTagCompound)tEnchantments.getCompoundTagAt(i)).getShort("lvl"); - if ((tID > -1) && (tID < Enchantment.enchantmentsList.length)) - { - Enchantment tEnchantment = Enchantment.enchantmentsList[tID]; - if (tEnchantment != null) { - getBaseMetaTileEntity().increaseStoredEnergyUnits(1000000 * tLevel / (tEnchantment.getMaxLevel() * tEnchantment.getWeight()), true); - } - } - } - this.mInventory[0].stackTagCompound.removeTag("ench"); - } - } - else if ((this.mInventory[0].getItem() instanceof ItemEnchantedBook)) - { - NBTTagList tEnchantments = ((ItemEnchantedBook)this.mInventory[0].getItem()).func_92110_g(this.mInventory[0]); - if (tEnchantments != null) - { - for (int i = 0; i < tEnchantments.tagCount(); i++) - { - short tID = ((NBTTagCompound)tEnchantments.getCompoundTagAt(i)).getShort("id"); - short tLevel = ((NBTTagCompound)tEnchantments.getCompoundTagAt(i)).getShort("lvl"); - if ((tID > -1) && (tID < Enchantment.enchantmentsBookList.length)) - { - Enchantment tEnchantment = Enchantment.enchantmentsBookList[tID]; - if (tEnchantment != null) { - getBaseMetaTileEntity().increaseStoredEnergyUnits(1000000 * tLevel / (tEnchantment.getMaxLevel() * tEnchantment.getWeight()), true); - } - } - } - this.mInventory[0] = new ItemStack(Items.book, 1); - } - } - this.mInventory[1] = this.mInventory[0]; - this.mInventory[0] = null; - } - }} - catch (Throwable e){} + } + // EnderCrystal + if (sEnergyPerEnderCrystal > 0) { + if (this.mTargetedCrystal == null) { + ArrayList<EntityEnderCrystal> tList = (ArrayList) getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB( + EntityEnderCrystal.class, + AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getXCoord() - 64, getBaseMetaTileEntity().getYCoord() - 64, + getBaseMetaTileEntity().getZCoord() - 64, getBaseMetaTileEntity().getXCoord() + 64, + getBaseMetaTileEntity().getYCoord() + 64, getBaseMetaTileEntity().getZCoord() + 64)); + if ((tList != null) && (!tList.isEmpty())) { + tList.removeAll(sUsedDragonCrystalList); + if (tList.size() > 0) { + this.mTargetedCrystal = ((EntityEnderCrystal) tList.get(0)); + if (this.mTargetedCrystal != null) { + sUsedDragonCrystalList.add(this.mTargetedCrystal); + } + } + } + } else if (this.mTargetedCrystal.isEntityAlive()) { + getBaseMetaTileEntity().increaseStoredEnergyUnits(sEnergyPerEnderCrystal * 10, false); + } else { + sUsedDragonCrystalList.remove(this.mTargetedCrystal); + this.mTargetedCrystal = null; + } + } + + // Absorb entchantments and TC essentia + try { + if ((this.mInventory[0] != null) && (this.mInventory[1] == null)) { + if (isThaumcraftLoaded && this.mInventory[0].getItem() instanceof IEssentiaContainerItem) { + AspectList tAspect = ((IEssentiaContainerItem) this.mInventory[0].getItem()).getAspects(this.mInventory[0]); + TC_Aspects tValue = TC_Aspects.valueOf(tAspect.getAspects()[0].getTag().toUpperCase()); + int tEU = (tValue.mValue * tAspect.getAmount((Aspect) tValue.mAspect) * 100); + getBaseMetaTileEntity().increaseStoredEnergyUnits(tEU, true); + ItemStack tStack = this.mInventory[0].copy(); + tStack.setTagCompound(null); + tStack.setItemDamage(0); + tStack.stackSize = 1; + this.mInventory[1] = tStack; + this.mInventory[0].stackSize--; + if (this.mInventory[0].stackSize < 1) { + this.mInventory[0] = null; + } + + } else { + if ((this.mInventory[0].isItemEnchanted()) && (this.mInventory[0].getItem().getItemEnchantability() > 0)) { + NBTTagList tEnchantments = this.mInventory[0].getEnchantmentTagList(); + if (tEnchantments != null) { + for (int i = 0; i < tEnchantments.tagCount(); i++) { + short tID = ((NBTTagCompound) tEnchantments.getCompoundTagAt(i)).getShort("id"); + short tLevel = ((NBTTagCompound) tEnchantments.getCompoundTagAt(i)).getShort("lvl"); + if ((tID > -1) && (tID < Enchantment.enchantmentsList.length)) { + Enchantment tEnchantment = Enchantment.enchantmentsList[tID]; + if (tEnchantment != null) { + getBaseMetaTileEntity().increaseStoredEnergyUnits( + 1000000 * tLevel / (tEnchantment.getMaxLevel() * tEnchantment.getWeight()), true); + } + } + } + this.mInventory[0].stackTagCompound.removeTag("ench"); + } + } else if ((this.mInventory[0].getItem() instanceof ItemEnchantedBook)) { + NBTTagList tEnchantments = ((ItemEnchantedBook) this.mInventory[0].getItem()).func_92110_g(this.mInventory[0]); + if (tEnchantments != null) { + for (int i = 0; i < tEnchantments.tagCount(); i++) { + short tID = ((NBTTagCompound) tEnchantments.getCompoundTagAt(i)).getShort("id"); + short tLevel = ((NBTTagCompound) tEnchantments.getCompoundTagAt(i)).getShort("lvl"); + if ((tID > -1) && (tID < Enchantment.enchantmentsBookList.length)) { + Enchantment tEnchantment = Enchantment.enchantmentsBookList[tID]; + if (tEnchantment != null) { + getBaseMetaTileEntity().increaseStoredEnergyUnits( + 1000000 * tLevel / (tEnchantment.getMaxLevel() * tEnchantment.getWeight()), true); + } + } + } + this.mInventory[0] = new ItemStack(Items.book, 1); + } + } + this.mInventory[1] = this.mInventory[0]; + this.mInventory[0] = null; } - } - - public void inValidate() - { - if (mActiveSiphon == this) { - mActiveSiphon = null; - } - } - - public boolean hasEgg() - { - Block above = getBaseMetaTileEntity().getBlockOffset(0, 1, 0); - if(above==null||Blocks.air==above){return false;} - return Blocks.dragon_egg == above || above.getUnlocalizedName().equals("tile.dragonEgg"); - } - - @Override public long maxEUStore(){return Math.max(getEUVar(), V[mTier] * 16000 + getMinimumStoredEU());} - - public int getEfficiency() - { - return this.mEfficiency; - } - - public ITexture[] getFront(byte aColor) - { - return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; - } - - public ITexture[] getBack(byte aColor) - { - return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT) }; - } - - public ITexture[] getBottom(byte aColor) - { - return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) }; - } - - public ITexture[] getTop(byte aColor) - { - return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG) }; - } - - public ITexture[] getSides(byte aColor) - { - return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) }; - } - - public ITexture[] getFrontActive(byte aColor) - { - return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; - } - - public ITexture[] getBackActive(byte aColor) - { - return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT_ACTIVE) }; - } - - public ITexture[] getBottomActive(byte aColor) - { - return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) }; - } - - public ITexture[] getTopActive(byte aColor) - { - return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG) }; - } - - public ITexture[] getSidesActive(byte aColor) - { - return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) }; - } + } + } catch (Throwable e) { + } + } + } + + public void inValidate() { + if (mActiveSiphon == this) { + mActiveSiphon = null; + } + } + + public boolean hasEgg() { + Block above = getBaseMetaTileEntity().getBlockOffset(0, 1, 0); + if (above == null || Blocks.air == above) { + return false; + } + return Blocks.dragon_egg == above || above.getUnlocalizedName().equals("tile.dragonEgg"); + } + + public int getEfficiency() { + return this.mEfficiency; + } + + @Override public long maxEUStore(){return Math.max(getEUVar(), V[mTier] * 16000 + getMinimumStoredEU());} + + public ITexture[] getFront(byte aColor) { + return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; + } + + public ITexture[] getBack(byte aColor) { + return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT) }; + } + + public ITexture[] getBottom(byte aColor) { + return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) }; + } + + public ITexture[] getTop(byte aColor) { + return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG) }; + } + + public ITexture[] getSides(byte aColor) { + return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) }; + } + + public ITexture[] getFrontActive(byte aColor) { + return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; + } + + public ITexture[] getBackActive(byte aColor) { + return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT_ACTIVE) }; + } + + public ITexture[] getBottomActive(byte aColor) { + return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) }; + } + + public ITexture[] getTopActive(byte aColor) { + return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG) }; + } + + public ITexture[] getSidesActive(byte aColor) { + return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) }; + } }
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java index 9da9f6b27e..e44484aad3 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java @@ -1,129 +1,109 @@ -package gregtech.common.tileentities.generators;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.ConfigCategories;
-import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-import net.minecraftforge.fluids.FluidStack;
-
-public class GT_MetaTileEntity_SteamTurbine
- extends GT_MetaTileEntity_BasicGenerator
-{
-
- public int mEfficiency;
- public boolean isOutputFacing(byte aSide)
- {
- return aSide == getBaseMetaTileEntity().getFrontFacing();
- }
-
- public GT_MetaTileEntity_SteamTurbine(int aID, String aName, String aNameRegional, int aTier)
- {
- super(aID, aName, aNameRegional, aTier, "Requires Steam to run", new ITexture[0]);
-onConfigLoad();
- }
-
- public GT_MetaTileEntity_SteamTurbine(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aTier, aDescription, aTextures);
-onConfigLoad();
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_SteamTurbine(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipes()
- {
- return null;
- }
-
- public int getCapacity()
- {
- return 24000 * this.mTier;
- }
-
-public void onConfigLoad()
- {
- this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "SteamTurbine.efficiency.tier."+this.mTier, (200 / consumedFluidPerOperation(GT_ModHandler.getSteam(1L))));
-}
-
- public int getEfficiency()
- {
- return this.mEfficiency;
- }
-
- public int getFuelValue(FluidStack aLiquid)
- {
- return GT_ModHandler.isSteam(aLiquid) ? 1 : 0;
- }
-
- public int consumedFluidPerOperation(FluidStack aLiquid)
- {
- return 2 + this.mTier;
- }
-
- public ITexture[] getFront(byte aColor)
- {
- return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_FRONT), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] };
- }
-
- public ITexture[] getBack(byte aColor)
- {
- return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BACK) };
- }
-
- public ITexture[] getBottom(byte aColor)
- {
- return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BOTTOM) };
- }
-
- public ITexture[] getTop(byte aColor)
- {
- return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_TOP) };
- }
-
- public ITexture[] getSides(byte aColor)
- {
- return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_SIDE) };
- }
-
- public ITexture[] getFrontActive(byte aColor)
- {
- return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_FRONT_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] };
- }
-
- public ITexture[] getBackActive(byte aColor)
- {
- return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BACK_ACTIVE) };
- }
-
- public ITexture[] getBottomActive(byte aColor)
- {
- return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BOTTOM_ACTIVE) };
- }
-
- public ITexture[] getTopActive(byte aColor)
- {
- return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_TOP_ACTIVE) };
- }
-
- public ITexture[] getSidesActive(byte aColor)
- {
- return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_SIDE_ACTIVE) };
- }
-}
-
-
-/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
- * Qualified Name: gregtech.common.tileentities.generators.GT_MetaTileEntity_SteamTurbine
- * JD-Core Version: 0.7.0.1
- */
\ No newline at end of file +package gregtech.common.tileentities.generators; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.Textures; +import gregtech.api.enums.Textures.BlockIcons; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import net.minecraftforge.fluids.FluidStack; + +public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGenerator { + + public int mEfficiency; + + public boolean isOutputFacing(byte aSide) { + return aSide == getBaseMetaTileEntity().getFrontFacing(); + } + + public GT_MetaTileEntity_SteamTurbine(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, "Requires Steam to run", new ITexture[0]); + onConfigLoad(); + } + + public GT_MetaTileEntity_SteamTurbine(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + onConfigLoad(); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_SteamTurbine(this.mName, this.mTier, this.mDescription, this.mTextures); + } + + public GT_Recipe.GT_Recipe_Map getRecipes() { + return null; + } + + @Override + public String[] getDescription() { + return new String[] {mDescription, "Fuel Efficiency: " + (600/getEfficiency()) + "%"}; + } + + public int getCapacity() { + return 24000 * this.mTier; + } + + public void onConfigLoad() { + this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "SteamTurbine.efficiency.tier." + this.mTier,6+this.mTier); + } + + public int getEfficiency() { + return this.mEfficiency; + } + + public int getFuelValue(FluidStack aLiquid) { + return GT_ModHandler.isSteam(aLiquid) ? 3 : 0; + } + + public int consumedFluidPerOperation(FluidStack aLiquid) { + return this.mEfficiency; + } + + public ITexture[] getFront(byte aColor) { + return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_FRONT), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; + } + + public ITexture[] getBack(byte aColor) { + return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BACK) }; + } + + public ITexture[] getBottom(byte aColor) { + return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BOTTOM) }; + } + + public ITexture[] getTop(byte aColor) { + return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_TOP) }; + } + + public ITexture[] getSides(byte aColor) { + return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_SIDE) }; + } + + public ITexture[] getFrontActive(byte aColor) { + return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_FRONT_ACTIVE), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; + } + + public ITexture[] getBackActive(byte aColor) { + return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BACK_ACTIVE) }; + } + + public ITexture[] getBottomActive(byte aColor) { + return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BOTTOM_ACTIVE) }; + } + + public ITexture[] getTopActive(byte aColor) { + return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_TOP_ACTIVE) }; + } + + public ITexture[] getSidesActive(byte aColor) { + return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_SIDE_ACTIVE) }; + } +}
\ No newline at end of file |
