diff options
author | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-21 22:06:25 -0400 |
---|---|---|
committer | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-21 22:06:25 -0400 |
commit | 9353aa711b1d750ff945acdfed2d3b956291b615 (patch) | |
tree | d6ca62ab093dede52afef0d82ac29d32c56fb29b /src/main/java/gregtech/common/tileentities/generators | |
parent | 445e6c3f25714ecf15c07dcd3462375d65b6dc92 (diff) | |
download | GT5-Unofficial-9353aa711b1d750ff945acdfed2d3b956291b615.tar.gz GT5-Unofficial-9353aa711b1d750ff945acdfed2d3b956291b615.tar.bz2 GT5-Unofficial-9353aa711b1d750ff945acdfed2d3b956291b615.zip |
Reformat code
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/generators')
8 files changed, 804 insertions, 924 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 09c145d79e..ebc670f5e6 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 @@ -5,122 +5,99 @@ 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.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator;
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 * 5));
-}
+ extends GT_MetaTileEntity_BasicGenerator {
+
+ public int mEfficiency;
+
+ 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 boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ 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 * 5));
+ }
+
+ 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 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) };
- }
+ 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 index fef02461b1..928c7261f7 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_FluidNaquadahReactor.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_FluidNaquadahReactor.java @@ -3,106 +3,88 @@ 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) };
- }
+ extends GT_MetaTileEntity_BasicGenerator {
+ public int mEfficiency;
+
+ 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 boolean isOutputFacing(byte aSide) {
+ return (aSide > 1) && (aSide != getBaseMetaTileEntity().getFrontFacing()) && (aSide != getBaseMetaTileEntity().getBackFacing());
+ }
+
+ 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 index 6dc5a89b78..7002e56cee 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 @@ -3,110 +3,90 @@ 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 * 5));
-}
+ extends GT_MetaTileEntity_BasicGenerator {
+
+ public int mEfficiency;
+
+ 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 boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ 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 * 5));
+ }
+
+
+ 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 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) };
- }
+ 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 index acfd218ab4..5007c9a907 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 @@ -3,110 +3,90 @@ 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*5); -} - - - 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) }; - } + extends GT_MetaTileEntity_BasicGenerator { + + public int mEfficiency; + + 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 boolean isOutputFacing(byte aSide) { + return aSide == getBaseMetaTileEntity().getFrontFacing(); + } + + 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 * 5); + } + + + 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 index 2374ade4a3..5f452c6e00 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,285 +1,286 @@ package gregtech.common.tileentities.generators; -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 gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.TC_Aspects; +import gregtech.api.enums.Textures; +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 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 thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import thaumcraft.api.aspects.IEssentiaContainerItem; +import thaumcraft.api.visnet.VisNetHandler; + +import java.util.ArrayList; + import static gregtech.api.enums.GT_Values.V; -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 static final ArrayList<EntityEnderCrystal> sUsedDragonCrystalList = new ArrayList(); + public static boolean sAllowMultipleEggs = true; + public static GT_MetaTileEntity_MagicalEnergyAbsorber mActiveSiphon = null; + public static int sEnergyPerEnderCrystal = 32; + public static int sEnergyFromVis = 12800; + public static int sDragonEggEnergyPerTick = 128; + public static boolean isThaumcraftLoaded; + public int mEfficiency; + public EntityEnderCrystal mTargetedCrystal; + + 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 boolean isOutputFacing(byte aSide) { - return aSide == getBaseMetaTileEntity().getFrontFacing(); - } + public GT_MetaTileEntity_MagicalEnergyAbsorber(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + onConfigLoad(); + } - 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 boolean isOutputFacing(byte aSide) { + return aSide == getBaseMetaTileEntity().getFrontFacing(); + } - 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 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 GT_Recipe.GT_Recipe_Map getRecipes() { - return GT_Recipe.GT_Recipe_Map.sMagicFuels; - } + public int getCapacity() { + return 16000; + } - 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"); + } - 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; + } + } - @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 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; + } - // 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; + } + } + } catch (Throwable e) { + } + } + } - } 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 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 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; + } - public int getEfficiency() { - return this.mEfficiency; - } - - @Override public long maxEUStore(){return Math.max(getEUVar(), V[mTier] * 16000 + getMinimumStoredEU());} + @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[] 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[] 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[] 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[] 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[] 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[] 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[] 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[] 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[] 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) }; - } + 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 index c547432901..020369e3f2 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java @@ -3,110 +3,90 @@ 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) }; - } + extends GT_MetaTileEntity_BasicGenerator { + + public int mEfficiency; + + 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 boolean isOutputFacing(byte aSide) { + return aSide == getBaseMetaTileEntity().getFrontFacing(); + } + + 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 index ef569485d5..faf47c1937 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor.java @@ -3,106 +3,88 @@ 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) };
- }
+ extends GT_MetaTileEntity_BasicGenerator {
+ public int mEfficiency;
+
+ 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 boolean isOutputFacing(byte aSide) {
+ return (aSide > 1) && (aSide != getBaseMetaTileEntity().getFrontFacing()) && (aSide != getBaseMetaTileEntity().getBackFacing());
+ }
+
+ 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 index d0f3890237..0ee3bdc726 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 @@ -3,7 +3,6 @@ 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;
@@ -11,99 +10,98 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenera 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) };
- }
+ public int mEfficiency;
+
+ 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 boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ 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)};
+ }
}
|