aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java5
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java36
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java70
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java350
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java30
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java165
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java155
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java65
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java66
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java587
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLargeTurbinesAndHeatExchanger.java16
13 files changed, 934 insertions, 615 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
index 6bfcf1fb67..cd8b5d3151 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
@@ -369,7 +369,8 @@ public enum GregtechItemList implements GregtechItemContainer {
Casing_SolarTower_HeatContainment,
//Larger Turbines
- /*Large_Steam_Turbine, Large_HPSteam_Turbine, */
+ Large_Steam_Turbine, Large_HPSteam_Turbine,
+ Large_Gas_Turbine, Large_Plasma_Turbine,
Casing_Turbine_Shaft,
Casing_Turbine_LP, Casing_Turbine_HP,
Casing_Turbine_Gas, Casing_Turbine_Plasma,
@@ -441,7 +442,7 @@ public enum GregtechItemList implements GregtechItemContainer {
Hatch_Air_Intake,
//XL Turbine Rotor Hatch
- /*Hatch_Turbine_Rotor,*/
+ Hatch_Turbine_Rotor,
//Standard Turbine Rotor Hatch
Hatch_Input_TurbineHousing,
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java
index a9cd179214..3ece45cf78 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java
@@ -1,11 +1,9 @@
-/*
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
@@ -21,10 +19,10 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.turbine.LargeTurbineTextu
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines.GregtechMetaTileEntity_LargerTurbineBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
+@SuppressWarnings("deprecation")
public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch {
public boolean mHasController = false;
@@ -72,6 +70,22 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch {
public boolean isValidSlot(int aIndex) {
return false;
}
+
+ public boolean hasTurbine() {
+ return GregtechMetaTileEntity_LargerTurbineBase.isValidTurbine(this.mInventory[0]);
+ }
+
+ public boolean canWork() {
+ return hasTurbine();
+ }
+
+ public boolean insertTurbine(ItemStack aTurbine) {
+ if (GregtechMetaTileEntity_LargerTurbineBase.isValidTurbine(aTurbine)) {
+ this.mInventory[0] = aTurbine;
+ return true;
+ }
+ return false;
+ }
@Override
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
@@ -89,6 +103,7 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch {
PlayerUtils.messagePlayer(aPlayer, "[Turbine Assembly Data] Controller Active? "+this.isControllerActive());
}
PlayerUtils.messagePlayer(aPlayer, "[Turbine Assembly Data] Is Active? "+this.getBaseMetaTileEntity().isActive());
+ PlayerUtils.messagePlayer(aPlayer, "[Turbine Assembly Data] Has Turbine inserted? "+this.hasTurbine());
return true;
}
@@ -180,10 +195,10 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch {
public boolean isControllerActive() {
GregtechMetaTileEntity_LargerTurbineBase x = getController();
if (x != null) {
- Logger.INFO("Checking Status of Controller.");
+ //Logger.INFO("Checking Status of Controller.");
return x.isMachineRunning();
}
- Logger.INFO("Status of Controller failed, controller is null.");
+ //Logger.INFO("Status of Controller failed, controller is null.");
return false;
}
@@ -239,7 +254,7 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch {
private ITexture getFrontFacingTurbineTexture() {
if (!mHasController) {
- return this.getBaseMetaTileEntity().isActive() ? new GT_RenderedTexture(LargeTurbineTextureHandler.frontFaceHPActive_4) : new GT_RenderedTexture(LargeTurbineTextureHandler.frontFace_4 );
+ return this.getBaseMetaTileEntity().isActive() ? new GT_RenderedTexture(LargeTurbineTextureHandler.OVERLAY_LP_TURBINE_ACTIVE[4] ) : new GT_RenderedTexture(LargeTurbineTextureHandler.OVERLAY_LP_TURBINE[4] );
}
else {
if (usingAnimations()) {
@@ -272,8 +287,7 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch {
}
@Override
- public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
- float aZ) {
+ public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
// TODO Auto-generated method stub
return super.onWrenchRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ);
}
@@ -309,8 +323,4 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch {
this.getBaseMetaTileEntity().setActive(b);
}
-
-
-
-
-}*/
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
index 356f96f7cc..825a55632d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
@@ -1452,7 +1452,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En
public boolean isMachineRunning() {
boolean aRunning = this.getBaseMetaTileEntity().isActive();
- log("Queried Multiblock is currently running: "+aRunning);
+ //log("Queried Multiblock is currently running: "+aRunning);
return aRunning;
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java
index 5a5c923d10..0eccd75b66 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java
@@ -2,21 +2,24 @@ package gtPlusPlus.xmod.gregtech.common.blocks;
import java.util.List;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
import gregtech.api.util.GT_LanguageManager;
import gregtech.common.blocks.GT_Material_Casings;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import gtPlusPlus.xmod.gregtech.common.blocks.textures.turbine.LargeTurbineTextureHandler;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
public class GregtechMetaSpecialMultiCasings extends GregtechMetaCasingBlocksAbstract {
-
-
- public static class SpecialCasingItemBlock extends GregtechMetaCasingItems {
+
+ public static class SpecialCasingItemBlock extends GregtechMetaCasingItems {
public SpecialCasingItemBlock(Block par1) {
super(par1);
@@ -67,36 +70,43 @@ public class GregtechMetaSpecialMultiCasings extends GregtechMetaCasingBlocksAbs
GregtechItemList.Casing_Flotation_Cell.set(new ItemStack(this, 1, 9));
GregtechItemList.Casing_Reinforced_Engine_Casing.set(new ItemStack(this, 1, 10));
}
-
- public IIcon getIcon(int aSide, int aMeta) {
-
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide) {
+ return LargeTurbineTextureHandler.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, this);
+ }
+ @Override
+ public IIcon getIcon(final int aSide, final int aMeta) {
+ return getStaticIcon((byte) aSide, (byte) aMeta);
+ }
+
+ public static IIcon getStaticIcon(final byte aSide, final byte aMeta) {
switch (aMeta) {
+ case 0:
+ return TexturesGtBlock.Casing_Redox_1.getIcon();
+ case 1:
+ return Textures.BlockIcons.MACHINE_CASING_TURBINE.getIcon();
+ case 2:
+ return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon();
+ case 3:
+ return Textures.BlockIcons.MACHINE_CASING_CLEAN_STAINLESSSTEEL.getIcon();
+ case 4:
+ return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon();
+ case 5:
+ return TexturesGtBlock.Casing_Material_RedSteel.getIcon();
+ case 6:
+ return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon();
+ case 7:
+ return TexturesGtBlock.Casing_Material_Stellite.getIcon();
+ case 8:
+ return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon();
+ case 9:
+ return TexturesGtBlock.TEXTURE_CASING_FLOTATION.getIcon();
+ case 10:
+ return TexturesGtBlock.Casing_Material_Talonite.getIcon();
- case 0:
- return TexturesGtBlock.Casing_Redox_1.getIcon();
- case 1:
- return Textures.BlockIcons.MACHINE_CASING_TURBINE.getIcon();
- case 2:
- return Textures.BlockIcons.MACHINE_CASING_CLEAN_STAINLESSSTEEL.getIcon();
- case 3:
- return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon();
- case 4:
- return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon();
- case 5:
- return TexturesGtBlock.Casing_Material_RedSteel.getIcon();
- case 6:
- return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon();
- case 7:
- return TexturesGtBlock.Casing_Material_Stellite.getIcon();
- case 8:
- return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon();
- case 9:
- return TexturesGtBlock.TEXTURE_CASING_FLOTATION.getIcon();
- case 10:
- return TexturesGtBlock.Casing_Material_Talonite.getIcon();
-
}
-
return Textures.BlockIcons.RENDERING_ERROR.getIcon();
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java
index c3d6a655c3..ec93c4379d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java
@@ -1,180 +1,237 @@
-/*
package gtPlusPlus.xmod.gregtech.common.blocks.textures.turbine;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.IBlockAccess;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS1;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS2;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS3;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS4;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS5;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS6;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS7;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS8;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS9;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE1;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE2;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE3;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE4;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE5;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE6;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE7;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE8;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE9;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST1;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST2;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST3;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST4;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST5;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST6;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST7;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST8;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST9;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE1;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE2;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE3;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE4;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE5;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE6;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE7;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE8;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE9;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI1;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI2;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI3;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI4;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI5;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI6;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI7;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI8;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI9;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE1;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE2;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE3;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE4;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE5;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE6;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE7;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE8;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE9;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU1;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU2;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU3;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU4;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU5;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU6;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU7;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU8;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU9;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE1;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE2;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE3;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE4;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE5;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE6;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE7;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE8;
+import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE9;
+import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Turbine;
-import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks4;
-import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon;
+import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaSpecialMultiCasings;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
public class LargeTurbineTextureHandler {
- */
-/**
+ /**
* LP Turbines
- *//*
-
- private static CustomIcon aTex1_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_1");
- private static CustomIcon aTex1 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_1");
- private static CustomIcon aTex2_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_2");
- private static CustomIcon aTex2 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_2");
- private static CustomIcon aTex3_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_3");
- private static CustomIcon aTex3 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_3");
- private static CustomIcon aTex4_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_4");
- private static CustomIcon aTex4 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_4");
- private static CustomIcon aTex5_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_5");
- private static CustomIcon aTex5 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_5");
- private static CustomIcon aTex6_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_6");
- private static CustomIcon aTex6 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_6");
- private static CustomIcon aTex7_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_7");
- private static CustomIcon aTex7 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_7");
- private static CustomIcon aTex8_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_8");
- private static CustomIcon aTex8 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_8");
- private static CustomIcon aTex9_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_9");
- private static CustomIcon aTex9 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_9");
-
- private static CustomIcon frontFace_0 = (aTex1);
- private static CustomIcon frontFaceActive_0 = (aTex1_Active);
- private static CustomIcon frontFace_1 = (aTex2);
- private static CustomIcon frontFaceActive_1 = (aTex2_Active);
- private static CustomIcon frontFace_2 = (aTex3);
- private static CustomIcon frontFaceActive_2 = (aTex3_Active);
- private static CustomIcon frontFace_3 = (aTex4);
- private static CustomIcon frontFaceActive_3 = (aTex4_Active);
- public static CustomIcon frontFace_4 = (aTex5);
- public static CustomIcon frontFaceActive_4 = (aTex5_Active);
- private static CustomIcon frontFace_5 = (aTex6);
- private static CustomIcon frontFaceActive_5 = (aTex6_Active);
- private static CustomIcon frontFace_6 = (aTex7);
- private static CustomIcon frontFaceActive_6 = (aTex7_Active);
- private static CustomIcon frontFace_7 = (aTex8);
- private static CustomIcon frontFaceActive_7 = (aTex8_Active);
- private static CustomIcon frontFace_8 = (aTex9);
- private static CustomIcon frontFaceActive_8 = (aTex9_Active);
+ */
- CustomIcon[] OVERLAY_LP_TURBINE = new CustomIcon[]{
- frontFace_0,
- frontFace_1,
- frontFace_2,
- frontFace_3,
- frontFace_4,
- frontFace_5,
- frontFace_6,
- frontFace_7,
- frontFace_8
+ public static BlockIcons[] OVERLAY_LP_TURBINE = new BlockIcons[]{
+ LARGETURBINE_ST1,
+ LARGETURBINE_ST2,
+ LARGETURBINE_ST3,
+ LARGETURBINE_ST4,
+ LARGETURBINE_ST5,
+ LARGETURBINE_ST6,
+ LARGETURBINE_ST7,
+ LARGETURBINE_ST8,
+ LARGETURBINE_ST9,
};
- CustomIcon[] OVERLAY_LP_TURBINE_ACTIVE = new CustomIcon[]{
- frontFaceActive_0,
- frontFaceActive_1,
- frontFaceActive_2,
- frontFaceActive_3,
- frontFaceActive_4,
- frontFaceActive_5,
- frontFaceActive_6,
- frontFaceActive_7,
- frontFaceActive_8
+ public static BlockIcons[] OVERLAY_LP_TURBINE_ACTIVE = new BlockIcons[]{
+ LARGETURBINE_ST_ACTIVE1,
+ LARGETURBINE_ST_ACTIVE2,
+ LARGETURBINE_ST_ACTIVE3,
+ LARGETURBINE_ST_ACTIVE4,
+ LARGETURBINE_ST_ACTIVE5,
+ LARGETURBINE_ST_ACTIVE6,
+ LARGETURBINE_ST_ACTIVE7,
+ LARGETURBINE_ST_ACTIVE8,
+ LARGETURBINE_ST_ACTIVE9,
};
-
- */
-/**
+ /**
* HP Turbines
- *//*
-
- private static CustomIcon aTexHP1_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_1");
- private static CustomIcon aTexHP1 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_1");
- private static CustomIcon aTexHP2_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_2");
- private static CustomIcon aTexHP2 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_2");
- private static CustomIcon aTexHP3_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_3");
- private static CustomIcon aTexHP3 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_3");
- private static CustomIcon aTexHP4_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_4");
- private static CustomIcon aTexHP4 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_4");
- private static CustomIcon aTexHP5_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_5");
- private static CustomIcon aTexHP5 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_5");
- private static CustomIcon aTexHP6_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_6");
- private static CustomIcon aTexHP6 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_6");
- private static CustomIcon aTexHP7_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_7");
- private static CustomIcon aTexHP7 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_7");
- private static CustomIcon aTexHP8_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_8");
- private static CustomIcon aTexHP8 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_8");
- private static CustomIcon aTexHP9_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_9");
- private static CustomIcon aTexHP9 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_9");
+ */
- private static CustomIcon frontFaceHP_0 = (aTexHP1);
- private static CustomIcon frontFaceHPActive_0 = (aTexHP1_Active);
- private static CustomIcon frontFaceHP_1 = (aTexHP2);
- private static CustomIcon frontFaceHPActive_1 = (aTexHP2_Active);
- private static CustomIcon frontFaceHP_2 = (aTexHP3);
- private static CustomIcon frontFaceHPActive_2 = (aTexHP3_Active);
- private static CustomIcon frontFaceHP_3 = (aTexHP4);
- private static CustomIcon frontFaceHPActive_3 = (aTexHP4_Active);
- public static CustomIcon frontFaceHP_4 = (aTexHP5);
- public static CustomIcon frontFaceHPActive_4 = (aTexHP5_Active);
- private static CustomIcon frontFaceHP_5 = (aTexHP6);
- private static CustomIcon frontFaceHPActive_5 = (aTexHP6_Active);
- private static CustomIcon frontFaceHP_6 = (aTexHP7);
- private static CustomIcon frontFaceHPActive_6 = (aTexHP7_Active);
- private static CustomIcon frontFaceHP_7 = (aTexHP8);
- private static CustomIcon frontFaceHPActive_7 = (aTexHP8_Active);
- private static CustomIcon frontFaceHP_8 = (aTexHP9);
- private static CustomIcon frontFaceHPActive_8 = (aTexHP9_Active);
-
- CustomIcon[] OVERLAY_HP_TURBINE = new CustomIcon[]{
- frontFaceHP_0,
- frontFaceHP_1,
- frontFaceHP_2,
- frontFaceHP_3,
- frontFaceHP_4,
- frontFaceHP_5,
- frontFaceHP_6,
- frontFaceHP_7,
- frontFaceHP_8
+ public static BlockIcons[] OVERLAY_HP_TURBINE = new BlockIcons[]{
+ LARGETURBINE_TI1,
+ LARGETURBINE_TI2,
+ LARGETURBINE_TI3,
+ LARGETURBINE_TI4,
+ LARGETURBINE_TI5,
+ LARGETURBINE_TI6,
+ LARGETURBINE_TI7,
+ LARGETURBINE_TI8,
+ LARGETURBINE_TI9,
};
- CustomIcon[] OVERLAY_HP_TURBINE_ACTIVE = new CustomIcon[]{
- frontFaceHPActive_0,
- frontFaceHPActive_1,
- frontFaceHPActive_2,
- frontFaceHPActive_3,
- frontFaceHPActive_4,
- frontFaceHPActive_5,
- frontFaceHPActive_6,
- frontFaceHPActive_7,
- frontFaceHPActive_8
+ public static BlockIcons[] OVERLAY_HP_TURBINE_ACTIVE = new BlockIcons[]{
+ LARGETURBINE_TI_ACTIVE1,
+ LARGETURBINE_TI_ACTIVE2,
+ LARGETURBINE_TI_ACTIVE3,
+ LARGETURBINE_TI_ACTIVE4,
+ LARGETURBINE_TI_ACTIVE5,
+ LARGETURBINE_TI_ACTIVE6,
+ LARGETURBINE_TI_ACTIVE7,
+ LARGETURBINE_TI_ACTIVE8,
+ LARGETURBINE_TI_ACTIVE9,
+ };
+
+ /**
+ * Gas Turbines
+ */
+
+ public static BlockIcons[] OVERLAY_GAS_TURBINE = new BlockIcons[]{
+ LARGETURBINE_SS1,
+ LARGETURBINE_SS2,
+ LARGETURBINE_SS3,
+ LARGETURBINE_SS4,
+ LARGETURBINE_SS5,
+ LARGETURBINE_SS6,
+ LARGETURBINE_SS7,
+ LARGETURBINE_SS8,
+ LARGETURBINE_SS9,
};
+ public static BlockIcons[] OVERLAY_GAS_TURBINE_ACTIVE = new BlockIcons[]{
+ LARGETURBINE_SS_ACTIVE1,
+ LARGETURBINE_SS_ACTIVE2,
+ LARGETURBINE_SS_ACTIVE3,
+ LARGETURBINE_SS_ACTIVE4,
+ LARGETURBINE_SS_ACTIVE5,
+ LARGETURBINE_SS_ACTIVE6,
+ LARGETURBINE_SS_ACTIVE7,
+ LARGETURBINE_SS_ACTIVE8,
+ LARGETURBINE_SS_ACTIVE9,
+ };
+
+ /**
+ * Plasma Turbines
+ */
+
+ public static BlockIcons[] OVERLAY_PLASMA_TURBINE = new BlockIcons[]{
+ LARGETURBINE_TU1,
+ LARGETURBINE_TU2,
+ LARGETURBINE_TU3,
+ LARGETURBINE_TU4,
+ LARGETURBINE_TU5,
+ LARGETURBINE_TU6,
+ LARGETURBINE_TU7,
+ LARGETURBINE_TU8,
+ LARGETURBINE_TU9,
+ };
+ public static BlockIcons[] OVERLAY_PLASMA_TURBINE_ACTIVE = new BlockIcons[]{
+ LARGETURBINE_TU_ACTIVE1,
+ LARGETURBINE_TU_ACTIVE2,
+ LARGETURBINE_TU_ACTIVE3,
+ LARGETURBINE_TU_ACTIVE4,
+ LARGETURBINE_TU_ACTIVE5,
+ LARGETURBINE_TU_ACTIVE6,
+ LARGETURBINE_TU_ACTIVE7,
+ LARGETURBINE_TU_ACTIVE8,
+ LARGETURBINE_TU_ACTIVE9,
+ };
- public IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide, final GregtechMetaCasingBlocks4 thisBlock) {
+ public static IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide, final GregtechMetaSpecialMultiCasings i) {
final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
- //7 - shaft
- //8 LP
- //9 HP
+ //0 shaft
+ //1 LP
+ //2 HP
+ //3 Gas
+ //4 Plasma
- CustomIcon[] mGetCurrentTextureSet = null, mGetCurrentTextureSet_ACTIVE = null;
+ BlockIcons[] mGetCurrentTextureSet = null;
+ BlockIcons[] mGetCurrentTextureSet_ACTIVE = null;
- if (tMeta <= 6 || tMeta >= 10) {
- return GregtechMetaCasingBlocks4.getStaticIcon((byte) aSide, (byte) tMeta);
+ if (tMeta <= 0 || tMeta >= 5) {
+ return GregtechMetaSpecialMultiCasings.getStaticIcon((byte) aSide, (byte) tMeta);
}
else {
- if (tMeta == 8) {
+ if (tMeta == 1) {
mGetCurrentTextureSet = OVERLAY_LP_TURBINE;
mGetCurrentTextureSet_ACTIVE = OVERLAY_LP_TURBINE_ACTIVE;
}
- else if (tMeta == 9) {
+ else if (tMeta == 2) {
mGetCurrentTextureSet = OVERLAY_HP_TURBINE;
mGetCurrentTextureSet_ACTIVE = OVERLAY_HP_TURBINE_ACTIVE;
}
+ else if (tMeta == 3) {
+ mGetCurrentTextureSet = OVERLAY_GAS_TURBINE;
+ mGetCurrentTextureSet_ACTIVE = OVERLAY_GAS_TURBINE_ACTIVE;
+ }
+ else if (tMeta == 4) {
+ mGetCurrentTextureSet = OVERLAY_PLASMA_TURBINE;
+ mGetCurrentTextureSet_ACTIVE = OVERLAY_PLASMA_TURBINE_ACTIVE;
+ }
if (mGetCurrentTextureSet == null || mGetCurrentTextureSet_ACTIVE == null) {
- return GregtechMetaCasingBlocks4.getStaticIcon((byte) aSide, (byte) tMeta);
+ return GregtechMetaSpecialMultiCasings.getStaticIcon((byte) aSide, (byte) tMeta);
}
@@ -283,28 +340,26 @@ public class LargeTurbineTextureHandler {
}
}
}
- return GregtechMetaCasingBlocks4.getStaticIcon((byte) aSide, (byte) tMeta);
+ return GregtechMetaSpecialMultiCasings.getStaticIcon((byte) aSide, (byte) tMeta);
}
- public boolean isUsingAnimatedTexture(TileEntity tTileEntity) {
+ public static boolean isUsingAnimatedTexture(TileEntity tTileEntity) {
boolean aVal = true;
- */
-/*IGregTechTileEntity aTile;
+ IGregTechTileEntity aTile;
if (tTileEntity instanceof IGregTechTileEntity) {
aTile = (IGregTechTileEntity) tTileEntity;
if (aTile != null) {
final IMetaTileEntity aMetaTileEntity = aTile.getMetaTileEntity();
if (aMetaTileEntity != null && aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine) {
aVal = ((GT_MetaTileEntity_Hatch_Turbine) aMetaTileEntity).isControllerActive();
- Logger.INFO("Returning "+aVal+" as Rotor Assembly controller status");
+ //Logger.INFO("Returning "+aVal+" as Rotor Assembly controller status");
}
}
- } *//*
-
+ }
return aVal;
}
- public GT_MetaTileEntity_Hatch_Turbine isTurbineHatch(final IGregTechTileEntity aTileEntity) {
+ public static GT_MetaTileEntity_Hatch_Turbine isTurbineHatch(final IGregTechTileEntity aTileEntity) {
if (aTileEntity != null) {
final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
if (aMetaTileEntity != null && aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine) {
@@ -315,4 +370,3 @@ public class LargeTurbineTextureHandler {
}
}
-*/
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java
index 03197c47ca..89e1e303a8 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java
@@ -100,34 +100,14 @@ public class GregtechMetaTileEntity_IndustrialForgeHammer extends GregtechMeta_M
{"C~C", "CAC", "CCC"},
{"CCC", "CCC", "CCC"},
}))
- .addElement(
- 'C',
- ofChain(
- ofHatchAdder(
- GregtechMetaTileEntity_IndustrialForgeHammer::addIndustrialForgeHammerList, TAE.getIndexFromPage(1, 11), 1
- ),
- onElementPass(
- x -> ++x.mCasing,
- ofBlock(
- ModBlocks.blockCasings5Misc, 6
- )
- )
- )
- )
- .addElement(
- 'A',
- ofChain(
- ofHatchAdder(
- GregtechMetaTileEntity_IndustrialForgeHammer::addIndustrialForgeHammerList, TAE.getIndexFromPage(1, 11), 1
- ),
- onElementPass(
- x -> ++x.mCasing,
- ofBlock(
- ModBlocks.blockCasings5Misc, 6
- )
+ .addElement('C', ofChain(
+ ofHatchAdder(GregtechMetaTileEntity_IndustrialForgeHammer::addIndustrialForgeHammerList, TAE.getIndexFromPage(1, 11), 1 ),
+ onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings5Misc, 6)
)
)
)
+
+ //.addElement('A', ofBlockAdder(GregtechMetaTileEntity_IndustrialForgeHammer::isBlockAnvil, Blocks.anvil, 1))
.build();
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java
index 8a936525f0..5ff8330372 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java
@@ -222,7 +222,7 @@ public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase
public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
super.onPreTick(aBaseMetaTileEntity, aTick);
// Fix GT bug
- if (this.getBaseMetaTileEntity().getFrontFacing() == 0 && this.getBaseMetaTileEntity().getBackFacing() == 1) {
+ if (this.getBaseMetaTileEntity().getFrontFacing() != 1) {
log("Fixing Bad Facing. (GT Bug)");
this.getBaseMetaTileEntity().setFrontFacing((byte) 1);
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java
new file mode 100644
index 0000000000..53b3f491cc
--- /dev/null
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java
@@ -0,0 +1,165 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines;
+
+import static gtPlusPlus.core.lib.CORE.RANDOM;
+
+import java.util.ArrayList;
+
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.fluids.FluidStack;
+
+@SuppressWarnings("deprecation")
+public class GT_MTE_LargeTurbine_Gas extends GregtechMetaTileEntity_LargerTurbineBase {
+
+ public GT_MTE_LargeTurbine_Gas(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+
+ public GT_MTE_LargeTurbine_Gas(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MTE_LargeTurbine_Gas(mName);
+ }
+
+ @Override
+ public int getCasingMeta() {
+ return 3;
+ }
+
+ @Override
+ public byte getCasingTextureIndex() {
+ return 58;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 15;
+ }
+
+ public int getFuelValue(FluidStack aLiquid) {
+ if (aLiquid == null) return 0;
+ GT_Recipe tFuel = GT_Recipe_Map.sTurbineFuels.findFuel(aLiquid);
+ if (tFuel != null) return tFuel.mSpecialValue;
+ return 0;
+ }
+
+ @Override
+ int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) {
+ if (aFluids.size() >= 1) {
+ int tEU = 0;
+ int actualOptimalFlow = 0;
+
+ FluidStack firstFuelType = new FluidStack(aFluids.get(0), 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest!
+ int fuelValue = getFuelValue(firstFuelType);
+
+ if (aOptFlow < fuelValue) {
+ // turbine too weak and/or fuel too powerful
+ // at least consume 1L
+ this.realOptFlow = 1;
+ // wastes the extra fuel and generate aOptFlow directly
+ depleteInput(new FluidStack(firstFuelType, 1));
+ this.storedFluid += 1;
+ return GT_Utility.safeInt((long) aOptFlow * (long) aBaseEff / 10000L);
+ }
+
+ actualOptimalFlow = GT_Utility.safeInt((long) aOptFlow / fuelValue);
+ this.realOptFlow = actualOptimalFlow;
+
+ int remainingFlow = GT_Utility.safeInt((long) (actualOptimalFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios.
+ int flow = 0;
+ int totalFlow = 0;
+
+ storedFluid = 0;
+ for (FluidStack aFluid : aFluids) {
+ if (aFluid.isFluidEqual(firstFuelType)) {
+ flow = Math.min(aFluid.amount, remainingFlow); // try to use up to 125% of optimal flow w/o exceeding remainingFlow
+ depleteInput(new FluidStack(aFluid, flow)); // deplete that amount
+ this.storedFluid += aFluid.amount;
+ remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches
+ totalFlow += flow; // track total input used
+ }
+ }
+ if (totalFlow <= 0) return 0;
+ tEU = GT_Utility.safeInt((long) totalFlow * fuelValue);
+
+ if (totalFlow == actualOptimalFlow) {
+ tEU = GT_Utility.safeInt((long) tEU * (long) aBaseEff / 10000L);
+ } else {
+ float efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow) / (float) actualOptimalFlow);
+ tEU *= efficiency;
+ tEU = GT_Utility.safeInt((long) tEU * (long) aBaseEff / 10000L);
+ }
+
+ return tEU;
+
+ }
+ return 0;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return (looseFit && RANDOM.nextInt(4)==0)?0:1;
+ }
+
+
+ @Override
+ public String[] getExtraInfoData() {
+ super.looseFit = looseFit;
+ return super.getInfoData();
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setBoolean("turbineFitting",looseFit);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ looseFit=aNBT.getBoolean("turbineFitting");
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Large Steam Turbine";
+ }
+
+ @Override
+ protected String getTurbineType() {
+ return "Steam";
+ }
+
+ @Override
+ protected String getCasingName() {
+ return "Reinforced Steam Turbine Casing";
+ }
+
+ @Override
+ protected ITexture getTextureFrontFace() {
+ return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST5);
+ }
+
+ @Override
+ protected ITexture getTextureFrontFaceActive() {
+ return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE5);
+ }
+
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java
new file mode 100644
index 0000000000..f815811ece
--- /dev/null
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java
@@ -0,0 +1,155 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines;
+
+import java.util.ArrayList;
+
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
+
+@SuppressWarnings("deprecation")
+public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTurbineBase {
+
+ public GT_MTE_LargeTurbine_Plasma(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+
+ public GT_MTE_LargeTurbine_Plasma(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MTE_LargeTurbine_Plasma(mName);
+ }
+
+ @Override
+ public int getCasingMeta() {
+ return 4;
+ }
+
+ @Override
+ public byte getCasingTextureIndex() {
+ return 60;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ public int getFuelValue(FluidStack aLiquid) {
+ if (aLiquid == null) return 0;
+ GT_Recipe tFuel = GT_Recipe_Map.sPlasmaFuels.findFuel(aLiquid);
+ if (tFuel != null) return tFuel.mSpecialValue;
+ return 0;
+ }
+
+ @Override
+ int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) {
+ if (aFluids.size() >= 1) {
+ aOptFlow *= 800;//CHANGED THINGS HERE, check recipe runs once per 20 ticks
+ int tEU = 0;
+
+ int actualOptimalFlow = 0;
+
+ FluidStack firstFuelType = new FluidStack(aFluids.get(0), 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest!
+ int fuelValue = getFuelValue(firstFuelType);
+ actualOptimalFlow = GT_Utility.safeInt((long) Math.ceil((double) aOptFlow / (double) fuelValue));
+ this.realOptFlow = actualOptimalFlow; // For scanner info
+
+ int remainingFlow = GT_Utility.safeInt((long) (actualOptimalFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios.
+ int flow = 0;
+ int totalFlow = 0;
+
+ storedFluid = 0;
+ for (FluidStack aFluid : aFluids) {
+ if (aFluid.isFluidEqual(firstFuelType)) {
+ flow = Math.min(aFluid.amount, remainingFlow); // try to use up w/o exceeding remainingFlow
+ depleteInput(new FluidStack(aFluid, flow)); // deplete that amount
+ this.storedFluid += aFluid.amount;
+ remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches
+ totalFlow += flow; // track total input used
+ }
+ }
+ String fn = FluidRegistry.getFluidName(firstFuelType);
+ String[] nameSegments = fn.split("\\.", 2);
+ if (nameSegments.length == 2) {
+ String outputName = nameSegments[1];
+ FluidStack output = FluidRegistry.getFluidStack(outputName, totalFlow);
+ if (output == null) {
+ output = FluidRegistry.getFluidStack("molten." + outputName, totalFlow);
+ }
+ if (output != null) {
+ addOutput(output);
+ }
+ }
+ if (totalFlow <= 0) return 0;
+ tEU = GT_Utility.safeInt((long) ((fuelValue / 20D) * (double) totalFlow));
+
+ //GT_FML_LOGGER.info(totalFlow+" : "+fuelValue+" : "+aOptFlow+" : "+actualOptimalFlow+" : "+tEU);
+
+ if (totalFlow == actualOptimalFlow) {
+ tEU = GT_Utility.safeInt((long) (aBaseEff / 10000D * tEU));
+ } else {
+ double efficiency = 1.0D - Math.abs((totalFlow - actualOptimalFlow) / (float) actualOptimalFlow);
+
+ tEU = (int) (tEU * efficiency);
+ tEU = GT_Utility.safeInt((long) (aBaseEff / 10000D * tEU));
+ }
+
+ return tEU;
+
+ }
+ return 0;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 1;
+ }
+
+ @Override
+ public String[] getExtraInfoData() {
+ return super.getInfoData();
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Large Steam Turbine";
+ }
+
+
+ @Override
+ protected String getTurbineType() {
+ return "Steam";
+ }
+
+ @Override
+ protected String getCasingName() {
+ return "Reinforced Steam Turbine Casing";
+ }
+
+ @Override
+ protected ITexture getTextureFrontFace() {
+ return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST5);
+ }
+
+ @Override
+ protected ITexture getTextureFrontFaceActive() {
+ return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE5);
+ }
+
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java
index f52f02b5de..d657c627d6 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java
@@ -1,23 +1,23 @@
-/*
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines;
import java.util.ArrayList;
import gregtech.GT_Mod;
+import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
-import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import net.minecraft.block.Block;
+import gtPlusPlus.xmod.gregtech.common.blocks.textures.turbine.LargeTurbineTextureHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.FluidStack;
+@SuppressWarnings("deprecation")
public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTurbineBase {
public boolean achievement = false;
@@ -31,36 +31,14 @@ public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTu
super(aName);
}
- public String[] getTooltip() {
- if (mCasingName.toLowerCase().contains(".name")) {
- mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 9);
- }
- return new String[]{
- "Controller Block for the XL High Pressure Steam Turbine",
- "Size(WxHxD): 3x3x4 (Hollow), Controller (Front centered)",
- "1x Superheated Steam Input Hatch (Side centered)",
- "1x Maintenance Hatch (Side centered)",
- "1x Dynamo Hatch (Back centered)",
- "1x Output Hatch for Steam (Side centered)",
- mCasingName+"s for the rest (24 at least!)",
- "Needs a Turbine Item (Inside controller GUI)",
- "Output depending on Rotor and fitting",
- "Use screwdriver to adjust fitting of turbine"};
- }
-
@Override
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MTE_LargeTurbine_SHSteam(mName);
}
@Override
- public Block getCasingBlock() {
- return ModBlocks.blockCasings4Misc;
- }
-
- @Override
- public byte getCasingMeta() {
- return 9;
+ public int getCasingMeta() {
+ return 2;
}
@Override
@@ -73,6 +51,11 @@ public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTu
return 0;
}
+ @Override
+ public int getFuelValue(FluidStack aLiquid) {
+ return 0;
+ }
+
@Override
int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) {
if(looseFit) {
@@ -161,11 +144,6 @@ public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTu
}
@Override
- public boolean hasSlotInGUI() {
- return true;
- }
-
- @Override
public String getCustomGUIResourceName() {
return null;
}
@@ -175,5 +153,24 @@ public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTu
return "Large Super-heated Steam Turbine";
}
+ @Override
+ protected String getTurbineType() {
+ return "Super-heated Steam";
+ }
+
+ @Override
+ protected String getCasingName() {
+ return "Reinforced HP Steam Turbine Casing";
+ }
+
+ @Override
+ protected ITexture getTextureFrontFace() {
+ return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI5);
+ }
+
+ @Override
+ protected ITexture getTextureFrontFaceActive() {
+ return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE5);
+ }
+
}
-*/
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java
index 2e6f6149e7..9929a583a8 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java
@@ -1,4 +1,3 @@
-/*
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines;
import static gtPlusPlus.core.lib.CORE.RANDOM;
@@ -6,19 +5,21 @@ import static gtPlusPlus.core.lib.CORE.RANDOM;
import java.util.ArrayList;
import gregtech.GT_Mod;
+import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import gtPlusPlus.core.block.ModBlocks;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.FluidStack;
+@SuppressWarnings("deprecation")
public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurbineBase {
private float water;
@@ -34,36 +35,14 @@ public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurb
super(aName);
}
- public String[] getTooltip() {
- if (mCasingName.toLowerCase().contains(".name")) {
- mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 8);
- }
- return new String[]{
- "Controller Block for the XL Steam Turbine",
- "Size(WxHxD): 3x3x4 (Hollow), Controller (Front centered)",
- "1x Steam Input Hatch (Side centered)",
- "1x Maintenance Hatch (Side centered)",
- "1x Dynamo Hatch (Back centered)",
- "1x Output Hatch for Distilled Water (Side centered)",
- mCasingName+"s for the rest (24 at least!)",
- "Needs a Turbine Item (Inside controller GUI)",
- "Output depending on Rotor and fitting",
- "Use screwdriver to adjust fitting of turbine"};
- }
-
@Override
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MTE_LargeTurbine_Steam(mName);
}
@Override
- public Block getCasingBlock() {
- return ModBlocks.blockCasings4Misc;
- }
-
- @Override
- public byte getCasingMeta() {
- return 8;
+ public int getCasingMeta() {
+ return 1;
}
@Override
@@ -82,6 +61,10 @@ public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurb
water = water - usage;
return usage;
}
+
+ public int getFuelValue(FluidStack aLiquid) {
+ return 0;
+ }
@Override
int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) {
@@ -170,12 +153,6 @@ public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurb
}
@Override
- public boolean hasSlotInGUI() {
- return true;
- }
-
-
- @Override
public String getCustomGUIResourceName() {
return null;
}
@@ -185,5 +162,24 @@ public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurb
return "Large Steam Turbine";
}
+ @Override
+ protected String getTurbineType() {
+ return "Steam";
+ }
+
+ @Override
+ protected String getCasingName() {
+ return "Reinforced Steam Turbine Casing";
+ }
+
+ @Override
+ protected ITexture getTextureFrontFace() {
+ return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST5);
+ }
+
+ @Override
+ protected ITexture getTextureFrontFaceActive() {
+ return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE5);
+ }
+
}
-*/
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java
index 9da724c6eb..02d7268c0c 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java
@@ -1,10 +1,15 @@
-/*
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
+
import java.util.ArrayList;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.TAE;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+
import gregtech.api.enums.Textures;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.ITexture;
@@ -13,33 +18,33 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler;
-import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
+import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Utility;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.minecraft.BlockPos;
import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
import gtPlusPlus.core.util.sys.KeyboardUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Turbine;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.StaticFields59;
-import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon;
-import gtPlusPlus.xmod.gregtech.common.blocks.textures.turbine.LargeTurbineTextureHandler;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import net.minecraftforge.fluids.FluidStack;
-public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechMeta_MultiBlockBase {
+public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_LargerTurbineBase> {
protected int baseEff = 0;
protected int optFlow = 0;
@@ -47,285 +52,275 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM
protected int storedFluid = 0;
protected int counter = 0;
protected boolean looseFit=false;
-
- private final int mCasingTextureID;
- public static String mCasingName;
- public ArrayList<GT_MetaTileEntity_Hatch_Turbine> mTurbineRotorHatches = new ArrayList<GT_MetaTileEntity_Hatch_Turbine>();
+ public ITexture frontFace;
+ public ITexture frontFaceActive;
+
+
+ public ArrayList<GT_MetaTileEntity_Hatch_Turbine> mTurbineRotorHatches = new ArrayList<GT_MetaTileEntity_Hatch_Turbine>();
public GregtechMetaTileEntity_LargerTurbineBase(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
- mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, getCasingMeta());
- mCasingTextureID = getTAE();
- GT9_5_Active = getCasingMeta() == 8 ? LargeTurbineTextureHandler.frontFaceActive_4 : LargeTurbineTextureHandler.frontFaceHPActive_4;
- GT9_5 = getCasingMeta() == 8 ? LargeTurbineTextureHandler.frontFace_4 : LargeTurbineTextureHandler.frontFaceHP_4;
- frontFaceActive = new GT_RenderedTexture(GT9_5_Active);
- frontFace = new GT_RenderedTexture(GT9_5);
-
+ frontFace = getTextureFrontFace();
+ frontFaceActive = getTextureFrontFaceActive();
+
}
public GregtechMetaTileEntity_LargerTurbineBase(String aName) {
super(aName);
- mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, getCasingMeta());
- mCasingTextureID = getTAE();
- GT9_5_Active = getCasingMeta() == 8 ? LargeTurbineTextureHandler.frontFaceActive_4 : LargeTurbineTextureHandler.frontFaceHPActive_4;
- GT9_5 = getCasingMeta() == 8 ? LargeTurbineTextureHandler.frontFace_4 : LargeTurbineTextureHandler.frontFaceHP_4;
- frontFaceActive = new GT_RenderedTexture(GT9_5_Active);
- frontFace = new GT_RenderedTexture(GT9_5);
- }
-
- public final int getTAE() {
- return TAE.getIndexFromPage(3, getCasingMeta());
+ frontFace = getTextureFrontFace();
+ frontFaceActive = getTextureFrontFaceActive();
}
+
- public final String getCasingNaming() {
- return ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, getCasingMeta());
- }
+ protected abstract ITexture getTextureFrontFace();
+
+ protected abstract ITexture getTextureFrontFaceActive();
+
+ protected abstract String getTurbineType();
+
+ protected abstract String getCasingName();
@Override
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return getMaxEfficiency(aStack) > 0;
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeTurbine.png");
+ protected final GT_Multiblock_Tooltip_Builder createTooltip() {
+ GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType(getMachineType())
+ .addInfo("Controller Block for the XL "+getTurbineType()+" Turbine")
+ .addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator()
+ .beginStructureBlock(3, 3, 9, false)
+ .addController("Top Middle")
+ .addCasingInfo(getCasingName(), 64)
+ .addOtherStructurePart("Rotor Assembly", "Any 1 dot hint", 1)
+ .addInputBus("Any 4 dot hint", 4)
+ .addInputHatch("Any 4 dot hint", 4)
+ .addOutputHatch("Any 4 dot hint", 4)
+ .addDynamoHatch("Any 4 dot hint", 4)
+ .addMaintenanceHatch("Any 4 dot hint", 4)
+ .addMufflerHatch("Any 7 dot hint x4", 7)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ return tt;
}
+
+ private static final String STRUCTURE_PIECE_MAIN = "main";
+ private static final ClassValue<IStructureDefinition<GregtechMetaTileEntity_LargerTurbineBase>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GregtechMetaTileEntity_LargerTurbineBase>>() {
+ @Override
+ protected IStructureDefinition<GregtechMetaTileEntity_LargerTurbineBase> computeValue(Class<?> type) {
+ return StructureDefinition.<GregtechMetaTileEntity_LargerTurbineBase>builder()
+ // c = turbine casing
+ // s = turbine shaft
+ // t = turbine housing
+ // h = dynamo/maint
+ // m = muffler
+ .addShape(STRUCTURE_PIECE_MAIN, (new String[][]{
+ {"ccchccc", "ccccccc", "ccmmmcc", "ccm~mcc", "ccmmmcc", "ccccccc", "ccchccc"},
+ {"ctchctc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "ctchctc"},
+ {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"},
+ {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"},
+ {"ctchctc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "ctchctc"},
+ {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"},
+ {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"},
+ {"ctchctc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "ctchctc"},
+ {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"},
+ }))
+ .addElement('c', lazy(t -> ofBlock(t.getCasingBlock(), t.getCasingMeta())))
+ .addElement('s', lazy(t -> ofBlock(t.getCasingBlock(), t.getTurbineShaftMeta())))
+ .addElement('t', lazy(t -> ofHatchAdder(GregtechMetaTileEntity_LargerTurbineBase::addTurbineHatch, t.getCasingTextureIndex(), 1)))
+ .addElement('h', lazy(t -> ofHatchAdderOptional(GregtechMetaTileEntity_LargerTurbineBase::addGenericHatch, t.getCasingTextureIndex(), 4, t.getCasingBlock(), t.getCasingMeta())))
+ .addElement('m', lazy(t -> ofHatchAdderOptional(GregtechMetaTileEntity_LargerTurbineBase::addMuffler, t.getCasingTextureIndex(), 7, t.getCasingBlock(), t.getCasingMeta())))
+ .build();
+ }
+ };
@Override
- public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- return checkMachine2(aBaseMetaTileEntity, aStack);
+ public IStructureDefinition<GregtechMetaTileEntity_LargerTurbineBase> getStructureDefinition() {
+ return STRUCTURE_DEFINITION.get(getClass());
}
- public boolean checkMachine2(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
- //9 high
- //7x7
-
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
this.mDynamoHatches.clear();
this.mTurbineRotorHatches.clear();
this.mMaintenanceHatches.clear();
this.mMufflerHatches.clear();
+ this.mInputBusses.clear();
this.mInputHatches.clear();
this.mOutputHatches.clear();
- for (int i=0;i>-9;i--) {
- if (!getLayer(i)) {
- Logger.INFO("Bad Layer: "+(+i));
- return false;
- }
- }
-
- Logger.INFO("Hatches | Found "+mTurbineRotorHatches.size()+" Rotor Assemblies, "+12+" are required.");
- Logger.INFO("Hatches | Found "+mMaintenanceHatches.size()+" Maint. hatches, "+1+" are required.");
- Logger.INFO("Hatches | Found "+mDynamoHatches.size()+" Dynamos, "+1+" or more are required.");
- Logger.INFO("Hatches | Found "+mMufflerHatches.size()+" Mufflers, "+4+" are required.");
- Logger.INFO("Hatches | Found "+mInputHatches.size()+" Input Hatches, "+1+" or more are required.");
- Logger.INFO("Hatches | Found "+mOutputHatches.size()+" Output Hatches, "+1+" ore more are required.");
-
+ boolean aStructure = checkPiece(STRUCTURE_PIECE_MAIN, 3, 3, 0);
+ log("Structure Check: "+aStructure);
if (mTurbineRotorHatches.size() != 12 ||
mMaintenanceHatches.size() != 1 ||
mDynamoHatches.size() < 1 ||
mMufflerHatches.size() != 4 ||
+ mInputBusses.size() < 1 ||
mInputHatches.size() < 1 ||
mOutputHatches.size() < 1
) {
+ log("Bad Hatches - Turbine Housings: "+mTurbineRotorHatches.size()+
+ ", Maint: "+mMaintenanceHatches.size()+
+ ", Dynamo: "+mDynamoHatches.size()+
+ ", Muffler: "+mMufflerHatches.size()+
+ ", Input Buses: "+mInputBusses.size()+
+ ", Input Hatches: "+mInputHatches.size()+
+ ", Output Hatches: "+mOutputHatches.size()+
+ ", ");
return false;
- }
- Logger.INFO("Built Structure");
- return true;
+ }
+ log("Built "+this.getLocalName());
+ return aStructure;
}
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+ buildPiece(STRUCTURE_PIECE_MAIN, stackSize, hintsOnly, 3, 3, 0);
+ }
- public boolean getLayer(int aY) {
- if (aY == 0 || aY == -2 || aY == -3 || aY == -5 || aY == -6 || aY == -8) {
- return checkNormalLayer(aY);
+ public boolean addTurbineHatch(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
}
- else {
- return checkTurbineLayer(aY);
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
}
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine) {
+ log("Found GT_MetaTileEntity_Hatch_Turbine");
+ updateTexture(aTileEntity, aBaseCasingIndex);
+ GT_MetaTileEntity_Hatch_Turbine aTurbineHatch = (GT_MetaTileEntity_Hatch_Turbine) aMetaTileEntity;
+ IGregTechTileEntity g = this.getBaseMetaTileEntity();
+ if (aTurbineHatch.setController(new BlockPos(g.getXCoord(), g.getYCoord(), g.getZCoord(), g.getWorld()))) {
+ Logger.INFO("Injected Controller into Turbine Assembly.");
+ return this.mTurbineRotorHatches.add(aTurbineHatch);
+ }
+ else {
+ Logger.INFO("Failed to inject controller into Turbine Assembly Hatch.");
+ }
+ }
+ log("Bad Turbine Housing");
+ return false;
}
- public boolean checkNormalLayer(int aY) {
- Block tBlock;
- int tMeta;
- for (int x = -3; x <= 3; x++) {
- for (int z = -3; z <= 3; z++) {
- tBlock = this.getBaseMetaTileEntity().getBlockOffset(x, aY, z);
- tMeta = this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, z);
- IGregTechTileEntity tTileEntity;
-
- if (aY == 0 && x == 0 && z == 0) {
- continue;
- }
- else if ((x == 0 && z == -3) || (x == 0 && z == 3) || (x == 3 && z == 0) || (x == -3 && z == 0) ||
- ((aY == 0) && (x == 0 && z == -2) || (x == 0 && z == 2) || (x == 2 && z == 0) || (x == -2 && z == 0))) {
- tTileEntity = this.getBaseMetaTileEntity().getIGregTechTileEntityOffset(x, aY, z);
- if (this.addToMachineList(tTileEntity, this.mCasingTextureID)) {
- Logger.INFO("Added Hatch at offset "+x+", "+aY+", "+z+" | Type: "+tTileEntity.getInventoryName());
- continue;
- }
- }
- else if (isValidCasingBlock(tBlock, tMeta)) {
- continue;
- } else {
- if (tBlock != null) {
- log("Offset: "+x+", "+aY+", "+z);
- log("Found "+tBlock.getLocalizedName()+" with Meta "+tMeta);
- log("Expected "+getCasingBlock().getLocalizedName()+" with Meta "+getCasingMeta());
- }
- return false;
- }
+ public final boolean addMuffler(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
}
}
- return true;
+ log("Bad Muffler");
+ return false;
}
-
- public boolean checkTurbineLayer(int aY) {
- if (!checkTurbineLayerX(aY)) {
- return checkTurbineLayerZ(aY);
- }
+ public final boolean addGenericHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ }
else {
- return true;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ }
+ else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ }
+ else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ }
+ else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ }
+ else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) {
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ }
}
+ log("Bad Hatch");
+ return false;
}
- public boolean checkTurbineLayerX(int aY) {
- Logger.INFO("checking X");
- Block tBlock;
- int tMeta;
- for (int x = -3; x <= 3; x++) {
- for (int z = -3; z <= 3; z++) {
- tBlock = this.getBaseMetaTileEntity().getBlockOffset(x, aY, z);
- tMeta = this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, z);
-
- if ((x == 0 && z == -3) || (x == 0 && z == 3) || (x == 3 && z == 0) || (x == -3 && z == 0) ||
- ((aY == 0) && (x == 0 && z == -2) || (x == 0 && z == 2) || (x == 2 && z == 0) || (x == -2 && z == 0))) {
- IGregTechTileEntity tTileEntity = this.getBaseMetaTileEntity().getIGregTechTileEntityOffset(x, aY, z);
- if (this.addToMachineList(tTileEntity, this.mCasingTextureID)) {
- Logger.INFO("Added Hatch at offset "+x+", "+aY+", "+z+" | Type: "+tTileEntity.getInventoryName());
- continue;
- }
- }
-
-
- if (x == -2 || x == 2) {
-
- //Find Hatches on the ends
- if (z == -3 || z == 3) {
- IGregTechTileEntity tTileEntity = this.getBaseMetaTileEntity().getIGregTechTileEntityOffset(x, aY, z);
- if (this.addTurbineHatch(tTileEntity, this.mCasingTextureID)) {
- log("Found x axis Turbine Assembly at Offset: "+x+", "+aY+", "+z);
- continue;
- }
- else {
- log("Missing x axis Turbine Assembly at Offset: "+x+", "+aY+", "+z);
- }
- }
-
- if (isValidTurbineBlock(tBlock, tMeta)) {
- continue;
- }
- else {
- return false;
- }
- }
- else {
- if (isValidCasingBlock(tBlock, tMeta)) {
- continue;
- }
- else {
- return false;
- }
- }
- }
- }
- return true;
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return getMaxEfficiency(aStack) > 0;
}
- public boolean checkTurbineLayerZ(int aY) {
- Logger.INFO("checking Z");
- Block tBlock;
- int tMeta;
- for (int x = -3; x <= 3; x++) {
- for (int z = -3; z <= 3; z++) {
- tBlock = this.getBaseMetaTileEntity().getBlockOffset(x, aY, z);
- tMeta = this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, z);
-
- if ((x == 0 && z == -3) || (x == 0 && z == 3) || (x == 3 && z == 0) || (x == -3 && z == 0) ||
- ((aY == 0) && (x == 0 && z == -2) || (x == 0 && z == 2) || (x == 2 && z == 0) || (x == -2 && z == 0))) {
- IGregTechTileEntity tTileEntity = this.getBaseMetaTileEntity().getIGregTechTileEntityOffset(x, aY, z);
- if (this.addToMachineList(tTileEntity, this.mCasingTextureID)) {
- Logger.INFO("Added Hatch at offset "+x+", "+aY+", "+z+" | Type: "+tTileEntity.getInventoryName());
- continue;
- }
- }
-
- if (z == -2 || z == 2) {
-
- //Find Hatches on the ends
- if (x == -3 || x == 3) {
- IGregTechTileEntity tTileEntity = this.getBaseMetaTileEntity().getIGregTechTileEntityOffset(x, aY, z);
- if (this.addTurbineHatch(tTileEntity, this.mCasingTextureID)) {
- log("Found z axis Turbine Assembly at Offset: "+x+", "+aY+", "+z);
- continue;
- }
- else {
- log("Missing z axis Turbine Assembly at Offset: "+x+", "+aY+", "+z);
- }
- }
-
- if (isValidTurbineBlock(tBlock, tMeta)) {
- continue;
- }
- else {
- return false;
- }
- }
- else {
- if (isValidCasingBlock(tBlock, tMeta)) {
- continue;
- }
- else {
- return false;
- }
- }
- }
- }
- return true;
- }
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeTurbine.png");
+ }
public boolean isValidCasingBlock(Block aBlock, int aMeta) {
- if (GregTech_API.sBlockMachines == aBlock) {
- return true;
- }
- if (Block.isEqualTo(aBlock, getCasingBlock()) && (int) aMeta == (int) getCasingMeta()) {
+ if (Block.isEqualTo(aBlock, getCasingBlock()) && aMeta == getCasingMeta()) {
return true;
- }
- log("Found "+(aBlock != null ? aBlock.getLocalizedName() : "Air") + " With Meta "+aMeta+", Expected "+getCasingBlock().getLocalizedName()+" With Meta "+getCasingMeta());
- return false;
+ }return false;
}
- public boolean isValidTurbineBlock(Block aBlock, int aMeta) {
- if (aBlock == getCasingBlock() && aMeta == getCasingMetaTurbine()) {
+ public boolean isValidTurbineShaft(Block aBlock, int aMeta) {
+ if (aBlock == getCasingBlock() && aMeta == getTurbineShaftMeta()) {
return true;
}
- log("Found "+(aBlock != null ? aBlock.getLocalizedName() : "Air") + " With Meta "+aMeta+", Expected "+getCasingBlock().getLocalizedName()+" With Meta "+getCasingMetaTurbine());
return false;
}
- public Block getCasingBlock() {
- return ModBlocks.blockCasings4Misc;
+ public final Block getCasingBlock() {
+ return ModBlocks.blockSpecialMultiCasings;
+ }
+
+ @Override
+ public final boolean hasSlotInGUI() {
+ return false;
}
- public abstract byte getCasingMeta();
+ public abstract int getCasingMeta();
- public byte getCasingMetaTurbine() {
- return 7;
+ public byte getTurbineShaftMeta() {
+ return 0;
}
public abstract byte getCasingTextureIndex();
+ public abstract int getFuelValue(FluidStack aLiquid);
+
+ public static boolean isValidTurbine(ItemStack aTurbine) {
+ return (aTurbine !=null && aTurbine.getItem() instanceof GT_MetaGenerated_Tool && aTurbine.getItemDamage() >= 170 && aTurbine.getItemDamage() <= 176);
+ }
+
+ private ArrayList<ItemStack> getAllBufferedTurbines(){
+ ArrayList<ItemStack> aTurbinesInStorage = new ArrayList<ItemStack>();
+ for (GT_MetaTileEntity_Hatch_InputBus aBus: this.mInputBusses) {
+ if (isValidMetaTileEntity(aBus)) {
+ for (ItemStack aContent : aBus.mInventory) {
+ if (isValidTurbine(aContent)) {
+ aTurbinesInStorage.add(aContent);
+ }
+ }
+ }
+ }
+ return aTurbinesInStorage;
+ }
+
@Override
public boolean checkRecipe(ItemStack aStack) {
+
+ ArrayList<GT_MetaTileEntity_Hatch_Turbine> aEmptyTurbineRotorHatches = new ArrayList<GT_MetaTileEntity_Hatch_Turbine>();
+ for (GT_MetaTileEntity_Hatch_Turbine aTurbineHatch : this.mTurbineRotorHatches) {
+ if (!aTurbineHatch.hasTurbine()) {
+ aEmptyTurbineRotorHatches.add(aTurbineHatch);
+ }
+ }
+ if (aEmptyTurbineRotorHatches.size() > 0) {
+ ArrayList<ItemStack> aTurbines = getAllBufferedTurbines();
+ for (GT_MetaTileEntity_Hatch_Turbine aHatch : aEmptyTurbineRotorHatches) {
+ for (ItemStack aTurbineItem : aTurbines) {
+ if (aHatch.insertTurbine(aTurbineItem) && this.depleteInput(aTurbineItem)) {
+ continue;
+ }
+ else {
+ break;
+ }
+ }
+ }
+ }
+
if((counter&7)==0 && (aStack==null || !(aStack.getItem() instanceof GT_MetaGenerated_Tool) || aStack.getItemDamage() < 170 || aStack.getItemDamage() >179)) {
stopMachine();
return false;
@@ -436,34 +431,25 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM
}
String[] ret = new String[]{
// 8 Lines available for information panels
- tRunning + ": " + EnumChatFormatting.RED+mEUt+EnumChatFormatting.RESET+" EU/t", */
-/* 1 *//*
-
- tMaintainance, */
-/* 2 *//*
-
- StatCollector.translateToLocal("GT5U.turbine.efficiency")+": "+EnumChatFormatting.YELLOW+(mEfficiency/100F)+EnumChatFormatting.RESET+"%", */
-/* 2 *//*
-
- StatCollector.translateToLocal("GT5U.multiblock.energy")+": " + EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ */
-/* 3 *//*
-
+ tRunning + ": " + EnumChatFormatting.RED+mEUt+EnumChatFormatting.RESET+" EU/t",
+ /* 1 */
+ tMaintainance,
+ /* 2 */
+ StatCollector.translateToLocal("GT5U.turbine.efficiency")+": "+EnumChatFormatting.YELLOW+(mEfficiency/100F)+EnumChatFormatting.RESET+"%",
+ /* 2 */
+ StatCollector.translateToLocal("GT5U.multiblock.energy")+": " + EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+
+ /* 3 */
EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU",
- StatCollector.translateToLocal("GT5U.turbine.flow")+": "+EnumChatFormatting.YELLOW+MathUtils.safeInt((long)realOptFlow)+EnumChatFormatting.RESET+" L/t" + */
-/* 4 *//*
-
- EnumChatFormatting.YELLOW+" ("+(looseFit?StatCollector.translateToLocal("GT5U.turbine.loose"):StatCollector.translateToLocal("GT5U.turbine.tight"))+")", */
-/* 5 *//*
-
- StatCollector.translateToLocal("GT5U.turbine.fuel")+": "+EnumChatFormatting.GOLD+storedFluid+EnumChatFormatting.RESET+"L", */
-/* 6 *//*
-
- StatCollector.translateToLocal("GT5U.turbine.dmg")+": "+EnumChatFormatting.RED+Integer.toString(tDura)+EnumChatFormatting.RESET+"%", */
-/* 7 *//*
-
- StatCollector.translateToLocal("GT5U.multiblock.pollution")+": "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %" */
-/* 8 *//*
-
+ StatCollector.translateToLocal("GT5U.turbine.flow")+": "+EnumChatFormatting.YELLOW+MathUtils.safeInt((long)realOptFlow)+EnumChatFormatting.RESET+" L/t" +
+ /* 4 */
+ EnumChatFormatting.YELLOW+" ("+(looseFit?StatCollector.translateToLocal("GT5U.turbine.loose"):StatCollector.translateToLocal("GT5U.turbine.tight"))+")",
+ /* 5 */
+ StatCollector.translateToLocal("GT5U.turbine.fuel")+": "+EnumChatFormatting.GOLD+storedFluid+EnumChatFormatting.RESET+"L",
+ /* 6 */
+ StatCollector.translateToLocal("GT5U.turbine.dmg")+": "+EnumChatFormatting.RED+Integer.toString(tDura)+EnumChatFormatting.RESET+"%",
+ /* 7 */
+ StatCollector.translateToLocal("GT5U.multiblock.pollution")+": "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %"
+ /* 8 */
};
if (!this.getClass().getName().contains("Steam"))
ret[4]=StatCollector.translateToLocal("GT5U.turbine.flow")+": "+EnumChatFormatting.YELLOW+MathUtils.safeInt((long)realOptFlow)+EnumChatFormatting.RESET+" L/t";
@@ -482,8 +468,8 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM
mPollution += aPollutionLevel;
for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
if (isValidMetaTileEntity(tHatch)) {
- if (mPollution >= 1000) {
- if (tHatch.polluteEnvironment()) {
+ if (mPollution >= 1000) {
+ if (PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 1000)) {
mPollution -= 1000;
}
} else {
@@ -505,84 +491,36 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM
//super.onModeChangeByScrewdriver(aSide, aPlayer, aX, aY, aZ);
}
else {
+ /*
this.mIsAnimated = Utils.invertBoolean(mIsAnimated);
if (this.mIsAnimated) {
- PlayerUtils.messagePlayer(aPlayer, "Using Animated Turbine Texture.");
+ PlayerUtils.messagePlayer(aPlayer, "Using Animated Turbine Texture.");
}
else {
- PlayerUtils.messagePlayer(aPlayer, "Using Static Turbine Texture.");
+ PlayerUtils.messagePlayer(aPlayer, "Using Static Turbine Texture.");
}
if (mTurbineRotorHatches.size() > 0) {
- for (GT_MetaTileEntity_Hatch_Turbine h : mTurbineRotorHatches) {
- if (h != null) {
- h.mUsingAnimation = mIsAnimated;
- }
+ for (GT_MetaTileEntity_Hatch_Turbine h : mTurbineRotorHatches) {
+ if (h != null) {
+ h.mUsingAnimation = mIsAnimated;
}
+ }
}
- }
+ */}
}
@Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setBoolean("mIsAnimated", mIsAnimated);
+ public final ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? getFrontFacingTurbineTexture(aActive) : Textures.BlockIcons.getCasingTextureForId(getCasingTextureIndex())};
}
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- mIsAnimated = aNBT.getBoolean("mIsAnimated");
- }
-
- private boolean mIsAnimated = true;
- public ITexture frontFace;
- public ITexture frontFaceActive;
- private CustomIcon GT9_5_Active;
- private CustomIcon GT9_5;
-
- public boolean usingAnimations() {
- return mIsAnimated;
- }
-
- @Override
- public final ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? getFrontFacingTurbineTexture(aActive) : Textures.BlockIcons.getCasingTextureForId(getTAE())};
- }
-
protected ITexture getFrontFacingTurbineTexture(boolean isActive) {
- if (usingAnimations()) {
- if (isActive) {
- return frontFaceActive;
- }
+ if (isActive) {
+ return frontFaceActive;
}
return frontFace;
}
-
- public boolean addTurbineHatch(final IGregTechTileEntity aTileEntity,
- final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine) {
- log("Found GT_MetaTileEntity_Hatch_Turbine");
- updateTexture(aTileEntity, aBaseCasingIndex);
- GT_MetaTileEntity_Hatch_Turbine aTurbineHatch = (GT_MetaTileEntity_Hatch_Turbine) aMetaTileEntity;
- IGregTechTileEntity g = this.getBaseMetaTileEntity();
- if (aTurbineHatch.setController(new BlockPos(g.getXCoord(), g.getYCoord(), g.getZCoord(), g.getWorld()))) {
- Logger.INFO("Injected Controller into Turbine Assembly.");
- return this.mTurbineRotorHatches.add(aTurbineHatch);
- }
- else {
- Logger.INFO("Failed to inject controller into Turbine Assembly Hatch.");
- }
- }
- return false;
- }
-
+
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
super.onPostTick(aBaseMetaTileEntity, aTick);
@@ -594,21 +532,19 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM
if (aTick % 20 == 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) {
enableAllTurbineHatches();
}
-
+
}
@Override
public void startProcess() {
super.startProcess();
enableAllTurbineHatches();
}
- @Override
- public void onMachineBlockUpdate() {
- super.onMachineBlockUpdate();
- }
+
@Override
public boolean onRunningTick(ItemStack aStack) {
return super.onRunningTick(aStack);
}
+
@Override
public void stopMachine() {
super.stopMachine();
@@ -630,7 +566,7 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM
public boolean disableAllTurbineHatches() {
return updateTurbineHatches(false) > 0;
}
-
+
private Long mLastHatchUpdate;
public int updateTurbineHatches(boolean aState) {
int aUpdated = 0;
@@ -648,7 +584,7 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM
mLastHatchUpdate = System.currentTimeMillis()/1000;
return aUpdated;
}
-
+
@Override
public int getMaxParallelRecipes() {
return 1;
@@ -659,5 +595,14 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM
return 0;
}
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ // Fix GT bug
+ if (this.getBaseMetaTileEntity().getFrontFacing() != 1) {
+ log("Fixing Bad Facing. (GT Bug)");
+ this.getBaseMetaTileEntity().setFrontFacing((byte) 1);
+ }
+ }
+
}
-*/
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLargeTurbinesAndHeatExchanger.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLargeTurbinesAndHeatExchanger.java
index 9b9f5fd59b..282ca1ffaa 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLargeTurbinesAndHeatExchanger.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLargeTurbinesAndHeatExchanger.java
@@ -2,21 +2,27 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Turbine;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines.GT_MTE_LargeTurbine_Gas;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines.GT_MTE_LargeTurbine_Plasma;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines.GT_MTE_LargeTurbine_SHSteam;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines.GT_MTE_LargeTurbine_Steam;
public class GregtechLargeTurbinesAndHeatExchanger {
public static void run() {
if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
Logger.INFO("Gregtech5u Content | Registering Larger Turbines & Extra Large Heat Exchanger.");
- run1();
+ run1();
}
}
private static void run1() {
- /* GregtechItemList.Large_Steam_Turbine.set(new GT_MTE_LargeTurbine_Steam(865, "multimachine.largerturbine", "XL Turbo Steam Turbine").getStackForm(1L));
- GregtechItemList.Large_HPSteam_Turbine.set(new GT_MTE_LargeTurbine_SHSteam(866, "multimachine.largerhpturbine", "XL Turbo HP Steam Turbine").getStackForm(1L));
- GregtechItemList.Hatch_Turbine_Rotor.set(new GT_MetaTileEntity_Hatch_Turbine(30010, "hatch.turbine", "Rotor Assembly", 8).getStackForm(1L));
- */
+ GregtechItemList.Large_Steam_Turbine.set(new GT_MTE_LargeTurbine_Steam(865, "multimachine.largerturbine", "XL Turbo Steam Turbine").getStackForm(1L));
+ GregtechItemList.Large_HPSteam_Turbine.set(new GT_MTE_LargeTurbine_SHSteam(866, "multimachine.largerhpturbine", "XL Turbo HP Steam Turbine").getStackForm(1L));
+ GregtechItemList.Large_Gas_Turbine.set(new GT_MTE_LargeTurbine_Gas(31073, "multimachine.largergasturbine", "XL Turbo Gas Turbine").getStackForm(1L));
+ GregtechItemList.Large_Plasma_Turbine.set(new GT_MTE_LargeTurbine_Plasma(31074, "multimachine.largerplasmaturbine", "XL Turbo Plasma Turbine").getStackForm(1L));
+ GregtechItemList.Hatch_Turbine_Rotor.set(new GT_MetaTileEntity_Hatch_Turbine(30010, "hatch.turbine", "Rotor Assembly", 8).getStackForm(1L));
}
} \ No newline at end of file