diff options
author | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-18 23:04:39 -0400 |
---|---|---|
committer | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-18 23:04:39 -0400 |
commit | 85c804fa112fd1f19c91e45d150a787cfbf0f7a8 (patch) | |
tree | cb302d8e0f46e06be0b1d391317578b165aec245 /src/main/java/gregtech/common/tileentities/generators | |
parent | ce25063b910bb3bdd2b0c234b185fc4077caebdb (diff) | |
download | GT5-Unofficial-85c804fa112fd1f19c91e45d150a787cfbf0f7a8.tar.gz GT5-Unofficial-85c804fa112fd1f19c91e45d150a787cfbf0f7a8.tar.bz2 GT5-Unofficial-85c804fa112fd1f19c91e45d150a787cfbf0f7a8.zip |
Move source directory
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/generators')
8 files changed, 1105 insertions, 0 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 new file mode 100644 index 0000000000..4ed569dcc2 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java @@ -0,0 +1,126 @@ +package gregtech.common.tileentities.generators;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.ItemList;
+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.*;
+import gregtech.api.objects.GT_ArrayList;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Config;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import net.minecraft.item.ItemStack;
+
+public class GT_MetaTileEntity_DieselGenerator
+ extends GT_MetaTileEntity_BasicGenerator
+{
+
+ public int mEfficiency;
+ public boolean isOutputFacing(byte aSide)
+ {
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ public GT_MetaTileEntity_DieselGenerator(int aID, String aName, String aNameRegional, int aTier)
+ {
+ super(aID, aName, aNameRegional, aTier, "Requires liquid Fuel", new ITexture[0]);
+ onConfigLoad();
+ }
+
+ public GT_MetaTileEntity_DieselGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aTier, aDescription, aTextures);
+ onConfigLoad();
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_DieselGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipes()
+ {
+ return GT_Recipe.GT_Recipe_Map.sDieselFuels;
+ }
+
+ public int getCapacity()
+ {
+ return 16000;
+ }
+
+ public void onConfigLoad()
+ {
+ this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "DieselGenerator.efficiency.tier."+this.mTier, (100 - this.mTier * 10));
+}
+
+ public int getEfficiency()
+ {
+ return this.mEfficiency;
+ }
+
+ public int getFuelValue(ItemStack aStack)
+ {
+ int rValue = Math.max(GT_ModHandler.getFuelCanValue(aStack) * 6 / 5, super.getFuelValue(aStack));
+ if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) {
+ rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3);
+ }
+ return rValue;
+ }
+
+ public ITexture[] getFront(byte aColor)
+ {
+ return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_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.DIESEL_GENERATOR_BACK) };
+ }
+
+ public ITexture[] getBottom(byte aColor)
+ {
+ return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM) };
+ }
+
+ public ITexture[] getTop(byte aColor)
+ {
+ return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP) };
+ }
+
+ public ITexture[] getSides(byte aColor)
+ {
+ return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE) };
+ }
+
+ public ITexture[] getFrontActive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_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.DIESEL_GENERATOR_BACK_ACTIVE) };
+ }
+
+ public ITexture[] getBottomActive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM_ACTIVE) };
+ }
+
+ public ITexture[] getTopActive(byte aColor)
+ {
+ return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE) };
+ }
+
+ public ITexture[] getSidesActive(byte aColor)
+ {
+ return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE) };
+ }
+}
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_FluidNaquadahReactor.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_FluidNaquadahReactor.java new file mode 100644 index 0000000000..fef02461b1 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_FluidNaquadahReactor.java @@ -0,0 +1,108 @@ +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_Recipe;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+
+public class GT_MetaTileEntity_FluidNaquadahReactor
+ extends GT_MetaTileEntity_BasicGenerator
+{
+ public int mEfficiency;
+ public boolean isOutputFacing(byte aSide)
+ {
+ return (aSide > 1) && (aSide != getBaseMetaTileEntity().getFrontFacing()) && (aSide != getBaseMetaTileEntity().getBackFacing());
+ }
+
+ public GT_MetaTileEntity_FluidNaquadahReactor(int aID, String aName, String aNameRegional, int aTier)
+ {
+ super(aID, aName, aNameRegional, aTier, "Requires Enriched Naquadah Cells", new ITexture[0]);onConfigLoad();
+ }
+
+ public GT_MetaTileEntity_FluidNaquadahReactor(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aTier, aDescription, aTextures);onConfigLoad();
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_FluidNaquadahReactor(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipes()
+ {
+ return GT_Recipe.GT_Recipe_Map.sFluidNaquadahReactorFuels;
+ }
+
+ public int getCapacity()
+ {
+ return 16000;
+ }
+
+ public int getEfficiency()
+ {
+ return mEfficiency;
+ }
+
+ public void onConfigLoad()
+ {
+ this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "FluidNaquadah.efficiency.tier."+this.mTier, 100);
+}
+
+ public ITexture[] getFront(byte aColor)
+ {
+ return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_FRONT) };
+ }
+
+ public ITexture[] getBack(byte aColor)
+ {
+ return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_BACK) };
+ }
+
+ public ITexture[] getBottom(byte aColor)
+ {
+ return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_BOTTOM) };
+ }
+
+ public ITexture[] getTop(byte aColor)
+ {
+ return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_TOP) };
+ }
+
+ public ITexture[] getSides(byte aColor)
+ {
+ return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE) };
+ }
+
+ public ITexture[] getFrontActive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_FRONT_ACTIVE) };
+ }
+
+ public ITexture[] getBackActive(byte aColor)
+ {
+ return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_BACK_ACTIVE) };
+ }
+
+ public ITexture[] getBottomActive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_BOTTOM_ACTIVE) };
+ }
+
+ public ITexture[] getTopActive(byte aColor)
+ {
+ return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_TOP_ACTIVE) };
+ }
+
+ public ITexture[] getSidesActive(byte aColor)
+ {
+ return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE) };
+ }
+}
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 new file mode 100644 index 0000000000..488771a691 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java @@ -0,0 +1,112 @@ +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_Recipe;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+
+public class GT_MetaTileEntity_GasTurbine
+ extends GT_MetaTileEntity_BasicGenerator
+{
+
+ public int mEfficiency;
+ public boolean isOutputFacing(byte aSide)
+ {
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ public GT_MetaTileEntity_GasTurbine(int aID, String aName, String aNameRegional, int aTier)
+ {
+ super(aID, aName, aNameRegional, aTier, "Requires flammable Gasses", new ITexture[0]);
+onConfigLoad();
+ }
+
+ public GT_MetaTileEntity_GasTurbine(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aTier, aDescription, aTextures);
+onConfigLoad();
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_GasTurbine(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipes()
+ {
+ return GT_Recipe.GT_Recipe_Map.sTurbineFuels;
+ }
+
+ public int getCapacity()
+ {
+ return 16000;
+ }
+
+public void onConfigLoad()
+ {
+ this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "GasTurbine.efficiency.tier."+this.mTier, (100 - this.mTier * 10));
+}
+
+
+ public int getEfficiency()
+ {
+ return this.mEfficiency;
+ }
+
+ public ITexture[] getFront(byte aColor)
+ {
+ return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_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.GAS_TURBINE_BACK) };
+ }
+
+ public ITexture[] getBottom(byte aColor)
+ {
+ return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_BOTTOM) };
+ }
+
+ public ITexture[] getTop(byte aColor)
+ {
+ return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_TOP) };
+ }
+
+ public ITexture[] getSides(byte aColor)
+ {
+ return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_SIDE) };
+ }
+
+ public ITexture[] getFrontActive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_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.GAS_TURBINE_BACK_ACTIVE) };
+ }
+
+ public ITexture[] getBottomActive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_BOTTOM_ACTIVE) };
+ }
+
+ public ITexture[] getTopActive(byte aColor)
+ {
+ return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_TOP_ACTIVE) };
+ }
+
+ public ITexture[] getSidesActive(byte aColor)
+ {
+ return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_SIDE_ACTIVE) };
+ }
+}
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 new file mode 100644 index 0000000000..06935e6137 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java @@ -0,0 +1,112 @@ +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_Recipe; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; + +public class GT_MetaTileEntity_MagicEnergyConverter + extends GT_MetaTileEntity_BasicGenerator +{ + + public int mEfficiency; + public boolean isOutputFacing(byte aSide) + { + return aSide == getBaseMetaTileEntity().getFrontFacing(); + } + + public GT_MetaTileEntity_MagicEnergyConverter(int aID, String aName, String aNameRegional, int aTier) + { + super(aID, aName, aNameRegional, aTier, "Put your strange stuff in here", new ITexture[0]); +onConfigLoad(); + } + + public GT_MetaTileEntity_MagicEnergyConverter(String aName, int aTier, String aDescription, ITexture[][][] aTextures) + { + super(aName, aTier, aDescription, aTextures); +onConfigLoad(); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) + { + return new GT_MetaTileEntity_MagicEnergyConverter(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 void onConfigLoad() + { + this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyConverter.efficiency.tier."+this.mTier, 100-this.mTier*10); +} + + + 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_MAGIC) }; + } + + 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_MAGIC_ACTIVE) }; + } + + 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_MagicalEnergyAbsorber.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java new file mode 100644 index 0000000000..18add4535b --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java @@ -0,0 +1,304 @@ +package gregtech.common.tileentities.generators; + +import static gregtech.api.enums.GT_Values.V; + +import java.util.ArrayList; + +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import thaumcraft.api.aspects.IEssentiaContainerItem; +import thaumcraft.api.visnet.VisNetHandler; +import cpw.mods.fml.common.Loader; +import net.minecraft.block.Block; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemEnchantedBook; +import net.minecraft.item.ItemStack; +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 gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.TC_Aspects; +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_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 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 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){} + } + //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){} + } + } + + 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) }; + } +}
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java new file mode 100644 index 0000000000..c547432901 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java @@ -0,0 +1,112 @@ +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_Recipe; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; + +public class GT_MetaTileEntity_PlasmaGenerator + extends GT_MetaTileEntity_BasicGenerator +{ + + public int mEfficiency; + public boolean isOutputFacing(byte aSide) + { + return aSide == getBaseMetaTileEntity().getFrontFacing(); + } + + public GT_MetaTileEntity_PlasmaGenerator(int aID, String aName, String aNameRegional, int aTier) + { + super(aID, aName, aNameRegional, aTier, "Plasma into energy", new ITexture[0]); +onConfigLoad(); + } + + public GT_MetaTileEntity_PlasmaGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) + { + super(aName, aTier, aDescription, aTextures); +onConfigLoad(); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) + { + return new GT_MetaTileEntity_PlasmaGenerator(this.mName, this.mTier, this.mDescription, this.mTextures); + } + + public GT_Recipe.GT_Recipe_Map getRecipes() + { + return GT_Recipe.GT_Recipe_Map.sPlasmaFuels; + } + + public int getCapacity() + { + return 16000; + } + +public void onConfigLoad() + { + this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "PlasmaGenerator.efficiency.tier."+this.mTier, (10 + (this.mTier * 10))); +} + + + 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_FUSION_GLASS), 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_FUSION_GLASS) }; + } + + public ITexture[] getBottom(byte aColor) + { + return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS) }; + } + + public ITexture[] getTop(byte aColor) + { + return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS) }; + } + + public ITexture[] getSides(byte aColor) + { + return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS) }; + } + + public ITexture[] getFrontActive(byte aColor) + { + return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW), 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_FUSION_GLASS_YELLOW) }; + } + + public ITexture[] getBottomActive(byte aColor) + { + return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) }; + } + + public ITexture[] getTopActive(byte aColor) + { + return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) }; + } + + public ITexture[] getSidesActive(byte aColor) + { + return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) }; + } +}
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor.java new file mode 100644 index 0000000000..ef569485d5 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor.java @@ -0,0 +1,108 @@ +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_Recipe;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+
+public class GT_MetaTileEntity_SolidNaquadahReactor
+ extends GT_MetaTileEntity_BasicGenerator
+{
+ public int mEfficiency;
+ public boolean isOutputFacing(byte aSide)
+ {
+ return (aSide > 1) && (aSide != getBaseMetaTileEntity().getFrontFacing()) && (aSide != getBaseMetaTileEntity().getBackFacing());
+ }
+
+ public GT_MetaTileEntity_SolidNaquadahReactor(int aID, String aName, String aNameRegional, int aTier)
+ {
+ super(aID, aName, aNameRegional, aTier, "Requires Enriched Naquadah Bolts", new ITexture[0]);onConfigLoad();
+ }
+
+ public GT_MetaTileEntity_SolidNaquadahReactor(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aTier, aDescription, aTextures);onConfigLoad();
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_SolidNaquadahReactor(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipes()
+ {
+ return GT_Recipe.GT_Recipe_Map.sSmallNaquadahReactorFuels;
+ }
+
+ public int getCapacity()
+ {
+ return 0;
+ }
+
+ public int getEfficiency()
+ {
+ return mEfficiency;
+ }
+
+ public void onConfigLoad()
+ {
+ this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "SolidNaquadah.efficiency.tier."+this.mTier, 80);
+}
+
+ public ITexture[] getFront(byte aColor)
+ {
+ return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT) };
+ }
+
+ public ITexture[] getBack(byte aColor)
+ {
+ return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_BACK) };
+ }
+
+ public ITexture[] getBottom(byte aColor)
+ {
+ return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_BOTTOM) };
+ }
+
+ public ITexture[] getTop(byte aColor)
+ {
+ return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP) };
+ }
+
+ public ITexture[] getSides(byte aColor)
+ {
+ return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_SIDE) };
+ }
+
+ public ITexture[] getFrontActive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE) };
+ }
+
+ public ITexture[] getBackActive(byte aColor)
+ {
+ return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_BACK_ACTIVE) };
+ }
+
+ public ITexture[] getBottomActive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE) };
+ }
+
+ public ITexture[] getTopActive(byte aColor)
+ {
+ return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE) };
+ }
+
+ public ITexture[] getSidesActive(byte aColor)
+ {
+ return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE) };
+ }
+}
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 new file mode 100644 index 0000000000..6a82eed4d2 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java @@ -0,0 +1,123 @@ +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) };
+ }
+}
|