aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java108
1 files changed, 95 insertions, 13 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java
index eabed23e23..b9fd375fdd 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java
@@ -1,35 +1,47 @@
package gtPlusPlus.xmod.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.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.common.tileentities.generators.GT_MetaTileEntity_DieselGenerator;
+import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;
+import net.minecraft.item.ItemStack;
-public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_DieselGenerator{
-
- public GT_MetaTileEntity_SemiFluidGenerator(int aID, String aName, String aNameRegional, int aTier) {
+public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_BasicGenerator{
+
+ public static final int BASE_POLLUTION = 2;
+ public int mEfficiency;
+
+ /*public GT_MetaTileEntity_SemiFluidGenerator(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier);
onConfigLoad();
- }
+ }*/
- public GT_MetaTileEntity_SemiFluidGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
+ public GT_MetaTileEntity_SemiFluidGenerator(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier,
+ "Requires heavy-fluid Fuel",
+ new ITexture[0]);
onConfigLoad();
}
- public GT_MetaTileEntity_SemiFluidGenerator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_SemiFluidGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
onConfigLoad();
}
-
+
public int getPollution() {
return (int) (2.0D * Math.pow(2.0D, this.mTier));
}
-
+
public int getCapacity() {
return 8000;
}
@@ -38,18 +50,88 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Dies
this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig,
"SemiFluidGenerator.efficiency.tier." + this.mTier, 100 - (this.mTier * 10));
}
-
+
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_SemiFluidGenerator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures);
+ return new GT_MetaTileEntity_SemiFluidGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
}
public GT_Recipe.GT_Recipe_Map getRecipes() {
return GT_Recipe.GT_Recipe_Map.sDenseLiquidFuels;
}
-
+
@Override
public String[] getDescription() {
return new String[]{this.mDescription, "Produces "+(this.getPollution()*20)+" pollution/sec", "Fuel Efficiency: "+this.getEfficiency() + "%", CORE.GT_Tooltip};
}
+
+ public int getEfficiency() {
+ return this.mEfficiency;
+ }
+ public boolean isOutputFacing(byte aSide) {
+ return (aSide == getBaseMetaTileEntity().getFrontFacing());
+ }
+
+ public int getFuelValue(ItemStack aStack) {
+ if ((GT_Utility.isStackInvalid(aStack)) || (getRecipes() == null))
+ return 0;
+ 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) };
+ }
+
}