diff options
author | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-21 20:46:52 -0400 |
---|---|---|
committer | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-21 20:46:52 -0400 |
commit | 1185424fa7c692f9932623b965a99392d969e3c5 (patch) | |
tree | 39e19727dac27a4eff09a036fc27a1ee827d18a7 /src/main/java/gregtech/common/tileentities/machines | |
parent | 9d85f43d5642c7683ad2877c66c6fc70b5be8928 (diff) | |
download | GT5-Unofficial-1185424fa7c692f9932623b965a99392d969e3c5.tar.gz GT5-Unofficial-1185424fa7c692f9932623b965a99392d969e3c5.tar.bz2 GT5-Unofficial-1185424fa7c692f9932623b965a99392d969e3c5.zip |
Move source files
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/machines')
49 files changed, 7208 insertions, 0 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java new file mode 100644 index 0000000000..1ca02b7c02 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java @@ -0,0 +1,47 @@ +package gregtech.common.tileentities.machines;
+
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric;
+import gregtech.api.objects.GT_RenderedTexture;
+
+public class GT_MetaTileEntity_BasicHull_Bronze
+ extends GT_MetaTileEntity_BasicHull_NonElectric
+{
+ public GT_MetaTileEntity_BasicHull_Bronze(int aID, String aName, String aNameRegional, int aTier, String aDescription)
+ {
+ super(aID, aName, aNameRegional, aTier, aDescription);
+ }
+
+ public GT_MetaTileEntity_BasicHull_Bronze(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_BasicHull_Bronze(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public ITexture[][][] getTextureSet(ITexture[] aTextures)
+ {
+ ITexture[][][] rTextures = new ITexture[3][17][];
+ for (byte i = -1; i < 16; i = (byte)(i + 1))
+ {
+ rTextures[0][(i + 1)] = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZE_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
+ rTextures[1][(i + 1)] = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZE_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
+ rTextures[2][(i + 1)] = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZE_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
+ }
+ return rTextures;
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.GT_MetaTileEntity_BasicHull_Bronze
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java new file mode 100644 index 0000000000..bd7004ba91 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java @@ -0,0 +1,48 @@ +package gregtech.common.tileentities.machines;
+
+import gregtech.api.enums.*;
+import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric;
+import gregtech.api.objects.GT_RenderedTexture;
+
+public class GT_MetaTileEntity_BasicHull_BronzeBricks
+ extends GT_MetaTileEntity_BasicHull_NonElectric
+{
+ public GT_MetaTileEntity_BasicHull_BronzeBricks(int aID, String aName, String aNameRegional, int aTier, String aDescription)
+ {
+ super(aID, aName, aNameRegional, aTier, aDescription);
+ }
+
+ public GT_MetaTileEntity_BasicHull_BronzeBricks(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_BasicHull_BronzeBricks(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public ITexture[][][] getTextureSet(ITexture[] aTextures)
+ {
+ ITexture[][][] rTextures = new ITexture[3][17][];
+ for (byte i = -1; i < 16; i = (byte)(i + 1))
+ {ITexture[] tmp0 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
+ rTextures[0][(i + 1)] = tmp0;
+ ITexture[] tmp1 = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
+rTextures[1][(i + 1)] =tmp1;
+ ITexture[] tmp2 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
+rTextures[2][(i + 1)] = tmp2;
+ }
+ return rTextures;
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.GT_MetaTileEntity_BasicHull_BronzeBricks
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java new file mode 100644 index 0000000000..77f3033bfd --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java @@ -0,0 +1,49 @@ +package gregtech.common.tileentities.machines;
+
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric;
+import gregtech.api.objects.GT_RenderedTexture;
+
+public class GT_MetaTileEntity_BasicHull_Steel
+ extends GT_MetaTileEntity_BasicHull_NonElectric
+{
+ public GT_MetaTileEntity_BasicHull_Steel(int aID, String aName, String aNameRegional, int aTier, String aDescription)
+ {
+ super(aID, aName, aNameRegional, aTier, aDescription);
+ }
+
+ public GT_MetaTileEntity_BasicHull_Steel(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_BasicHull_Steel(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public ITexture[][][] getTextureSet(ITexture[] aTextures)
+ {
+ ITexture[][][] rTextures = new ITexture[3][17][];
+ for (byte i = -1; i < 16; i = (byte)(i + 1))
+ {ITexture[] tmp0 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
+ rTextures[0][(i + 1)] = tmp0;
+ ITexture[] tmp1 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
+rTextures[1][(i + 1)] = tmp1;
+ ITexture[] tmp2 = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
+rTextures[2][(i + 1)] =tmp2;
+ }
+ return rTextures;
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.GT_MetaTileEntity_BasicHull_Steel
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java new file mode 100644 index 0000000000..83bf759015 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java @@ -0,0 +1,49 @@ +package gregtech.common.tileentities.machines;
+
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric;
+import gregtech.api.objects.GT_RenderedTexture;
+
+public class GT_MetaTileEntity_BasicHull_SteelBricks
+ extends GT_MetaTileEntity_BasicHull_NonElectric
+{
+ public GT_MetaTileEntity_BasicHull_SteelBricks(int aID, String aName, String aNameRegional, int aTier, String aDescription)
+ {
+ super(aID, aName, aNameRegional, aTier, aDescription);
+ }
+
+ public GT_MetaTileEntity_BasicHull_SteelBricks(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_BasicHull_SteelBricks(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public ITexture[][][] getTextureSet(ITexture[] aTextures)
+ {
+ ITexture[][][] rTextures = new ITexture[3][17][];
+ for (byte i = -1; i < 16; i = (byte)(i + 1))
+ {ITexture[] tmp0 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
+ rTextures[0][(i + 1)] = tmp0;
+ ITexture[] tmp1 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
+rTextures[1][(i + 1)] = tmp1;
+ ITexture[] tmp2 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
+rTextures[2][(i + 1)] = tmp2;
+ }
+ return rTextures;
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.GT_MetaTileEntity_BasicHull_SteelBricks
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java new file mode 100644 index 0000000000..23b9d74fb7 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java @@ -0,0 +1,115 @@ +package gregtech.common.tileentities.machines.basic;
+
+import gregtech.api.enums.GT_Values;
+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.GT_MetaTileEntity_BasicMachine;
+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 gregtech.api.util.GT_Utility;
+import net.minecraft.item.ItemStack;
+import net.minecraft.item.crafting.CraftingManager;
+
+public class GT_MetaTileEntity_Boxinator
+ extends GT_MetaTileEntity_BasicMachine
+{
+ public GT_MetaTileEntity_Boxinator(int aID, String aName, String aNameRegional, int aTier)
+ {
+ super(aID, aName, aNameRegional, aTier, 1, "Puts things into Boxes", 2, 1, "Packager.png", "", new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_BOXINATOR) });
+ }
+
+ public GT_MetaTileEntity_Boxinator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName)
+ {
+ super(aName, aTier, 1, aDescription, aTextures, 2, 1, aGUIName, aNEIName);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_Boxinator(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeList()
+ {
+ return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes;
+ }
+
+ public int checkRecipe()
+ {
+ int tCheck = super.checkRecipe();
+ if (tCheck != 0) {
+ return tCheck;
+ }
+ if ((GT_Utility.isStackValid(getInputAt(0))) && (GT_Utility.isStackValid(getInputAt(1))) && (GT_Utility.getContainerItem(getInputAt(0), true) == null))
+ {
+ if ((ItemList.Schematic_1by1.isStackEqual(getInputAt(1))) && (getInputAt(0).stackSize >= 1))
+ {
+ this.mOutputItems[0] = GT_ModHandler.getRecipeOutput(new ItemStack[] { getInputAt(0) });
+ if (this.mOutputItems[0] != null) {
+ if (canOutput(new ItemStack[] { this.mOutputItems[0] }))
+ {
+ getInputAt(0).stackSize -= 1;
+ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ this.mMaxProgresstime = (16 / (1 << this.mTier - 1));
+ return 2;
+ }
+ }
+ return 0;
+ }
+ if ((ItemList.Schematic_2by2.isStackEqual(getInputAt(1))) && (getInputAt(0).stackSize >= 4))
+ {
+ this.mOutputItems[0] = GT_ModHandler.getRecipeOutput(new ItemStack[] { getInputAt(0), getInputAt(0), null, getInputAt(0), getInputAt(0) });
+ if (this.mOutputItems[0] != null) {
+ if (canOutput(new ItemStack[] { this.mOutputItems[0] }))
+ {
+ getInputAt(0).stackSize -= 4;
+ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ this.mMaxProgresstime = (32 / (1 << this.mTier - 1));
+ return 2;
+ }
+ }
+ return 0;
+ }
+ if ((ItemList.Schematic_3by3.isStackEqual(getInputAt(1))) && (getInputAt(0).stackSize >= 9))
+ {
+ this.mOutputItems[0] = GT_ModHandler.getRecipeOutput(new ItemStack[] { getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0) });
+ if (this.mOutputItems[0] != null) {
+ if (canOutput(new ItemStack[] { this.mOutputItems[0] }))
+ {
+ getInputAt(0).stackSize -= 9;
+ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ this.mMaxProgresstime = (64 / (1 << this.mTier - 1));
+ return 2;
+ }
+ }
+ return 0;
+ }
+ }
+ return 0;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
+ {
+ if (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack))
+ {
+ if ((ItemList.Schematic_1by1.isStackEqual(getInputAt(1))) || (ItemList.Schematic_2by2.isStackEqual(getInputAt(1))) || (ItemList.Schematic_3by3.isStackEqual(getInputAt(1)))) {
+ if(GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.findRecipe(getBaseMetaTileEntity(), true, gregtech.api.enums.GT_Values.V[this.mTier], null, new ItemStack[] { GT_Utility.copyAmount(64L, new Object[] { aStack }), getInputAt(1) }) != null){return true;}
+ if(ItemList.Schematic_1by1.isStackEqual(getInputAt(1))&>_ModHandler.getRecipeOutput(new ItemStack[] { aStack })!=null)return true;
+ if(ItemList.Schematic_2by2.isStackEqual(getInputAt(1))&>_ModHandler.getRecipeOutput(new ItemStack[] { aStack, aStack, null, aStack, aStack })!=null){return true;}
+ if(ItemList.Schematic_3by3.isStackEqual(getInputAt(1))&&(GT_ModHandler.getRecipeOutput(new ItemStack[] { aStack,aStack,aStack,aStack,aStack,aStack,aStack,aStack,aStack })!=null)){return true;}
+ }else{return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.containsInput(aStack);}
+ }
+ return false;
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_Boxinator
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java new file mode 100644 index 0000000000..1a5d8e1a6d --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java @@ -0,0 +1,71 @@ +package gregtech.common.tileentities.machines.basic;
+
+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_BasicMachine;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+
+public class GT_MetaTileEntity_Disassembler
+ extends GT_MetaTileEntity_BasicMachine
+{
+ public GT_MetaTileEntity_Disassembler(int aID, String aName, String aNameRegional, int aTier)
+ {
+ super(aID, aName, aNameRegional, aTier, 1, "Disassembles Machines at " + (50 + 10 * aTier) + "% Efficiency", 1, 9, "Disassembler.png", "", new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_DISASSEMBLER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_DISASSEMBLER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_DISASSEMBLER) });
+ }
+
+ public GT_MetaTileEntity_Disassembler(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName)
+ {
+ super(aName, aTier, 1, aDescription, aTextures, 1, 9, aGUIName, aNEIName);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_Disassembler(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ }
+
+ public int checkRecipe()
+ {
+ if ((getInputAt(0) != null) && (isOutputEmpty()))
+ {
+ NBTTagCompound tNBT = getInputAt(0).getTagCompound();
+ if (tNBT != null)
+ {
+ tNBT = tNBT.getCompoundTag("GT.CraftingComponents");
+ if (tNBT != null)
+ {
+ getInputAt(0).stackSize -= 1;
+ this.mEUt = (16 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ this.mMaxProgresstime = 80;
+ for (int i = 0; i < this.mOutputItems.length; i++) {
+ if (getBaseMetaTileEntity().getRandomNumber(100) < 50 + 10 * this.mTier)
+ {
+ this.mOutputItems[i] = GT_Utility.loadItem(tNBT, "Ingredient." + i);
+ if (this.mOutputItems[i] != null) {
+ this.mMaxProgresstime *= 1.7;
+ }
+ }
+ }
+ return 2;
+ }
+ }
+ }
+ return 0;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
+ {
+ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (aStack.getTagCompound() != null) && (aStack.getTagCompound().getCompoundTag("GT.CraftingComponents") != null);
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_Disassembler
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java new file mode 100644 index 0000000000..07337cd305 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java @@ -0,0 +1,83 @@ +package gregtech.common.tileentities.machines.basic;
+
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+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_BasicMachine;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Config;
+import net.minecraftforge.fluids.FluidStack;
+
+public class GT_MetaTileEntity_Massfabricator
+ extends GT_MetaTileEntity_BasicMachine
+{
+ public static int sUUAperUUM = 1;
+ public static int sUUASpeedBonus = 4;
+ public static int sDurationMultiplier = 3215;
+ public static boolean sRequiresUUA = false;
+
+ public GT_MetaTileEntity_Massfabricator(int aID, String aName, String aNameRegional, int aTier)
+ {
+ super(aID, aName, aNameRegional, aTier, 1, "UUM = Matter * Fabrication Squared", 1, 1, "Massfabricator.png", "", new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB) });
+ }
+
+ public GT_MetaTileEntity_Massfabricator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName)
+ {
+ super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_Massfabricator(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ }
+
+ public void onConfigLoad(GT_Config aConfig)
+ {
+ super.onConfigLoad(aConfig);
+ sDurationMultiplier = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUM_Duration_Multiplier", sDurationMultiplier);
+ sUUAperUUM = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_per_UUM", sUUAperUUM);
+ sUUASpeedBonus = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Speed_Bonus", sUUASpeedBonus);
+ sRequiresUUA = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Requirement", sRequiresUUA);
+ Materials.UUAmplifier.mChemicalFormula = ("Mass Fabricator Eff/Speed Bonus: x" + sUUASpeedBonus);
+ }
+
+ public int checkRecipe()
+ {
+ FluidStack tFluid = getDrainableStack();
+ if ((tFluid == null) || (tFluid.amount < getCapacity()))
+ {
+ this.mOutputFluid = Materials.UUMatter.getFluid(1L);
+ this.mEUt = ((int)gregtech.api.enums.GT_Values.V[this.mTier]);
+ this.mMaxProgresstime = (sDurationMultiplier / (1 << this.mTier - 1));
+ if (((tFluid = getFillableStack()) != null) && (tFluid.amount >= sUUAperUUM) && (tFluid.isFluidEqual(Materials.UUAmplifier.getFluid(1L))))
+ {
+ tFluid.amount -= sUUAperUUM;
+ this.mMaxProgresstime /= sUUASpeedBonus;
+ return 2;
+ }
+ return (sRequiresUUA) || (ItemList.Circuit_Integrated.isStackEqual(getInputAt(0), true, true)) ? 1 : 2;
+ }
+ return 0;
+ }
+
+ public boolean isFluidInputAllowed(FluidStack aFluid)
+ {
+ return aFluid.isFluidEqual(Materials.UUAmplifier.getFluid(1L));
+ }
+
+ public int getCapacity()
+ {
+ return Math.max(sUUAperUUM, 1000);
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_Massfabricator
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java new file mode 100644 index 0000000000..871835020d --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java @@ -0,0 +1,79 @@ +package gregtech.common.tileentities.machines.basic; + +import static gregtech.api.enums.GT_Values.V; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.living.LivingSpawnEvent; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_SpawnEventHandler; + +public class GT_MetaTileEntity_MonsterRepellent extends GT_MetaTileEntity_TieredMachineBlock { + + public int mRange = 16; + + public GT_MetaTileEntity_MonsterRepellent(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 0, "Reprells nasty Creatures. Range: "+(4 + (12*aTier))+" unpowered / "+(16 + (48*aTier))+" powered"); + } + + public GT_MetaTileEntity_MonsterRepellent(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aInvSlotCount, aDescription, aTextures); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_MonsterRepellent(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures); + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1], (aSide != 1) ? null : aActive ? new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE) : new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER) }; + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { + if (aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.isServerSide()) { + int[] tCoords = new int[]{aBaseMetaTileEntity.getXCoord(),aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord(),aBaseMetaTileEntity.getWorld().provider.dimensionId}; + if((aTimer%600 == 0)&&!GT_SpawnEventHandler.mobReps.contains(tCoords)){ + GT_SpawnEventHandler.mobReps.add(tCoords); + } + if(aBaseMetaTileEntity.isUniversalEnergyStored(getMinimumStoredEU()) && aBaseMetaTileEntity.decreaseStoredEnergyUnits(1 << (this.mTier*2), false)){ + mRange = 16 + (48*mTier); + }else{ + mRange = 4 + (12*mTier); + }} + } + + @Override + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + int[] tCoords = new int[]{aBaseMetaTileEntity.getXCoord(),aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord(),aBaseMetaTileEntity.getWorld().provider.dimensionId}; + GT_SpawnEventHandler.mobReps.add(tCoords); + } + + @Override + public void onRemoval() { + int[] tCoords = new int[]{this.getBaseMetaTileEntity().getXCoord(),this.getBaseMetaTileEntity().getYCoord(),this.getBaseMetaTileEntity().getZCoord(),this.getBaseMetaTileEntity().getWorld().provider.dimensionId}; + GT_SpawnEventHandler.mobReps.remove(tCoords); + } + @Override public boolean isSimpleMachine() {return false;} + @Override public boolean isFacingValid(byte aFacing) {return true;} + @Override public boolean isEnetInput() {return true;} + @Override public boolean isInputFacing(byte aSide) {return true;} + @Override public boolean isTeleporterCompatible() {return false;} + @Override public long getMinimumStoredEU() {return 512;} + @Override public long maxEUStore() {return 512+V[mTier]*50;} + @Override public long maxEUInput() {return V[mTier];} + @Override public long maxAmperesIn() {return 2;} + @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {return false;} + @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {return false;} + @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) {return null;} + @Override public void saveNBTData(NBTTagCompound aNBT) {} + @Override public void loadNBTData(NBTTagCompound aNBT) {} + } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java new file mode 100644 index 0000000000..5064b50cb5 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java @@ -0,0 +1,165 @@ +package gregtech.common.tileentities.machines.basic;
+
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+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_BasicMachine;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
+
+public class GT_MetaTileEntity_PotionBrewer
+ extends GT_MetaTileEntity_BasicMachine
+{
+ public GT_MetaTileEntity_PotionBrewer(int aID, String aName, String aNameRegional, int aTier)
+ {
+ super(aID, aName, aNameRegional, aTier, 1, "Brewing your Drinks", 1, 0, "PotionBrewer.png", "", new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_POTIONBREWER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_POTIONBREWER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_POTIONBREWER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_POTIONBREWER) });
+ }
+
+ public GT_MetaTileEntity_PotionBrewer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName)
+ {
+ super(aName, aTier, 1, aDescription, aTextures, 1, 0, aGUIName, aNEIName);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_PotionBrewer(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeList()
+ {
+ return GT_Recipe.GT_Recipe_Map.sBrewingRecipes;
+ }
+
+ public int checkRecipe()
+ {
+ int tCheck = super.checkRecipe();
+ if (tCheck != 0) {
+ return tCheck;
+ }
+ FluidStack aFluid = getFillableStack();
+ if ((getDrainableStack() == null) && (aFluid != null) && (getInputAt(0) != null))
+ {
+ String tInputName = aFluid.getFluid().getName();
+ if (tInputName.startsWith("potion."))
+ {
+ tInputName = tInputName.replaceFirst("potion.", "");
+ int tFirstDot = tInputName.indexOf('.') + 1;
+ String tModifier = tFirstDot <= 0 ? "" : tInputName.substring(tFirstDot);
+ if (!tModifier.isEmpty()) {
+ tInputName = tInputName.replaceFirst("." + tModifier, "");
+ }
+ if (GT_Utility.areStacksEqual(new ItemStack(Items.fermented_spider_eye, 1, 0), getInputAt(0)))
+ {
+ if (tInputName.equals("poison")) {
+ return setOutput("potion.damage" + tModifier);
+ }
+ if (tInputName.equals("health")) {
+ return setOutput("potion.damage" + tModifier);
+ }
+ if (tInputName.equals("waterbreathing")) {
+ return setOutput("potion.damage" + tModifier);
+ }
+ if (tInputName.equals("nightvision")) {
+ return setOutput("potion.invisibility" + tModifier);
+ }
+ if (tInputName.equals("fireresistance")) {
+ return setOutput("potion.slowness" + tModifier);
+ }
+ if (tInputName.equals("speed")) {
+ return setOutput("potion.slowness" + tModifier);
+ }
+ if (tInputName.equals("strength")) {
+ return setOutput("potion.weakness" + tModifier);
+ }
+ if (tInputName.equals("regen")) {
+ return setOutput("potion.poison" + tModifier);
+ }
+ return setOutput("potion.weakness");
+ }
+ if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glowstone, 1L), getInputAt(0)))
+ {
+ if (!tModifier.startsWith("strong")) {
+ return setOutput("potion." + tInputName + ".strong" + (tModifier.isEmpty() ? "" : new StringBuilder().append(".").append(tModifier).toString()));
+ }
+ if (tModifier.startsWith("long")) {
+ return setOutput("potion." + tInputName + tModifier.replaceFirst("long", ""));
+ }
+ return setOutput("potion.thick");
+ }
+ if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L), getInputAt(0)))
+ {
+ if (!tModifier.startsWith("long")) {
+ return setOutput("potion." + tInputName + ".long" + (tModifier.isEmpty() ? "" : new StringBuilder().append(".").append(tModifier).toString()));
+ }
+ if (tModifier.startsWith("strong")) {
+ return setOutput("potion." + tInputName + tModifier.replaceFirst("strong", ""));
+ }
+ return setOutput("potion.mundane");
+ }
+ if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Gunpowder, 1L), getInputAt(0)))
+ {
+ if (!tInputName.endsWith(".splash")) {
+ return setOutput("potion." + tInputName + ".splash");
+ }
+ return setOutput("potion.mundane");
+ }
+ }
+ }
+ return 0;
+ }
+
+ private final int setOutput(String aFluidName)
+ {
+ this.mOutputFluid = FluidRegistry.getFluidStack(aFluidName, 750);
+ if (this.mOutputFluid == null)
+ {
+ this.mOutputFluid = FluidRegistry.getFluidStack("potion.mundane", getFillableStack().amount);
+ getInputAt(0).stackSize -= 1;
+ getFillableStack().amount = 0;
+ this.mEUt = (4 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ this.mMaxProgresstime = (128 / (1 << this.mTier - 1));
+ return 2;
+ }
+ if (getFillableStack().amount < 750) {
+ return 0;
+ }
+ getInputAt(0).stackSize -= 1;
+ getFillableStack().amount -= 750;
+ this.mEUt = (4 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ this.mMaxProgresstime = (128 / (1 << this.mTier - 1));
+ return 2;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
+ {
+ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack));
+ }
+
+ public boolean isFluidInputAllowed(FluidStack aFluid)
+ {
+ return (aFluid.getFluid().getName().startsWith("potion.")) || (super.isFluidInputAllowed(aFluid));
+ }
+
+ public int getCapacity()
+ {
+ return 750;
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_PotionBrewer
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java new file mode 100644 index 0000000000..bf10c5143e --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java @@ -0,0 +1,71 @@ +package gregtech.common.tileentities.machines.basic;
+
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.api.util.GT_Utility;
+
+import java.util.ArrayList;
+
+import net.minecraft.item.ItemStack;
+
+public class GT_MetaTileEntity_Printer
+ extends GT_MetaTileEntity_BasicMachine
+{
+ public GT_MetaTileEntity_Printer(int aID, String aName, String aNameRegional, int aTier)
+ {
+ super(aID, aName, aNameRegional, aTier, 1, "It can copy Books and paint Stuff", 1, 1, "Printer.png", GT_Recipe.GT_Recipe_Map.sPrinterRecipes.mNEIName, new ITexture[0]);
+ }
+
+ public GT_MetaTileEntity_Printer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName)
+ {
+ super(aName, aTier, 1, aDescription, aTextures, 2, 2, aGUIName, aNEIName);
+ }
+
+ public int checkRecipe()
+ {
+ if (getOutputAt(0) != null)
+ {
+ this.mOutputBlocked += 1;
+ }
+ else if ((GT_Utility.isStackValid(getInputAt(0))) && (getInputAt(0).stackSize > 0) &&
+ (GT_Utility.isStackInvalid(getSpecialSlot())) &&
+ (OrePrefixes.block.contains(getInputAt(0))))
+ {
+ ArrayList<ItemStack> tList = GT_OreDictUnificator.getOres(GT_OreDictUnificator.getAssociation(getInputAt(0)));
+ if (tList.size() > 1)
+ {
+ tList.add(tList.get(0));
+ int i = 0;
+ for (int j = tList.size() - 1; i < j; i++) {
+ if (GT_Utility.areStacksEqual(getInputAt(0), (ItemStack)tList.get(i)))
+ {
+ this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[] { tList.get(i + 1) });
+ this.mEUt = (1 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ this.mMaxProgresstime = (32 / (1 << this.mTier - 1));
+ getInputAt(0).stackSize -= 1;
+ return 2;
+ }
+ }
+ }
+ }
+ this.mMaxProgresstime = 0;
+ return 0;
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return null;
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_Printer
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java new file mode 100644 index 0000000000..40020ef435 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java @@ -0,0 +1,380 @@ +package gregtech.common.tileentities.machines.basic; + +import static gregtech.api.enums.GT_Values.V; + +import java.util.ArrayList; +import java.util.Iterator; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.ChunkPosition; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidBlock; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_Container_BasicTank; +import gregtech.api.gui.GT_GUIContainer_BasicTank; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.BaseTileEntity; +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; +import gregtech.api.util.GT_Utility; + +public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { + + public ArrayList<ChunkPosition> mPumpList = new ArrayList(); + public int mPumpTimer = 0; + public int mPumpCountBelow = 0; + public Block mPumpedBlock1 = null; + public Block mPumpedBlock2 = null; + + public GT_MetaTileEntity_Pump(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 3, "The best way of emptying Oceans!"); + } + + public GT_MetaTileEntity_Pump(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 3, aDescription,aTextures); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Pump(this.mName, this.mTier, this.mDescription, this.mTextures); + } + + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setString("mPumpedBlock1", this.mPumpedBlock1 == null ? "" : this.mPumpedBlock1.getUnlocalizedName()); + aNBT.setString("mPumpedBlock2", this.mPumpedBlock2 == null ? "" : this.mPumpedBlock2.getUnlocalizedName()); + } + + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + this.mPumpedBlock1 = Block.getBlockFromName(aNBT.getString("mPumpedBlock1")); + this.mPumpedBlock2 = Block.getBlockFromName(aNBT.getString("mPumpedBlock2")); + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_BasicTank(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_BasicTank(aPlayerInventory, aBaseMetaTileEntity, getLocalName()); + } + @Override + public boolean doesFillContainers() { + return true; + } + @Override + public boolean doesEmptyContainers() { + return false; + } + @Override + public boolean canTankBeFilled() { + return false; + } + @Override + public boolean canTankBeEmptied() { + return true; + } + @Override + public boolean displaysItemStack() { + return true; + } + @Override + public boolean displaysStackSize() { + return false; + } + + @Override + public boolean isFluidInputAllowed(FluidStack aFluid) { + return false; + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + if (getBaseMetaTileEntity().isServerSide()) { + this.mPumpTimer -= 1; + if ((getBaseMetaTileEntity() instanceof BaseTileEntity)) { + ((BaseTileEntity) getBaseMetaTileEntity()).ignoreUnloadedChunks = false; + } + this.doTickProfilingInThisTick = true; + this.mPumpCountBelow = 0; + IGregTechTileEntity tTileEntity; + for (int i = 1; (i < 21) && ((tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance((byte) 0, i)) != null) + && (tTileEntity.getMetaTileEntity() != null) && ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Pump)); i++) { + getBaseMetaTileEntity().setActive(tTileEntity.isActive()); + this.mPumpCountBelow += 1; + ((GT_MetaTileEntity_Pump) tTileEntity.getMetaTileEntity()).mPumpTimer -= 1; + } + if (this.mPumpCountBelow <= 0) { + if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().isUniversalEnergyStored(16*((int)Math.pow(4, this.mTier)))) + && ((this.mFluid == null) || (this.mFluid.amount + 1000 <= getCapacity()))) { + boolean tMovedOneDown = false; + if ((this.mPumpList.isEmpty()) && (getBaseMetaTileEntity().getTimer() % 100L == 0L)) { + tMovedOneDown = moveOneDown(); + } + if ((GT_Utility.isBlockInvalid(this.mPumpedBlock1)) || (GT_Utility.isBlockInvalid(this.mPumpedBlock2))) { + getFluidAt(getBaseMetaTileEntity().getXCoord(), getYOfPumpHead() - 1, getBaseMetaTileEntity().getZCoord()); + if ((GT_Utility.isBlockInvalid(this.mPumpedBlock1)) || (GT_Utility.isBlockInvalid(this.mPumpedBlock2))) { + getFluidAt(getBaseMetaTileEntity().getXCoord(), getYOfPumpHead(), getBaseMetaTileEntity().getZCoord() + 1); + } + if ((GT_Utility.isBlockInvalid(this.mPumpedBlock1)) || (GT_Utility.isBlockInvalid(this.mPumpedBlock2))) { + getFluidAt(getBaseMetaTileEntity().getXCoord(), getYOfPumpHead(), getBaseMetaTileEntity().getZCoord() - 1); + } + if ((GT_Utility.isBlockInvalid(this.mPumpedBlock1)) || (GT_Utility.isBlockInvalid(this.mPumpedBlock2))) { + getFluidAt(getBaseMetaTileEntity().getXCoord() + 1, getYOfPumpHead(), getBaseMetaTileEntity().getZCoord()); + } + if ((GT_Utility.isBlockInvalid(this.mPumpedBlock1)) || (GT_Utility.isBlockInvalid(this.mPumpedBlock2))) { + getFluidAt(getBaseMetaTileEntity().getXCoord() - 1, getYOfPumpHead(), getBaseMetaTileEntity().getZCoord()); + } + } else if (getYOfPumpHead() < getBaseMetaTileEntity().getYCoord()) { + if ((tMovedOneDown) || ((this.mPumpList.isEmpty()) && (getBaseMetaTileEntity().getTimer() % 200L == 100L)) || (getBaseMetaTileEntity().getTimer() % 72000L == 100L)) { + this.mPumpList.clear(); + int y = getBaseMetaTileEntity().getYCoord() - 1; + for (int yHead = getYOfPumpHead(); (this.mPumpList.isEmpty()) && (y >= yHead); y--) { + scanForFluid(getBaseMetaTileEntity().getXCoord(), y, getBaseMetaTileEntity().getZCoord(), this.mPumpList, getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getZCoord(), 10*((int)Math.pow(1.6, this.mTier))); + } + } + if ((!tMovedOneDown) && (this.mPumpTimer <= 0)) { + while ((!this.mPumpList.isEmpty()) + && (!consumeFluid(((ChunkPosition) this.mPumpList.get(this.mPumpList.size() - 1)).chunkPosX, + ((ChunkPosition) this.mPumpList.get(this.mPumpList.size() - 1)).chunkPosY, + ((ChunkPosition) this.mPumpList.remove(this.mPumpList.size() - 1)).chunkPosZ))) { + } + this.mPumpTimer = 160/((int)Math.pow(2, this.mTier)); + } + } + } + getBaseMetaTileEntity().setActive(!this.mPumpList.isEmpty()); + } + } + } + + private boolean moveOneDown() { + if ((this.mInventory[0] == null) || (this.mInventory[0].stackSize < 1) + || (!GT_Utility.areStacksEqual(this.mInventory[0], GT_ModHandler.getIC2Item("miningPipe", 1L)))) { + return false; + } + int yHead = getYOfPumpHead(); + if (yHead <= 0) { + return false; + } + if ((!consumeFluid(getBaseMetaTileEntity().getXCoord(), yHead - 1, getBaseMetaTileEntity().getZCoord()))&& (!getBaseMetaTileEntity().getAir(getBaseMetaTileEntity().getXCoord(), yHead - 1, getBaseMetaTileEntity().getZCoord()))) { + + return false; + } + if (!(getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord(), yHead - 1, getBaseMetaTileEntity().getZCoord(),GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))))) { + return false; + } + if (yHead != getBaseMetaTileEntity().getYCoord()) { + getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord(), yHead, getBaseMetaTileEntity().getZCoord(),GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L))); + } + getBaseMetaTileEntity().decrStackSize(0, 1); + return true; + } + + private int getYOfPumpHead() { + int y = getBaseMetaTileEntity().getYCoord() - 1; + while (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord(), y, getBaseMetaTileEntity().getZCoord()) == GT_Utility + .getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L))) { + y--; + } + if (y == getBaseMetaTileEntity().getYCoord() - 1) { + if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord(), y, getBaseMetaTileEntity().getZCoord()) != GT_Utility + .getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))) { + return y + 1; + } + } else if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord(), y, getBaseMetaTileEntity().getZCoord()) != GT_Utility + .getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))&&this.mInventory[0] != null&&this.mInventory[0].stackSize>0&>_Utility.areStacksEqual(this.mInventory[0], GT_ModHandler.getIC2Item("miningPipe", 1L))) { + getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord(), y, getBaseMetaTileEntity().getZCoord(), + GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))); + getBaseMetaTileEntity().decrStackSize(0, 1); + + } + return y; + } + + private void scanForFluid(int aX, int aY, int aZ, ArrayList<ChunkPosition> aList, int mX, int mZ, int mDist) { + doTickProfilingInThisTick = false; + ArrayList tList1 = new ArrayList(); + ArrayList tList2 = new ArrayList(); + tList1.add(new ChunkPosition(aX, aY, aZ)); + while(!tList1.isEmpty()) + { + Iterator i$ = tList1.iterator(); + do + { + if(!i$.hasNext()) + break; + ChunkPosition tPos = (ChunkPosition)i$.next(); + if(tPos.chunkPosX < mX + mDist) + addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(tPos.chunkPosX + 1, tPos.chunkPosY, tPos.chunkPosZ, tList2, aList); + if(tPos.chunkPosX > mX - mDist) + addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(tPos.chunkPosX - 1, tPos.chunkPosY, tPos.chunkPosZ, tList2, aList); + if(tPos.chunkPosZ < mZ + mDist) + addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ + 1, tList2, aList); + if(tPos.chunkPosZ > mZ - mDist) + addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ - 1, tList2, aList); + addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(tPos.chunkPosX, tPos.chunkPosY + 1, tPos.chunkPosZ, tList2, aList); + ChunkPosition tCoordinate = new ChunkPosition(aX, aY + 1, aZ); + if(tPos.chunkPosX == mX && tPos.chunkPosZ == mZ && tPos.chunkPosY < getBaseMetaTileEntity().getYCoord() && !aList.contains(tCoordinate) && !tList2.contains(tCoordinate)) + tList2.add(tCoordinate); + } while(true); + aList.addAll(tList2); + tList1 = tList2; + tList2 = new ArrayList(); + } + for(int y = getBaseMetaTileEntity().getYCoord(); y >= aY; y--) + aList.remove(new ChunkPosition(aX, y, aZ)); + } + + private boolean addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(int aX, int aY, int aZ, ArrayList<ChunkPosition> aList1, + ArrayList<ChunkPosition> aList2) { + ChunkPosition tCoordinate = new ChunkPosition(aX, aY, aZ); + if ((!aList1.contains(tCoordinate)) && (!aList2.contains(tCoordinate))) { + Block aBlock = getBaseMetaTileEntity().getBlock(aX, aY, aZ); + if ((this.mPumpedBlock1 == aBlock) || (this.mPumpedBlock2 == aBlock)) { + aList1.add(tCoordinate); + return true; + } + } + return false; + } + + private void getFluidAt(int aX, int aY, int aZ) { + Block aBlock = getBaseMetaTileEntity().getBlock(aX, aY, aZ); + if (GT_Utility.isBlockValid(aBlock)) { + if ((aBlock == Blocks.water) || (aBlock == Blocks.flowing_water)) { + this.mPumpedBlock1 = Blocks.water; + this.mPumpedBlock2 = Blocks.flowing_water; + return; + } + if ((aBlock == Blocks.lava) || (aBlock == Blocks.flowing_lava)) { + this.mPumpedBlock1 = Blocks.lava; + this.mPumpedBlock2 = Blocks.flowing_lava; + return; + } + if ((aBlock instanceof IFluidBlock)) { + this.mPumpedBlock1 = aBlock; + this.mPumpedBlock2 = aBlock; + return; + } + } + this.mPumpedBlock1 = null; + this.mPumpedBlock2 = null; + } + + private boolean consumeFluid(int aX, int aY, int aZ) { + Block aBlock = getBaseMetaTileEntity().getBlock(aX, aY, aZ); + int aMeta = getBaseMetaTileEntity().getMetaID(aX, aY, aZ); + if ((GT_Utility.isBlockValid(aBlock)) && ((this.mPumpedBlock1 == aBlock) || (this.mPumpedBlock2 == aBlock))) { + if ((aBlock == Blocks.water) || (aBlock == Blocks.flowing_water)) { + if (aMeta == 0) { + if (this.mFluid == null) { + getBaseMetaTileEntity().decreaseStoredEnergyUnits(16*((int)Math.pow(4, this.mTier)), true); + this.mFluid = GT_ModHandler.getWater(1000L); + } else if (GT_ModHandler.isWater(this.mFluid)) { + getBaseMetaTileEntity().decreaseStoredEnergyUnits(16*((int)Math.pow(4, this.mTier)), true); + this.mFluid.amount += 1000; + } else { + return false; + } + } else { + getBaseMetaTileEntity().decreaseStoredEnergyUnits(4*((int)Math.pow(4, this.mTier)), true); + } + } + if ((aBlock == Blocks.lava) || (aBlock == Blocks.flowing_lava)) { + if (aMeta == 0) { + if (this.mFluid == null) { + getBaseMetaTileEntity().decreaseStoredEnergyUnits(16*((int)Math.pow(4, this.mTier)), true); + this.mFluid = GT_ModHandler.getLava(1000L); + } else if (GT_ModHandler.isLava(this.mFluid)) { + getBaseMetaTileEntity().decreaseStoredEnergyUnits(16*((int)Math.pow(4, this.mTier)), true); + this.mFluid.amount += 1000; + } else { + return false; + } + } else { + getBaseMetaTileEntity().decreaseStoredEnergyUnits(4*((int)Math.pow(4, this.mTier)), true); + } + } + if ((aBlock instanceof IFluidBlock)) { + if (this.mFluid == null) { + this.mFluid = ((IFluidBlock) aBlock).drain(getBaseMetaTileEntity().getWorld(), aX, aY, aZ, true); + getBaseMetaTileEntity().decreaseStoredEnergyUnits(this.mFluid == null ? 1000 : this.mFluid.amount, true); + }else if(this.mFluid.isFluidEqual(((IFluidBlock) aBlock).drain(getBaseMetaTileEntity().getWorld(), aX, aY, aZ, false))){ + this.getBaseMetaTileEntity().getWorld().setBlockToAir( aX, aY, aZ); + this.mFluid.amount += 1000; + getBaseMetaTileEntity().decreaseStoredEnergyUnits(16*((int)Math.pow(4, this.mTier)), true); + }else { + return false; + } + } + getBaseMetaTileEntity().getWorld().setBlock(aX, aY, aZ,Blocks.air,0,2); + return true; + } + return false; + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) return true; + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + + + @Override public boolean isSimpleMachine() {return false;} + @Override public boolean isOverclockerUpgradable() {return false;} + @Override public boolean isTransformerUpgradable() {return false;} + @Override public boolean isElectric() {return true;} + @Override public boolean isFacingValid(byte aFacing) {return true;} + @Override public boolean isEnetInput() {return true;} + @Override public boolean isInputFacing(byte aSide) {return true;} + @Override public boolean isOutputFacing(byte aSide) {return false;} + @Override public boolean isTeleporterCompatible() {return false;} + @Override public long getMinimumStoredEU() {return V[mTier]*16;} + @Override public long maxEUStore() {return V[mTier]*64;} + @Override public long maxEUInput() {return V[mTier];} + @Override public long maxSteamStore() {return maxEUStore();} + @Override public long maxAmperesIn() {return 2;} + @Override public int getStackDisplaySlot() {return 2;} + @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;} + + + @Override + public int getCapacity() { + return 16000*this.mTier; + } + @Override + public int getTankPressure() { + return 100; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1], (aSide == 0||aSide ==1) ? null : new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ADV_PUMP) }; + } + + @Override + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return getTexturesInactive(aBaseTexture); + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[] { + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ADV_PUMP),new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ADV_PUMP), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ADV_PUMP),new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ADV_PUMP),}; + } +} diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java new file mode 100644 index 0000000000..d81103fbc5 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java @@ -0,0 +1,125 @@ +package gregtech.common.tileentities.machines.basic;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Element;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+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_BasicMachine;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
+import gregtech.common.items.behaviors.Behaviour_DataOrb;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
+public class GT_MetaTileEntity_Replicator
+ extends GT_MetaTileEntity_BasicMachine
+{
+ private static int sHeaviestElementMass = 0;
+
+ public GT_MetaTileEntity_Replicator(int aID, String aName, String aNameRegional, int aTier)
+ {
+ super(aID, aName, aNameRegional, aTier, 1, "Producing Elemental Matter", 1, 1, "Replicator.png", "", new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_REPLICATOR) });
+ }
+
+ public GT_MetaTileEntity_Replicator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName)
+ {
+ super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_Replicator(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ }
+
+ public int checkRecipe()
+ {
+ FluidStack tFluid = getFillableStack();
+ if ((tFluid != null) && (tFluid.isFluidEqual(Materials.UUMatter.getFluid(1L))))
+ {
+ ItemStack tDataOrb = getSpecialSlot();
+ if ((ItemList.Tool_DataOrb.isStackEqual(tDataOrb, false, true)) && (Behaviour_DataOrb.getDataTitle(tDataOrb).equals("Elemental-Scan")))
+ {
+ Materials tMaterial = (Materials)Element.get(Behaviour_DataOrb.getDataName(tDataOrb)).mLinkedMaterials.get(0);
+ long tMass = tMaterial.getMass();
+ if ((tFluid.amount >= tMass) && (tMass > 0L))
+ {
+ this.mEUt = ((int)gregtech.api.enums.GT_Values.V[this.mTier]);
+ this.mMaxProgresstime = ((int)(tMass * 512L / (1 << this.mTier - 1)));
+ if ((this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.dust, tMaterial, 1L)) == null)
+ {
+ if ((this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.cell, tMaterial, 1L)) != null) {
+ if ((this.mOutputFluid = GT_Utility.getFluidForFilledItem(this.mOutputItems[0], true)) == null)
+ {
+ if (ItemList.Cell_Empty.isStackEqual(getInputAt(0))) {
+ if (canOutput(new ItemStack[] { this.mOutputItems[0] }))
+ {
+ getInputAt(0).stackSize -= 1; FluidStack
+ tmp231_230 = tFluid;tmp231_230.amount = ((int)(tmp231_230.amount - tMass));
+ return 2;
+ }
+ }
+ }
+ else
+ {
+ this.mOutputItems[0] = null;
+ if ((getDrainableStack() == null) || ((getDrainableStack().isFluidEqual(this.mOutputFluid)) && (getDrainableStack().amount < 16000)))
+ {
+ FluidStack tmp287_286 = tFluid;tmp287_286.amount = ((int)(tmp287_286.amount - tMass));
+ return 2;
+ }
+ }
+ }
+ }
+ else if (canOutput(new ItemStack[] { this.mOutputItems[0] }))
+ {
+ FluidStack tmp322_321 = tFluid;tmp322_321.amount = ((int)(tmp322_321.amount - tMass));
+ return 2;
+ }
+ }
+ }
+ }
+ return 0;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
+ {
+ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (ItemList.Cell_Empty.isStackEqual(aStack));
+ }
+
+ public boolean isFluidInputAllowed(FluidStack aFluid)
+ {
+ return aFluid.isFluidEqual(Materials.UUMatter.getFluid(1L));
+ }
+
+ public int getCapacity()
+ {
+ if ((sHeaviestElementMass == 0) && (GregTech_API.sPostloadFinished))
+ {
+ Materials tMaterial;
+ for (Iterator i$ = Materials.VALUES.iterator(); i$.hasNext(); sHeaviestElementMass = Math.max(sHeaviestElementMass, (int)tMaterial.getMass()))
+ {
+ tMaterial = (Materials)i$.next();
+ if ((tMaterial.mElement == null) || (tMaterial.mElement.mIsIsotope)) {}
+ }
+ }
+ return sHeaviestElementMass;
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_Replicator
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java new file mode 100644 index 0000000000..d65970dbac --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java @@ -0,0 +1,88 @@ +package gregtech.common.tileentities.machines.basic;
+
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+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_BasicMachine;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+
+public class GT_MetaTileEntity_RockBreaker
+ extends GT_MetaTileEntity_BasicMachine
+{
+ public GT_MetaTileEntity_RockBreaker(int aID, String aName, String aNameRegional, int aTier)
+ {
+ super(aID, aName, aNameRegional, aTier, 1, "Put Lava and Water adjacent", 1, 1, "RockBreaker.png", "", new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER) });
+ }
+
+ public GT_MetaTileEntity_RockBreaker(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName)
+ {
+ super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_RockBreaker(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeList()
+ {
+ return GT_Recipe.GT_Recipe_Map.sRockBreakerFakeRecipes;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
+ {
+ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack));
+ }
+
+ public int checkRecipe()
+ {
+ IGregTechTileEntity aBaseMetaTileEntity = getBaseMetaTileEntity();
+ if ((aBaseMetaTileEntity.getBlockOffset(0, 0, 1) == Blocks.water) || (aBaseMetaTileEntity.getBlockOffset(0, 0, -1) == Blocks.water) || (aBaseMetaTileEntity.getBlockOffset(-1, 0, 0) == Blocks.water) || (aBaseMetaTileEntity.getBlockOffset(1, 0, 0) == Blocks.water))
+ {
+ ItemStack tOutput = null;
+ if (aBaseMetaTileEntity.getBlockOffset(0, 1, 0) == Blocks.lava) {
+ tOutput = new ItemStack(Blocks.stone, 1);
+ } else if ((aBaseMetaTileEntity.getBlockOffset(0, 0, 1) == Blocks.lava) || (aBaseMetaTileEntity.getBlockOffset(0, 0, -1) == Blocks.lava) || (aBaseMetaTileEntity.getBlockOffset(-1, 0, 0) == Blocks.lava) || (aBaseMetaTileEntity.getBlockOffset(1, 0, 0) == Blocks.lava)) {
+ tOutput = new ItemStack(Blocks.cobblestone, 1);
+ }
+ if (tOutput != null) {
+ if (GT_Utility.areStacksEqual(getInputAt(0), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L)))
+ {
+ tOutput = new ItemStack(Blocks.obsidian, 1);
+ if (canOutput(new ItemStack[] { tOutput }))
+ {
+ getInputAt(0).stackSize -= 1;
+ this.mOutputItems[0] = tOutput;
+ this.mMaxProgresstime = (128 / (1 << this.mTier - 1));
+ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ return 2;
+ }
+ }
+ else if (canOutput(new ItemStack[] { tOutput }))
+ {
+ this.mOutputItems[0] = tOutput;
+ this.mMaxProgresstime = (16 / (1 << this.mTier - 1));
+ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ return 2;
+ }
+ }
+ }
+ return 0;
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_RockBreaker
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java new file mode 100644 index 0000000000..3360369114 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java @@ -0,0 +1,221 @@ +package gregtech.common.tileentities.machines.basic;
+
+import forestry.api.genetics.AlleleManager;
+import forestry.api.genetics.IAlleleRegistry;
+import forestry.api.genetics.IIndividual;
+import gregtech.GT_Mod;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Element;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+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_BasicMachine;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.objects.ItemData;
+import gregtech.api.objects.MaterialStack;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.api.util.GT_Utility;
+import gregtech.common.items.behaviors.Behaviour_DataOrb;
+
+import java.util.Map;
+
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.fluids.FluidStack;
+
+public class GT_MetaTileEntity_Scanner
+ extends GT_MetaTileEntity_BasicMachine
+{
+ public GT_MetaTileEntity_Scanner(int aID, String aName, String aNameRegional, int aTier)
+ {
+ super(aID, aName, aNameRegional, aTier, 1, "Scans Crops and other things.", 1, 1, "Scanner.png", "", new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_SCANNER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_SCANNER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_SCANNER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_SCANNER) });
+ }
+
+ public GT_MetaTileEntity_Scanner(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName)
+ {
+ super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_Scanner(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ }
+
+ public int checkRecipe()
+ {
+ ItemStack aStack = getInputAt(0);
+ if (getOutputAt(0) != null)
+ {
+ this.mOutputBlocked += 1;
+ }
+ else if ((GT_Utility.isStackValid(aStack)) && (aStack.stackSize > 0))
+ {
+ if ((getFillableStack() != null) && (getFillableStack().containsFluid(Materials.Honey.getFluid(100L)))) {
+ try
+ {
+ Object tIndividual = AlleleManager.alleleRegistry.getIndividual(aStack);
+ if (tIndividual != null)
+ {
+ if (((IIndividual)tIndividual).analyze())
+ {
+ getFillableStack().amount -= 100;
+ this.mOutputItems[0] = GT_Utility.copy(new Object[] { aStack });
+ aStack.stackSize = 0;
+ NBTTagCompound tNBT = new NBTTagCompound();
+ ((IIndividual)tIndividual).writeToNBT(tNBT);
+ this.mOutputItems[0].setTagCompound(tNBT);
+ this.mMaxProgresstime = (500 / (1 << this.mTier - 1));
+ this.mEUt = (2 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ return 2;
+ }
+ this.mOutputItems[0] = GT_Utility.copy(new Object[] { aStack });
+ aStack.stackSize = 0;
+ this.mMaxProgresstime = 1;
+ this.mEUt = 1;
+ return 2;
+ }
+ }
+ catch (Throwable e)
+ {
+ if (GT_Values.D1) {
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+ }
+ if (ItemList.IC2_Crop_Seeds.isStackEqual(aStack, true, true))
+ {
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ if (tNBT == null) {
+ tNBT = new NBTTagCompound();
+ }
+ if (tNBT.getByte("scan") < 4)
+ {
+ tNBT.setByte("scan", (byte)4);
+ this.mMaxProgresstime = (160 / (1 << this.mTier - 1));
+ this.mEUt = (8 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ }
+ else
+ {
+ this.mMaxProgresstime = 1;
+ this.mEUt = 1;
+ }
+ aStack.stackSize -= 1;
+ this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[] { aStack });
+ this.mOutputItems[0].setTagCompound(tNBT);
+ return 2;
+ }
+ if (ItemList.Tool_DataOrb.isStackEqual(getSpecialSlot(), false, true))
+ {
+ if (ItemList.Tool_DataOrb.isStackEqual(aStack, false, true))
+ {
+ aStack.stackSize -= 1;
+ this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[] { getSpecialSlot() });
+ this.mMaxProgresstime = (512 / (1 << this.mTier - 1));
+ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ return 2;
+ }
+ ItemData tData = GT_OreDictUnificator.getAssociation(aStack);
+ if ((tData != null) && ((tData.mPrefix == OrePrefixes.dust) || (tData.mPrefix == OrePrefixes.cell)) && (tData.mMaterial.mMaterial.mElement != null) && (!tData.mMaterial.mMaterial.mElement.mIsIsotope) && (tData.mMaterial.mMaterial != Materials.Magic) && (tData.mMaterial.mMaterial.getMass() > 0L))
+ {
+ getSpecialSlot().stackSize -= 1;
+ aStack.stackSize -= 1;
+
+ this.mOutputItems[0] = ItemList.Tool_DataOrb.get(1L, new Object[0]);
+ Behaviour_DataOrb.setDataTitle(this.mOutputItems[0], "Elemental-Scan");
+ Behaviour_DataOrb.setDataName(this.mOutputItems[0], tData.mMaterial.mMaterial.mElement.name());
+ this.mMaxProgresstime = ((int)(tData.mMaterial.mMaterial.getMass() * 8192L / (1 << this.mTier - 1)));
+ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ return 2;
+ }
+ }
+ if (ItemList.Tool_DataStick.isStackEqual(getSpecialSlot(), false, true))
+ {
+ if (ItemList.Tool_DataStick.isStackEqual(aStack, false, true))
+ {
+ aStack.stackSize -= 1;
+ this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[] { getSpecialSlot() });
+ this.mMaxProgresstime = (128 / (1 << this.mTier - 1));
+ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ return 2;
+ }
+ if (aStack.getItem() == Items.written_book)
+ {
+ getSpecialSlot().stackSize -= 1;
+ aStack.stackSize -= 1;
+
+ this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[] { getSpecialSlot() });
+ this.mOutputItems[0].setTagCompound(aStack.getTagCompound());
+ this.mMaxProgresstime = (128 / (1 << this.mTier - 1));
+ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ return 2;
+ }
+ if (aStack.getItem() == Items.filled_map)
+ {
+ getSpecialSlot().stackSize -= 1;
+ aStack.stackSize -= 1;
+
+ this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[] { getSpecialSlot() });
+ this.mOutputItems[0].setTagCompound(GT_Utility.getNBTContainingShort(new NBTTagCompound(), "map_id", (short)aStack.getItemDamage()));
+ this.mMaxProgresstime = (128 / (1 << this.mTier - 1));
+ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ return 2;
+ }
+ }
+ }
+ return 0;
+ }
+
+@Override
+public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (mProgresstime>=(mMaxProgresstime-1)) {try{
+ if(this.mOutputItems[0].getUnlocalizedName().equals("gt.metaitem.01.32707")){
+ GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "scanning");}}catch (Exception e){}
+ }
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+}
+
+
+ public GT_Recipe.GT_Recipe_Map getRecipeList()
+ {
+ return GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes;
+ }
+
+ public int getCapacity()
+ {
+ return 1000;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
+ {
+ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack));
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
+ {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(212)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess()
+ {
+ sendLoopStart((byte)1);
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_Scanner
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java new file mode 100644 index 0000000000..e0c6225a61 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java @@ -0,0 +1,340 @@ +package gregtech.common.tileentities.machines.basic; + +import static gregtech.api.enums.GT_Values.V; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityHanging; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.EntityDragonPart; +import net.minecraft.entity.effect.EntityWeatherEffect; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.entity.item.EntityEnderEye; +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityFireball; +import net.minecraft.entity.projectile.EntityFishHook; +import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_Container_MultiMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Config; +import gregtech.api.util.GT_Utility; +import gregtech.common.gui.GT_Container_Teleporter; +import gregtech.common.gui.GT_GUIContainer_FusionReactor; +import gregtech.common.gui.GT_GUIContainer_Teleporter; + +public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank{ + + public int mTargetX = 0; + public int mTargetY = 0; + public int mTargetZ = 0; + public int mTargetD = 0; + public boolean mDebug = false; + public boolean hasEgg = false; + public static boolean sInterDimensionalTeleportAllowed = true; + + public GT_MetaTileEntity_Teleporter(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 3, "Teleport long distances with this little device."); + } + + public GT_MetaTileEntity_Teleporter(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 3, aDescription, aTextures); + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) return true; + this.hasEgg = checkForEgg(); + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_Teleporter(aPlayerInventory, aBaseMetaTileEntity); + } + + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_Teleporter(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Teleporter(this.mName, this.mTier, this.mDescription, this.mTextures); + } + + public String[] getInfoData() + { + return new String[] { "Coordinates:", "X: " + this.mTargetX, "Y: " + this.mTargetY, "Z: " + this.mTargetZ, "Dimension: " + this.mTargetD }; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1], (aSide !=this.getBaseMetaTileEntity().getFrontFacing()) ? null : aActive ? new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE) : new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER) }; + } + + + public void saveNBTData(NBTTagCompound aNBT) + { + aNBT.setInteger("mTargetX", this.mTargetX); + aNBT.setInteger("mTargetY", this.mTargetY); + aNBT.setInteger("mTargetZ", this.mTargetZ); + aNBT.setInteger("mTargetD", this.mTargetD); + aNBT.setBoolean("mDebug", this.mDebug); + } + + public void loadNBTData(NBTTagCompound aNBT) + { + this.mTargetX = aNBT.getInteger("mTargetX"); + this.mTargetY = aNBT.getInteger("mTargetY"); + this.mTargetZ = aNBT.getInteger("mTargetZ"); + this.mTargetD = aNBT.getInteger("mTargetD"); + this.mDebug = aNBT.getBoolean("mDebug"); + } + + public void onConfigLoad(GT_Config aConfig) + { + sInterDimensionalTeleportAllowed = aConfig.get(ConfigCategories.machineconfig, "Teleporter.Interdimensional", true); + } + + public void onFirstTick() + { + if (getBaseMetaTileEntity().isServerSide()) + { + if ((this.mTargetX == 0) && (this.mTargetY == 0) && (this.mTargetZ == 0) && (this.mTargetD == 0)) + { + this.mTargetX = getBaseMetaTileEntity().getXCoord(); + this.mTargetY = getBaseMetaTileEntity().getYCoord(); + this.mTargetZ = getBaseMetaTileEntity().getZCoord(); + this.mTargetD = getBaseMetaTileEntity().getWorld().provider.dimensionId; + } + this.hasEgg = checkForEgg(); + } + } + + public boolean checkForEgg() + { + for (byte i = -5; i <= 5; i = (byte)(i + 1)) { + for (byte j = -5; j <= 5; j = (byte)(j + 1)) { + for (byte k = -5; k <= 5; k = (byte)(k + 1)) { + if (getBaseMetaTileEntity().getBlockOffset(i, j, k) == Blocks.dragon_egg) { + return true; + } + } + } + } + return false; + } + + public boolean hasDimensionalTeleportCapability() + { + return (this.mDebug) || (this.hasEgg); + } + + public boolean isDimensionalTeleportAvailable() + { + return (this.mDebug) || ((hasDimensionalTeleportCapability()) && (GT_Utility.isRealDimension(this.mTargetD)) && (GT_Utility.isRealDimension(getBaseMetaTileEntity().getWorld().provider.dimensionId))); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + if (getBaseMetaTileEntity().isServerSide()) + { + if (getBaseMetaTileEntity().getTimer() % 100L == 50L) { + this.hasEgg = checkForEgg(); + } + if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().getRedstone())) + { + if(getBaseMetaTileEntity().decreaseStoredEnergyUnits(8192, false)){ + int tDistance = distanceCalculation(); + for (Object tObject : getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 2) + 2, getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 2) + 2, getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 2) + 2))) { + if (((tObject instanceof Entity)) && (!((Entity)tObject).isDead)) + { + Entity tEntity = (Entity)tObject; + if (getBaseMetaTileEntity().decreaseStoredEnergyUnits((int)(tDistance * tDistance * weightCalculation(tEntity)), false)) + { + if (tEntity.ridingEntity != null) { + tEntity.mountEntity(null); + } + if (tEntity.riddenByEntity != null) { + tEntity.riddenByEntity.mountEntity(null); + } + if ((this.mTargetD == getBaseMetaTileEntity().getWorld().provider.dimensionId) || (!isDimensionalTeleportAvailable()) || (!GT_Utility.moveEntityToDimensionAtCoords(tEntity, this.mTargetD, this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D))) { + if ((tEntity instanceof EntityLivingBase)) { + ((EntityLivingBase)tEntity).setPositionAndUpdate(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D); + } else { + tEntity.setPosition(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D); + } + } + } + } + }} + getBaseMetaTileEntity().setActive(true); + } + else + { + getBaseMetaTileEntity().setActive(false); + } + } + } + + private int distanceCalculation() + { + return Math.abs(((this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId) && (isDimensionalTeleportAvailable()) ? 100 : 1) * (int)Math.sqrt(Math.pow(getBaseMetaTileEntity().getXCoord() - this.mTargetX, 2.0D) + Math.pow(getBaseMetaTileEntity().getYCoord() - this.mTargetY, 2.0D) + Math.pow(getBaseMetaTileEntity().getZCoord() - this.mTargetZ, 2.0D))); + } + + private static float weightCalculation(Entity aEntity) + { + try + { + if ((aEntity instanceof EntityFX)) { + return -1.0F; + } + } + catch (Throwable e) {} + if ((aEntity instanceof EntityFishHook)) { + return -1.0F; + } + if ((aEntity instanceof EntityDragonPart)) { + return -1.0F; + } + if ((aEntity instanceof EntityWeatherEffect)) { + return -1.0F; + } + if ((aEntity instanceof EntityPlayer)) + { + EntityPlayer tPlayer = (EntityPlayer)aEntity; + int tCount = 64; + for (int i = 0; i < 36; i++) { + if (tPlayer.inventory.getStackInSlot(i) != null) { + tCount += (tPlayer.inventory.getStackInSlot(i).getMaxStackSize() > 1 ? tPlayer.inventory.getStackInSlot(i).stackSize : 64); + } + } + for (int i = 0; i < 4; i++) { + if (tPlayer.inventory.armorInventory[i] != null) { + tCount += 256; + } + } + return Math.min(5.0F, tCount / 666.6F); + } + if (GT_Utility.getClassName(aEntity).equals("EntityItnt")) { + return 5.0F; + } + if (GT_Utility.getClassName(aEntity).equals("EntityNuke")) { + return 50.0F; + } + if ((aEntity instanceof EntityArrow)) { + return 0.001F; + } + if ((aEntity instanceof EntityBoat)) { + return 0.1F; + } + if ((aEntity instanceof EntityEnderCrystal)) { + return 2.0F; + } + if ((aEntity instanceof EntityEnderEye)) { + return 0.001F; + } + if ((aEntity instanceof EntityFireball)) { + return 0.001F; + } + if ((aEntity instanceof EntityFireworkRocket)) { + return 0.001F; + } + if ((aEntity instanceof EntityHanging)) { + return 0.005F; + } + if ((aEntity instanceof EntityItem)) { + return 0.001F; + } + if ((aEntity instanceof EntityLiving)) { + return 0.5F; + } + if ((aEntity instanceof EntityMinecart)) { + return 0.1F; + } + if ((aEntity instanceof EntityThrowable)) { + return 0.001F; + } + if ((aEntity instanceof EntityTNTPrimed)) { + return 5.0F; + } + if ((aEntity instanceof EntityXPOrb)) { + return 0.001F; + } + return -1.0F; + } + + @Override public boolean isSimpleMachine() {return false;} + @Override public boolean isOverclockerUpgradable() {return false;} + @Override public boolean isTransformerUpgradable() {return false;} + @Override public boolean isElectric() {return true;} + @Override public boolean isFacingValid(byte aFacing) {return true;} + @Override public boolean isEnetInput() {return true;} + @Override public boolean isInputFacing(byte aSide) {return true;} + @Override public boolean isOutputFacing(byte aSide) {return false;} + @Override public boolean isTeleporterCompatible() {return false;} + @Override public long getMinimumStoredEU() {return V[mTier]*16;} + @Override public long maxEUStore() {return 100000000;} + @Override public long maxEUInput() {return V[mTier];} + @Override public long maxSteamStore() {return maxEUStore();} + @Override public long maxAmperesIn() {return 2;} + @Override public int getStackDisplaySlot() {return 2;} + @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;} + + @Override + public boolean doesFillContainers() { + return false; + } + + @Override + public boolean doesEmptyContainers() { + return false; + } + + @Override + public boolean canTankBeFilled() { + return true; + } + + @Override + public boolean canTankBeEmptied() { + return false; + } + + @Override + public boolean displaysItemStack() { + return false; + } + + @Override + public boolean displaysStackSize() { + return false; + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + return null; + } + +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java new file mode 100644 index 0000000000..9f244a546b --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java @@ -0,0 +1,408 @@ +package gregtech.common.tileentities.machines.multi;
+
+import gregtech.GT_Mod;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+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.objects.GT_ItemStack;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_CoverBehavior;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
+import gregtech.common.gui.GT_Container_BronzeBlastFurnace;
+import gregtech.common.gui.GT_GUIContainer_BronzeBlastFurnace;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+
+public class GT_MetaTileEntity_BronzeBlastFurnace
+ extends MetaTileEntity
+{
+ public int mMaxProgresstime = 0;
+ public int mUpdate = 5;
+ public int mProgresstime = 0;
+ public boolean mMachine = false;
+ private static final ITexture[] FACING_SIDE = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS) };
+ private static final ITexture[] FACING_FRONT = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE) };
+ private static final ITexture[] FACING_ACTIVE = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE) };
+ public ItemStack mOutputItem1;
+ public ItemStack mOutputItem2;
+
+ public GT_MetaTileEntity_BronzeBlastFurnace(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional, 4);
+ }
+
+ public GT_MetaTileEntity_BronzeBlastFurnace(String aName)
+ {
+ super(aName, 4);
+ }
+
+ public String[] getDescription()
+ {
+ return new String[] { "To get your first Steel", "Multiblock: 3x3x4 hollow with opening on top", "32 Bronze Plated Bricks required" };
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
+ {
+ if (aSide == aFacing) {
+ return aActive ? FACING_ACTIVE : FACING_FRONT;
+ }
+ return FACING_SIDE;
+ }
+
+ public boolean isSteampowered()
+ {
+ return false;
+ }
+
+ public boolean isElectric()
+ {
+ return false;
+ }
+
+ public boolean isPneumatic()
+ {
+ return false;
+ }
+
+ public boolean isEnetInput()
+ {
+ return false;
+ }
+
+ public boolean isEnetOutput()
+ {
+ return false;
+ }
+
+ public boolean isInputFacing(byte aSide)
+ {
+ return false;
+ }
+
+ public boolean isOutputFacing(byte aSide)
+ {
+ return false;
+ }
+
+ public boolean isTeleporterCompatible()
+ {
+ return false;
+ }
+
+ public boolean isFacingValid(byte aFacing)
+ {
+ return aFacing > 1;
+ }
+
+ public boolean isAccessAllowed(EntityPlayer aPlayer)
+ {
+ return true;
+ }
+
+ public int getProgresstime()
+ {
+ return this.mProgresstime;
+ }
+
+ public int maxProgresstime()
+ {
+ return this.mMaxProgresstime;
+ }
+
+ public int increaseProgress(int aProgress)
+ {
+ this.mProgresstime += aProgress;return this.mMaxProgresstime - this.mProgresstime;
+ }
+
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID)
+ {
+ return (GregTech_API.getCoverBehavior(aCoverID.toStack()).isSimpleCover()) && (super.allowCoverOnSide(aSide, aCoverID));
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_BronzeBlastFurnace(this.mName);
+ }
+
+ public void saveNBTData(NBTTagCompound aNBT)
+ {
+ aNBT.setInteger("mProgresstime", this.mProgresstime);
+ aNBT.setInteger("mMaxProgresstime", this.mMaxProgresstime);
+ if (this.mOutputItem1 != null)
+ {
+ NBTTagCompound tNBT = new NBTTagCompound();
+ this.mOutputItem1.writeToNBT(tNBT);
+ aNBT.setTag("mOutputItem1", tNBT);
+ }
+ if (this.mOutputItem2 != null)
+ {
+ NBTTagCompound tNBT = new NBTTagCompound();
+ this.mOutputItem2.writeToNBT(tNBT);
+ aNBT.setTag("mOutputItem2", tNBT);
+ }
+ }
+
+ public void loadNBTData(NBTTagCompound aNBT)
+ {
+ this.mUpdate = 5;
+ this.mProgresstime = aNBT.getInteger("mProgresstime");
+ this.mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
+ this.mOutputItem1 = GT_Utility.loadItem(aNBT, "mOutputItem1");
+ this.mOutputItem2 = GT_Utility.loadItem(aNBT, "mOutputItem2");
+ }
+
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer)
+ {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new GT_Container_BronzeBlastFurnace(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new GT_GUIContainer_BronzeBlastFurnace(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ private boolean checkMachine()
+ {
+ int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 3; j++) {
+ for (int k = -1; k < 2; k++) {
+ if ((xDir + i != 0) || (j != 0) || (zDir + k != 0)) {
+ if ((i != 0) || (j == -1) || (k != 0))
+ {
+ if ((getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k) != GregTech_API.sBlockCasings1) || (getBaseMetaTileEntity().getMetaIDOffset(xDir + i, j, zDir + k) != 10)) {
+ return false;
+ }
+ }
+ else if ((!GT_Utility.arrayContains(getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k), new Object[] { Blocks.lava, Blocks.flowing_lava, null })) && (!getBaseMetaTileEntity().getAirOffset(xDir + i, j, zDir + k))) {
+ return false;
+ }
+ }
+ }
+ }
+ }
+ return true;
+ }
+
+ public void onMachineBlockUpdate()
+ {
+ this.mUpdate = 5;
+ }
+
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer)
+ {
+ if ((aBaseMetaTileEntity.isClientSide()) &&
+ (aBaseMetaTileEntity.isActive())) {
+ aBaseMetaTileEntity.getWorld().spawnParticle("largesmoke", aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1) + Math.random(), aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1) + Math.random(), 0.0D, 0.3D, 0.0D);
+ }
+ if (aBaseMetaTileEntity.isServerSide())
+ {
+ if (this.mUpdate-- == 0) {
+ this.mMachine = checkMachine();
+ }
+ if (this.mMachine) {
+ if (this.mMaxProgresstime > 0)
+ {
+ if (++this.mProgresstime >= this.mMaxProgresstime)
+ {
+ addOutputProducts();
+ this.mOutputItem1 = null;
+ this.mOutputItem2 = null;
+ this.mProgresstime = 0;
+ this.mMaxProgresstime = 0;
+ try{GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "steel");}catch(Exception e){}
+ }
+ }
+ else if (aBaseMetaTileEntity.isAllowedToWork()) {
+ checkRecipe();
+ }
+ }
+ aBaseMetaTileEntity.setActive((this.mMaxProgresstime > 0) && (this.mMachine));
+ if (aBaseMetaTileEntity.isActive())
+ {
+ if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)))
+ {
+ aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.lava, 1, 2);
+ this.mUpdate = 1;
+ }
+ if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)))
+ {
+ aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.lava, 1, 2);
+ this.mUpdate = 1;
+ }
+ }
+ else
+ {
+ if (aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava)
+ {
+ aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.air, 0, 2);
+ this.mUpdate = 1;
+ }
+ if (aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava)
+ {
+ aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.air, 0, 2);
+ this.mUpdate = 1;
+ }
+ }
+ }
+ }
+
+ private void addOutputProducts()
+ {
+ if (this.mOutputItem1 != null) {
+ if (this.mInventory[2] == null) {
+ this.mInventory[2] = GT_Utility.copy(new Object[] { this.mOutputItem1 });
+ } else if (GT_Utility.areStacksEqual(this.mInventory[2], this.mOutputItem1)) {
+ this.mInventory[2].stackSize = Math.min(this.mOutputItem1.getMaxStackSize(), this.mOutputItem1.stackSize + this.mInventory[2].stackSize);
+ }
+ }
+ if (this.mOutputItem2 != null) {
+ if (this.mInventory[3] == null) {
+ this.mInventory[3] = GT_Utility.copy(new Object[] { this.mOutputItem2 });
+ } else if (GT_Utility.areStacksEqual(this.mInventory[3], this.mOutputItem2)) {
+ this.mInventory[3].stackSize = Math.min(this.mOutputItem2.getMaxStackSize(), this.mOutputItem2.stackSize + this.mInventory[3].stackSize);
+ }
+ }
+ }
+
+ private boolean spaceForOutput(ItemStack aStack1, ItemStack aStack2)
+ {
+ if (((this.mInventory[2] == null) || (aStack1 == null) || ((this.mInventory[2].stackSize + aStack1.stackSize <= this.mInventory[2].getMaxStackSize()) && (GT_Utility.areStacksEqual(this.mInventory[2], aStack1)))) && (
+ (this.mInventory[3] == null) || (aStack2 == null) || ((this.mInventory[3].stackSize + aStack2.stackSize <= this.mInventory[3].getMaxStackSize()) && (GT_Utility.areStacksEqual(this.mInventory[3], aStack2))))) {
+ return true;
+ }
+ return false;
+ }
+
+ private boolean checkRecipe()
+ {
+ if (!this.mMachine) {
+ return false;
+ }
+ if ((this.mInventory[0] != null) && (this.mInventory[1] != null) && (this.mInventory[0].stackSize >= 1)) {
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustIron")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "ingotIron")))
+ {
+ if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 4L))))
+ {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 4);
+ this.mMaxProgresstime = 7200;
+ return true;
+ }
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 4L))))
+ {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 2);
+ this.mMaxProgresstime = 4800;
+ return true;
+ }
+ if ((this.mInventory[0].stackSize >= 9) && ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L))))
+ {
+ getBaseMetaTileEntity().decrStackSize(0, 9);
+ getBaseMetaTileEntity().decrStackSize(1, 4);
+ this.mMaxProgresstime = 64800;
+ return true;
+ }
+ }
+ else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustSteel"))
+ {
+ if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 2L))))
+ {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 2);
+ this.mMaxProgresstime = 3600;
+ return true;
+ }
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 1) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 2L))))
+ {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 1);
+ this.mMaxProgresstime = 2400;
+ return true;
+ }
+ if ((this.mInventory[0].stackSize >= 9) && ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 2L))))
+ {
+ getBaseMetaTileEntity().decrStackSize(0, 9);
+ getBaseMetaTileEntity().decrStackSize(1, 2);
+ this.mMaxProgresstime = 32400;
+ return true;
+ }
+ }
+ else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "blockIron"))
+ {
+ if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 36) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L))))
+ {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 36);
+ this.mMaxProgresstime = 64800;
+ return true;
+ }
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 18) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Ash, 4L))))
+ {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 18);
+ this.mMaxProgresstime = 43200;
+ return true;
+ }
+ if (((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L))))
+ {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 4);
+ this.mMaxProgresstime = 64800;
+ return true;
+ }
+ }
+ }
+ this.mOutputItem1 = null;
+ this.mOutputItem2 = null;
+ return false;
+ }
+
+ public boolean isGivingInformation()
+ {
+ return false;
+ }
+
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
+ {
+ return aIndex > 1;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
+ {
+ if (aIndex < 2) {}
+ return !GT_Utility.areStacksEqual(aStack, this.mInventory[0]);
+ }
+
+ public byte getTileEntityBaseType()
+ {
+ return 0;
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_BronzeBlastFurnace
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java new file mode 100644 index 0000000000..632cdcbd6f --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java @@ -0,0 +1,192 @@ +package gregtech.common.tileentities.machines.multi; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.enums.Textures.BlockIcons; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +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 java.util.ArrayList; + +import scala.actors.threadpool.Arrays; +import net.minecraft.block.Block; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + +public class GT_MetaTileEntity_DistillationTower + extends GT_MetaTileEntity_MultiBlockBase +{ + public GT_MetaTileEntity_DistillationTower(int aID, String aName, String aNameRegional) + { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_DistillationTower(String aName) + { + super(aName); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) + { + return new GT_MetaTileEntity_DistillationTower(this.mName); + } + + public String[] getDescription() + { + return new String[] { "Controller Block for the Distillation Tower", "Size: 3x6x3 (Hollow)", "Controller (front bottom)", "1x Input Hatch (bottom)", "5x Output Hatch (one each height level besides botton)","1x Output Bus (Botton)", "1x Energy Hatch (anywhere)", "1x Maintenance Hatch (anywhere)", "Clean Stainless Steel Casings for the rest (26 at least!)" }; + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) + { + if (aSide == aFacing) { + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[49], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER) }; + } + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[49] }; + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) + { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png"); + } + + public GT_Recipe.GT_Recipe_Map getRecipeMap() + { + return GT_Recipe.GT_Recipe_Map.sDistillationRecipes; + } + + public boolean isCorrectMachinePart(ItemStack aStack) + { + return true; + } + + public boolean isFacingValid(byte aFacing) + { + return aFacing > 1; + } + + public boolean checkRecipe(ItemStack aStack) + { + + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte)Math.max(1, GT_Utility.getTier(tVoltage)); + if(this.mInputHatches.size()>0&&this.mInputHatches.get(0)!=null&&this.mInputHatches.get(0).mFluid!=null&&this.mInputHatches.get(0).mFluid.amount>0){ + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{this.mInputHatches.get(0).mFluid}, new ItemStack[] {}); + if (tRecipe != null) { + if (tRecipe.isRecipeInputEqual(true, new FluidStack[]{this.mInputHatches.get(0).mFluid}, new ItemStack[] {})) + { + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + if (tRecipe.mEUt <= 16) + { + this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1)); + } + else + { + this.mEUt = tRecipe.mEUt; + this.mMaxProgresstime = tRecipe.mDuration; + while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) + { + this.mEUt *= 4; + this.mMaxProgresstime /= 2; + } + } + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputItems = new ItemStack[] { tRecipe.getOutput(0) }; + this.mOutputFluids = tRecipe.mFluidOutputs; + updateSlots(); + return true; + } + }} + + return false; + } + private static boolean controller; + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) + { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) { + return false; + } + int tAmount = 0; + controller=false; + for (int i = -1; i < 2; i++) { + for (int j = -1; j < 2; j++) { + for (int h = 0; h < 6; h++) { + if (!(i==0&&j==0&&(h>0&&h<5)))//((h > 0)&&(h<5)) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0))) + { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j); + if ((!addMaintenanceToMachineList(tTileEntity, 49)) && (!addInputToMachineList(tTileEntity, 49)) && (!addOutputToMachineList(tTileEntity, 49)) && (!addEnergyInputToMachineList(tTileEntity, 49))&&(!ignoreController(aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j)))) + { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings4) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 1) { + return false; + } + tAmount++; + } + } + } + } + } + if(this.mInputHatches.size()!=1||this.mOutputBusses.size()!=1||this.mInputBusses.size()!=0||this.mOutputHatches.size()!=5){return false;} + int height = this.getBaseMetaTileEntity().getYCoord(); + if(this.mInputHatches.get(0).getBaseMetaTileEntity().getYCoord()!=height||this.mOutputBusses.get(0).getBaseMetaTileEntity().getYCoord()!=height){return false;} + GT_MetaTileEntity_Hatch_Output[] tmpHatches = new GT_MetaTileEntity_Hatch_Output[5]; + for(int i=0;i< this.mOutputHatches.size();i++){ + int hatchNumber = this.mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord()-1-height; + if(tmpHatches[hatchNumber]==null){ + tmpHatches[hatchNumber]=this.mOutputHatches.get(i); + }else{return false;} + } + this.mOutputHatches.clear(); + for(int i=0;i< tmpHatches.length;i++){ + this.mOutputHatches.add(tmpHatches[i]); + } + return tAmount >= 26; + } + + public boolean ignoreController(Block tTileEntity){ + if(!controller&&tTileEntity == GregTech_API.sBlockMachines){return true;} + return false; + } + + public int getMaxEfficiency(ItemStack aStack) + { + return 10000; + } + + public int getPollutionPerTick(ItemStack aStack) + { + return 0; + } + + public int getDamageToComponent(ItemStack aStack) + { + return 0; + } + + public int getAmountOfOutputs() + { + return 1; + } + + public boolean explodesOnComponentBreak(ItemStack aStack) + { + return false; + } +}
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java new file mode 100644 index 0000000000..5c6df03c1e --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java @@ -0,0 +1,249 @@ +package gregtech.common.tileentities.machines.multi;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.gui.GT_GUIContainer_MultiMachine;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+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 java.util.ArrayList;
+import java.util.Arrays;
+
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
+public class GT_MetaTileEntity_ElectricBlastFurnace
+ extends GT_MetaTileEntity_MultiBlockBase
+{
+ private int mHeatingCapacity = 0;
+
+ public GT_MetaTileEntity_ElectricBlastFurnace(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_ElectricBlastFurnace(String aName)
+ {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_ElectricBlastFurnace(this.mName);
+ }
+
+ public String[] getDescription()
+ {
+ return new String[] { "Controller Block for the Blast Furnace", "Size: 3x3x4 (Hollow)", "Controller (front middle at bottom)", "16x Heating Coils (two middle Layers, hollow)", "1x Input (one of bottom)", "1x Output (one of bottom)", "1x Energy Hatch (one of bottom)", "1x Maintenance Hatch (one of bottom)", "1x Muffler Hatch (top middle)", "Heat Proof Machine Casings for the rest" };
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
+ {
+ if (aSide == aFacing) {
+ return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[11], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE) };
+ }
+ return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[11] };
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ElectricBlastFurnace.png");
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap()
+ {
+ return GT_Recipe.GT_Recipe_Map.sBlastRecipes;
+ }
+
+ public boolean isCorrectMachinePart(ItemStack aStack)
+ {
+ return true;
+ }
+
+ public boolean isFacingValid(byte aFacing)
+ {
+ return aFacing > 1;
+ }
+
+ public boolean checkRecipe(ItemStack aStack)
+ {
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ for (int i = 0; i < tInputList.size() - 1; i++) {
+ for (int j = i + 1; j < tInputList.size(); j++) {
+ if (GT_Utility.areStacksEqual((ItemStack)tInputList.get(i), (ItemStack)tInputList.get(j))) {
+ if (((ItemStack)tInputList.get(i)).stackSize >= ((ItemStack)tInputList.get(j)).stackSize)
+ {
+ tInputList.remove(j--);
+ }
+ else
+ {
+ tInputList.remove(i--); break;
+ }
+ }
+ }
+ }
+ ItemStack[] tInputs = (ItemStack[])Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
+
+ ArrayList<FluidStack> tFluidList = getStoredFluids();
+ for (int i = 0; i < tFluidList.size() - 1; i++) {
+ for (int j = i + 1; j < tFluidList.size(); j++) {
+ if (GT_Utility.areFluidsEqual((FluidStack)tFluidList.get(i), (FluidStack)tFluidList.get(j))) {
+ if (((FluidStack)tFluidList.get(i)).amount >= ((FluidStack)tFluidList.get(j)).amount)
+ {
+ tFluidList.remove(j--);
+ }
+ else
+ {
+ tFluidList.remove(i--); break;
+ }
+ }
+ }
+ }
+ FluidStack[] tFluids = (FluidStack[])Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1);
+ if (tInputList.size() > 0)
+ {
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte)Math.max(1, GT_Utility.getTier(tVoltage));
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
+ if ((tRecipe != null) && (this.mHeatingCapacity >= tRecipe.mSpecialValue) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs)))
+ {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16)
+ {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
+ }
+ else
+ {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)])
+ {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputItems = new ItemStack[] { tRecipe.getOutput(0), tRecipe.getOutput(1) };
+ updateSlots();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack)
+ {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+
+ this.mHeatingCapacity = 0;
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) {
+ return false;
+ }
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 2, zDir)) {
+ return false;
+ }
+ addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 3, zDir), 11);
+
+ byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 2, zDir);
+ switch (tUsedMeta)
+ {
+ case 12:
+ this.mHeatingCapacity = 1800; break;
+ case 13:
+ this.mHeatingCapacity = 2700; break;
+ case 14:
+ this.mHeatingCapacity = 3600; break;
+ default:
+ return false;
+ }
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if ((i != 0) || (j != 0))
+ {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != tUsedMeta) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != tUsedMeta) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j) != 11) {
+ return false;
+ }
+ }
+ }
+ }
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if ((xDir + i != 0) || (zDir + j != 0))
+ {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, 11)) && (!addInputToMachineList(tTileEntity, 11)) && (!addOutputToMachineList(tTileEntity, 11)) && (!addEnergyInputToMachineList(tTileEntity, 11)))
+ {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 11) {
+ return false;
+ }
+ }
+ }
+ }
+ }
+ this.mHeatingCapacity += 100 * (GT_Utility.getTier(getMaxInputVoltage()) - 2);
+ return true;
+ }
+
+ public int getMaxEfficiency(ItemStack aStack)
+ {
+ return 10000;
+ }
+
+ public int getPollutionPerTick(ItemStack aStack)
+ {
+ return 10;
+ }
+
+ public int getDamageToComponent(ItemStack aStack)
+ {
+ return 0;
+ }
+
+ public int getAmountOfOutputs()
+ {
+ return 2;
+ }
+
+ public boolean explodesOnComponentBreak(ItemStack aStack)
+ {
+ return false;
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java new file mode 100644 index 0000000000..9a835e625f --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java @@ -0,0 +1,446 @@ +package gregtech.common.tileentities.machines.multi; + +import java.util.ArrayList; +import java.util.Arrays; + +import gregtech.GT_Mod; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Dyes; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_Container_MultiMachine; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.api.metatileentity.implementations.*; +import gregtech.common.gui.GT_GUIContainer_FusionReactor; +import net.minecraft.block.Block; +import net.minecraft.client.multiplayer.WorldClient; +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.server.MinecraftServer; +import net.minecraft.world.World; +import net.minecraft.world.WorldType; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + +public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity_MultiBlockBase { + + public GT_Recipe mLastRecipe; + public int mEUStore; + + public GT_MetaTileEntity_FusionComputer(int aID, String aName, String aNameRegional, int tier) { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_FusionComputer(String aName) { + super(aName); + } + + public abstract int tier(); + + public abstract long maxEUStore(); + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_FusionReactor(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "FusionComputer.png"); + } + + public abstract MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity); + + public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) { + + return aSide != getBaseMetaTileEntity().getFrontFacing(); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + int xCenter = getBaseMetaTileEntity().getXCoord() + ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()).offsetX * 5; + int yCenter = getBaseMetaTileEntity().getYCoord(); + int zCenter = getBaseMetaTileEntity().getZCoord() + ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()).offsetZ * 5; + if (((isAdvancedMachineCasing(xCenter + 5, yCenter, zCenter)) || (xCenter + 5 == getBaseMetaTileEntity().getXCoord())) + && ((isAdvancedMachineCasing(xCenter - 5, yCenter, zCenter)) || (xCenter - 5 == getBaseMetaTileEntity().getXCoord())) + && ((isAdvancedMachineCasing(xCenter, yCenter, zCenter + 5)) || (zCenter + 5 == getBaseMetaTileEntity().getZCoord())) + && ((isAdvancedMachineCasing(xCenter, yCenter, zCenter - 5)) || (zCenter - 5 == getBaseMetaTileEntity().getZCoord())) && (checkCoils(xCenter, yCenter, zCenter)) + && (checkHulls(xCenter, yCenter, zCenter)) && (checkUpperOrLowerHulls(xCenter, yCenter + 1, zCenter)) && (checkUpperOrLowerHulls(xCenter, yCenter - 1, zCenter)) + && (addIfEnergyInjector(xCenter + 4, yCenter, zCenter + 3, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter + 4, yCenter, zCenter - 3, aBaseMetaTileEntity)) + && (addIfEnergyInjector(xCenter + 4, yCenter, zCenter + 5, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter + 4, yCenter, zCenter - 5, aBaseMetaTileEntity)) + && (addIfEnergyInjector(xCenter - 4, yCenter, zCenter + 3, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter - 4, yCenter, zCenter - 3, aBaseMetaTileEntity)) + && (addIfEnergyInjector(xCenter - 4, yCenter, zCenter + 5, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter - 4, yCenter, zCenter - 5, aBaseMetaTileEntity)) + && (addIfEnergyInjector(xCenter + 3, yCenter, zCenter + 4, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter - 3, yCenter, zCenter + 4, aBaseMetaTileEntity)) + && (addIfEnergyInjector(xCenter + 5, yCenter, zCenter + 4, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter - 5, yCenter, zCenter + 4, aBaseMetaTileEntity)) + && (addIfEnergyInjector(xCenter + 3, yCenter, zCenter - 4, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter - 3, yCenter, zCenter - 4, aBaseMetaTileEntity)) + && (addIfEnergyInjector(xCenter + 5, yCenter, zCenter - 4, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter - 5, yCenter, zCenter - 4, aBaseMetaTileEntity)) + && (addIfExtractor(xCenter + 1, yCenter, zCenter - 5, aBaseMetaTileEntity)) && (addIfExtractor(xCenter + 1, yCenter, zCenter + 5, aBaseMetaTileEntity)) + && (addIfExtractor(xCenter - 1, yCenter, zCenter - 5, aBaseMetaTileEntity)) && (addIfExtractor(xCenter - 1, yCenter, zCenter + 5, aBaseMetaTileEntity)) + && (addIfExtractor(xCenter + 1, yCenter, zCenter - 7, aBaseMetaTileEntity)) && (addIfExtractor(xCenter + 1, yCenter, zCenter + 7, aBaseMetaTileEntity)) + && (addIfExtractor(xCenter - 1, yCenter, zCenter - 7, aBaseMetaTileEntity)) && (addIfExtractor(xCenter - 1, yCenter, zCenter + 7, aBaseMetaTileEntity)) + && (addIfExtractor(xCenter + 5, yCenter, zCenter - 1, aBaseMetaTileEntity)) && (addIfExtractor(xCenter + 5, yCenter, zCenter + 1, aBaseMetaTileEntity)) + && (addIfExtractor(xCenter - 5, yCenter, zCenter - 1, aBaseMetaTileEntity)) && (addIfExtractor(xCenter - 5, yCenter, zCenter + 1, aBaseMetaTileEntity)) + && (addIfExtractor(xCenter + 7, yCenter, zCenter - 1, aBaseMetaTileEntity)) && (addIfExtractor(xCenter + 7, yCenter, zCenter + 1, aBaseMetaTileEntity)) + && (addIfExtractor(xCenter - 7, yCenter, zCenter - 1, aBaseMetaTileEntity)) && (addIfExtractor(xCenter - 7, yCenter, zCenter + 1, aBaseMetaTileEntity)) + && (addIfInjector(xCenter + 1, yCenter + 1, zCenter - 6, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 1, yCenter + 1, zCenter + 6, aBaseMetaTileEntity)) + && (addIfInjector(xCenter - 1, yCenter + 1, zCenter - 6, aBaseMetaTileEntity)) && (addIfInjector(xCenter - 1, yCenter + 1, zCenter + 6, aBaseMetaTileEntity)) + && (addIfInjector(xCenter - 6, yCenter + 1, zCenter + 1, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 6, yCenter + 1, zCenter + 1, aBaseMetaTileEntity)) + && (addIfInjector(xCenter - 6, yCenter + 1, zCenter - 1, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 6, yCenter + 1, zCenter - 1, aBaseMetaTileEntity)) + && (addIfInjector(xCenter + 1, yCenter - 1, zCenter - 6, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 1, yCenter - 1, zCenter + 6, aBaseMetaTileEntity)) + && (addIfInjector(xCenter - 1, yCenter - 1, zCenter - 6, aBaseMetaTileEntity)) && (addIfInjector(xCenter - 1, yCenter - 1, zCenter + 6, aBaseMetaTileEntity)) + && (addIfInjector(xCenter - 6, yCenter - 1, zCenter + 1, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 6, yCenter - 1, zCenter + 1, aBaseMetaTileEntity)) + && (addIfInjector(xCenter - 6, yCenter - 1, zCenter - 1, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 6, yCenter - 1, zCenter - 1, aBaseMetaTileEntity)) + && (this.mEnergyHatches.size() >= 1) && (this.mOutputHatches.size() >= 1) && (this.mInputHatches.size() >= 2)) { + if (this.mEnergyHatches != null) { + for (int i = 0; i < this.mEnergyHatches.size(); i++) { + if (this.mEnergyHatches.get(i).mTier < tier()) + return false; + } + } + if (this.mOutputHatches != null) { + for (int i = 0; i < this.mOutputHatches.size(); i++) { + if (this.mOutputHatches.get(i).mTier < tier()) + return false; + } + } + if (this.mInputHatches != null) { + for (int i = 0; i < this.mInputHatches.size(); i++) { + if (this.mInputHatches.get(i).mTier < tier()) + return false; + } + } + mWrench = true; + mScrewdriver = true; + mSoftHammer = true; + mHardHammer = true; + mSolderingTool = true; + mCrowbar = true; + return true; + } + return false; + } + + private boolean checkTier(byte tier, ArrayList<GT_MetaTileEntity_Hatch> list) { + if (list != null) { + for (int i = 0; i < list.size(); i++) { + if (list.get(i).mTier < tier) { + return false; + } + } + } + return true; + } + + private boolean checkCoils(int aX, int aY, int aZ) { + return (isFusionCoil(aX + 6, aY, aZ - 1)) && (isFusionCoil(aX + 6, aY, aZ)) && (isFusionCoil(aX + 6, aY, aZ + 1)) && (isFusionCoil(aX + 5, aY, aZ - 3)) && (isFusionCoil(aX + 5, aY, aZ - 2)) + && (isFusionCoil(aX + 5, aY, aZ + 2)) && (isFusionCoil(aX + 5, aY, aZ + 3)) && (isFusionCoil(aX + 4, aY, aZ - 4)) && (isFusionCoil(aX + 4, aY, aZ + 4)) + && (isFusionCoil(aX + 3, aY, aZ - 5)) && (isFusionCoil(aX + 3, aY, aZ + 5)) && (isFusionCoil(aX + 2, aY, aZ - 5)) && (isFusionCoil(aX + 2, aY, aZ + 5)) + && (isFusionCoil(aX + 1, aY, aZ - 6)) && (isFusionCoil(aX + 1, aY, aZ + 6)) && (isFusionCoil(aX, aY, aZ - 6)) && (isFusionCoil(aX, aY, aZ + 6)) && (isFusionCoil(aX - 1, aY, aZ - 6)) + && (isFusionCoil(aX - 1, aY, aZ + 6)) && (isFusionCoil(aX - 2, aY, aZ - 5)) && (isFusionCoil(aX - 2, aY, aZ + 5)) && (isFusionCoil(aX - 3, aY, aZ - 5)) + && (isFusionCoil(aX - 3, aY, aZ + 5)) && (isFusionCoil(aX - 4, aY, aZ - 4)) && (isFusionCoil(aX - 4, aY, aZ + 4)) && (isFusionCoil(aX - 5, aY, aZ - 3)) + && (isFusionCoil(aX - 5, aY, aZ - 2)) && (isFusionCoil(aX - 5, aY, aZ + 2)) && (isFusionCoil(aX - 5, aY, aZ + 3)) && (isFusionCoil(aX - 6, aY, aZ - 1)) + && (isFusionCoil(aX - 6, aY, aZ)) && (isFusionCoil(aX - 6, aY, aZ + 1)); + } + + private boolean checkUpperOrLowerHulls(int aX, int aY, int aZ) { + return (isAdvancedMachineCasing(aX + 6, aY, aZ)) && (isAdvancedMachineCasing(aX + 5, aY, aZ - 3)) && (isAdvancedMachineCasing(aX + 5, aY, aZ - 2)) + && (isAdvancedMachineCasing(aX + 5, aY, aZ + 2)) && (isAdvancedMachineCasing(aX + 5, aY, aZ + 3)) && (isAdvancedMachineCasing(aX + 4, aY, aZ - 4)) + && (isAdvancedMachineCasing(aX + 4, aY, aZ + 4)) && (isAdvancedMachineCasing(aX + 3, aY, aZ - 5)) && (isAdvancedMachineCasing(aX + 3, aY, aZ + 5)) + && (isAdvancedMachineCasing(aX + 2, aY, aZ - 5)) && (isAdvancedMachineCasing(aX + 2, aY, aZ + 5)) && (isAdvancedMachineCasing(aX, aY, aZ - 6)) + && (isAdvancedMachineCasing(aX, aY, aZ + 6)) && (isAdvancedMachineCasing(aX - 2, aY, aZ - 5)) && (isAdvancedMachineCasing(aX - 2, aY, aZ + 5)) + && (isAdvancedMachineCasing(aX - 3, aY, aZ - 5)) && (isAdvancedMachineCasing(aX - 3, aY, aZ + 5)) && (isAdvancedMachineCasing(aX - 4, aY, aZ - 4)) + && (isAdvancedMachineCasing(aX - 4, aY, aZ + 4)) && (isAdvancedMachineCasing(aX - 5, aY, aZ - 3)) && (isAdvancedMachineCasing(aX - 5, aY, aZ - 2)) + && (isAdvancedMachineCasing(aX - 5, aY, aZ + 2)) && (isAdvancedMachineCasing(aX - 5, aY, aZ + 3)) && (isAdvancedMachineCasing(aX - 6, aY, aZ)); + } + + private boolean checkHulls(int aX, int aY, int aZ) { + return (isAdvancedMachineCasing(aX + 6, aY, aZ - 3)) && (isAdvancedMachineCasing(aX + 6, aY, aZ - 2)) && (isAdvancedMachineCasing(aX + 6, aY, aZ + 2)) + && (isAdvancedMachineCasing(aX + 6, aY, aZ + 3)) && (isAdvancedMachineCasing(aX + 3, aY, aZ - 6)) && (isAdvancedMachineCasing(aX + 3, aY, aZ + 6)) + && (isAdvancedMachineCasing(aX + 2, aY, aZ - 6)) && (isAdvancedMachineCasing(aX + 2, aY, aZ + 6)) && (isAdvancedMachineCasing(aX - 2, aY, aZ - 6)) + && (isAdvancedMachineCasing(aX - 2, aY, aZ + 6)) && (isAdvancedMachineCasing(aX - 3, aY, aZ - 6)) && (isAdvancedMachineCasing(aX - 3, aY, aZ + 6)) + && (isAdvancedMachineCasing(aX - 7, aY, aZ)) && (isAdvancedMachineCasing(aX + 7, aY, aZ)) && (isAdvancedMachineCasing(aX, aY, aZ - 7)) && (isAdvancedMachineCasing(aX, aY, aZ + 7)) + && (isAdvancedMachineCasing(aX - 6, aY, aZ - 3)) && (isAdvancedMachineCasing(aX - 6, aY, aZ - 2)) && (isAdvancedMachineCasing(aX - 6, aY, aZ + 2)) + && (isAdvancedMachineCasing(aX - 6, aY, aZ + 3)) && (isAdvancedMachineCasing(aX - 4, aY, aZ - 2)) && (isAdvancedMachineCasing(aX - 4, aY, aZ + 2)) + && (isAdvancedMachineCasing(aX + 4, aY, aZ - 2)) && (isAdvancedMachineCasing(aX + 4, aY, aZ + 2)) && (isAdvancedMachineCasing(aX - 2, aY, aZ - 4)) + && (isAdvancedMachineCasing(aX - 2, aY, aZ + 4)) && (isAdvancedMachineCasing(aX + 2, aY, aZ - 4)) && (isAdvancedMachineCasing(aX + 2, aY, aZ + 4)); + } + + private boolean addIfEnergyInjector(int aX, int aY, int aZ, IGregTechTileEntity aBaseMetaTileEntity) { + if (addEnergyInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntity(aX, aY, aZ), 53)) { + return true; + } + return isAdvancedMachineCasing(aX, aY, aZ); + } + + private boolean addIfInjector(int aX, int aY, int aZ, IGregTechTileEntity aTileEntity) { + if (addInputToMachineList(aTileEntity.getIGregTechTileEntity(aX, aY, aZ), 53)) { + return true; + } + return isAdvancedMachineCasing(aX, aY, aZ); + } + + private boolean addIfExtractor(int aX, int aY, int aZ, IGregTechTileEntity aTileEntity) { + if (addOutputToMachineList(aTileEntity.getIGregTechTileEntity(aX, aY, aZ), 53)) { + return true; + } + return isAdvancedMachineCasing(aX, aY, aZ); + } + + private boolean isAdvancedMachineCasing(int aX, int aY, int aZ) { + return (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasing()) && (getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta()); + } + + public abstract Block getCasing(); + + public abstract int getCasingMeta(); + + private boolean isFusionCoil(int aX, int aY, int aZ) { + return (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getFusionCoil() && (getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getFusionCoilMeta())); + } + + public abstract Block getFusionCoil(); + + public abstract int getFusionCoilMeta(); + + public abstract String[] getDescription(); + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + ITexture[] sTexture; + if (aSide == aFacing) { + sTexture = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, Dyes.getModulation(-1, Dyes._NULL.mRGBa)), new GT_RenderedTexture(getIconOverlay()) }; + } else { + if (!aActive) { + sTexture = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, Dyes.getModulation(-1, Dyes._NULL.mRGBa)) }; + } else { + sTexture = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW, Dyes.getModulation(-1, Dyes._NULL.mRGBa)) }; + } + } + return sTexture; + } + + public abstract IIconContainer getIconOverlay(); + + @Override + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + public int overclock(int mStartEnergy) { + if (tierOverclock() == 1) { + return 1; + } + if (tierOverclock() == 2) { + return mStartEnergy < 160000000 ? 2 : 1; + } + return mStartEnergy < 160000000 ? 4 : mStartEnergy > 320000000 ? 2 : 1; + } + + @Override + public boolean checkRecipe(ItemStack aStack) { + ArrayList<FluidStack> tFluidList = getStoredFluids(); + for (int i = 0; i < tFluidList.size() - 1; i++) { + for (int j = i + 1; j < tFluidList.size(); j++) { + if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) { + if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) { + tFluidList.remove(j--); + } else { + tFluidList.remove(i--); + break; + } + } + } + } + if (tFluidList.size() > 1) { + FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sFusionRecipes.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, GT_Values.V[8], tFluids, new ItemStack[] {}); + if (tRecipe == null&&!mRunningOnLoad) { + turnCasingActive(false); + this.mLastRecipe = null; + return false; + } + if (mRunningOnLoad||tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[] {})) { + if(mRunningOnLoad)System.out.println("First Recipe!"); + this.mLastRecipe = tRecipe; + this.mEUt = (this.mLastRecipe.mEUt * overclock(this.mLastRecipe.mSpecialValue)); + this.mMaxProgresstime = this.mLastRecipe.mDuration / overclock(this.mLastRecipe.mSpecialValue); + this.mEfficiencyIncrease = 10000; + this.mOutputFluids = this.mLastRecipe.mFluidOutputs; + turnCasingActive(true); + mRunningOnLoad=false; + return true; + } + } + return false; + } + + public abstract int tierOverclock(); + + public boolean turnCasingActive(boolean status) { + if (this.mEnergyHatches != null) { + for (GT_MetaTileEntity_Hatch_Energy hatch : this.mEnergyHatches) { + hatch.mMachineBlock = status ? (byte) 52 : (byte) 53; + } + } + if (this.mOutputHatches != null) { + for (GT_MetaTileEntity_Hatch_Output hatch : this.mOutputHatches) { + hatch.mMachineBlock = status ? (byte) 52 : (byte) 53; + } + } + if (this.mInputHatches != null) { + for (GT_MetaTileEntity_Hatch_Input hatch : this.mInputHatches) { + hatch.mMachineBlock = status ? (byte) 52 : (byte) 53; + } + } + return true; + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + if (mEfficiency < 0) + mEfficiency = 0; + if(mRunningOnLoad&&checkMachine(aBaseMetaTileEntity, mInventory[1])){ + this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU(); + checkRecipe(mInventory[1]);} + if (--mUpdate == 0 || --mStartUpCheck == 0) { + mInputHatches.clear(); + mInputBusses.clear(); + mOutputHatches.clear(); + mOutputBusses.clear(); + mDynamoHatches.clear(); + mEnergyHatches.clear(); + mMufflerHatches.clear(); + mMaintenanceHatches.clear(); + mMachine = checkMachine(aBaseMetaTileEntity, mInventory[1]); + } + if (mStartUpCheck < 0) { + if (mMachine) { + if (this.mEnergyHatches != null) { + for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) + if (isValidMetaTileEntity(tHatch)) { + if (aBaseMetaTileEntity.getStoredEU() + (2048 * tierOverclock()) < maxEUStore() + && tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(2048 * tierOverclock(), false)) { + aBaseMetaTileEntity.increaseStoredEnergyUnits(2048 * tierOverclock(), true); + } + } + } + if (this.mEUStore <= 0 && mMaxProgresstime > 0) { + stopMachine(); + } + if (getRepairStatus() > 0) { + if (mMaxProgresstime > 0 && doRandomMaintenanceDamage()) { + this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(mEUt, true); + if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime) { + if (mOutputItems != null)for (ItemStack tStack : mOutputItems )if (tStack != null)addOutput(tStack); + if (mOutputFluids != null)for (FluidStack tStack : mOutputFluids)if (tStack != null)addOutput(tStack); + mEfficiency = Math.max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000))); + mOutputItems = null; + mProgresstime = 0; + mMaxProgresstime = 0; + mEfficiencyIncrease = 0; + if (mOutputFluids != null && mOutputFluids.length > 0) { + GT_Mod.instance.achievements.issueAchivementHatchFluid(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), mOutputFluids[0]); + } + this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU(); + if (aBaseMetaTileEntity.isAllowedToWork()) + checkRecipe(mInventory[1]); + } + } else { + if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified()) { + turnCasingActive(mMaxProgresstime > 0); + if (aBaseMetaTileEntity.isAllowedToWork()) { + this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU(); + if (checkRecipe(mInventory[1]) && aBaseMetaTileEntity.getStoredEU() >= this.mLastRecipe.mSpecialValue) { + aBaseMetaTileEntity.decreaseStoredEnergyUnits(this.mLastRecipe.mSpecialValue, true); + } + } + if (mMaxProgresstime <= 0) + mEfficiency = Math.max(0, mEfficiency - 1000); + } + } + } else { + this.mLastRecipe = null; + stopMachine(); + } + } else { + turnCasingActive(false); + this.mLastRecipe = null; + stopMachine(); + } + } + aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mWrench ? 0 : 1) | (mScrewdriver ? 0 : 2) | (mSoftHammer ? 0 : 4) | (mHardHammer ? 0 : 8) + | (mSolderingTool ? 0 : 16) | (mCrowbar ? 0 : 32) | (mMachine ? 0 : 64)); + aBaseMetaTileEntity.setActive(mMaxProgresstime > 0); + } + } + + @Override + public boolean onRunningTick(ItemStack aStack) { + if (mEUt < 0) { + if (!drainEnergyInput(((long) -mEUt * 10000) / Math.max(1000, mEfficiency))) { + this.mLastRecipe = null; + stopMachine(); + return false; + } + } + if (this.mEUStore <= 0) { + this.mLastRecipe = null; + stopMachine(); + return false; + } + return true; + } + + public boolean drainEnergyInput(long aEU) { + return false; + } + + @Override + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(ItemStack aStack) { + return 0; + } + + @Override + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + @Override + public int getAmountOfOutputs() { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } +}
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java new file mode 100644 index 0000000000..3c23afcbb5 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java @@ -0,0 +1,53 @@ +package gregtech.common.tileentities.machines.multi; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import net.minecraft.block.Block; + +public class GT_MetaTileEntity_FusionComputer1 extends GT_MetaTileEntity_FusionComputer{ + + public GT_MetaTileEntity_FusionComputer1(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, 6); + } + + public GT_MetaTileEntity_FusionComputer1(String aName) {super(aName);} + + @Override + public int tier() {return 6;} + + @Override + public long maxEUStore() {return 160000000L*(Math.min(16, this.mEnergyHatches.size()))/16L;} + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_FusionComputer1(mName); + } + @Override + public int getCasingMeta() {return 6;} + + @Override + public Block getFusionCoil() {return GregTech_API.sBlockCasings1;} + + @Override + public int getFusionCoilMeta() {return 15;} + + public String[] getDescription() + {return new String[] { "It's over 9000!!!","LuV Casings around Superconducting Coils","2-16 Input Hatches","1-16 Output Hatches","1-16 Energy Hatches","All Hatches must be LuV or better","2048EU/t and 10mio EU Cap per Energy Hatch" };} + + @Override + public int tierOverclock() {return 1;} + + @Override + public Block getCasing() { + return GregTech_API.sBlockCasings1; + } + + @Override + public IIconContainer getIconOverlay() { + return Textures.BlockIcons.OVERLAY_FUSION1; + } + +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java new file mode 100644 index 0000000000..d101875ba2 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java @@ -0,0 +1,52 @@ +package gregtech.common.tileentities.machines.multi; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import net.minecraft.block.Block; + +public class GT_MetaTileEntity_FusionComputer2 extends GT_MetaTileEntity_FusionComputer{ + + public GT_MetaTileEntity_FusionComputer2(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, 6); + } + + public GT_MetaTileEntity_FusionComputer2(String aName) {super(aName);} + + @Override + public int tier() {return 7;} + + @Override + public long maxEUStore() {return 320000000L*(Math.min(16, this.mEnergyHatches.size()))/16L;} + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_FusionComputer2(mName); + } + @Override + public int getCasingMeta() {return 6;} + + @Override + public Block getFusionCoil() {return GregTech_API.sBlockCasings4;} + + @Override + public int getFusionCoilMeta() {return 7;} + + public String[] getDescription() + {return new String[] { "It's over 9000!!!","Fusion Casings around Fusion Coils","2-16 Input Hatches","1-16 Output Hatches","1-16 Energy Hatches","All Hatches must be ZPMV or better","4096EU/t and 20mio EU Cap per Energy Hatch" };} + + @Override + public int tierOverclock() {return 2;} + + @Override + public Block getCasing() { + return GregTech_API.sBlockCasings4; + } + + @Override + public IIconContainer getIconOverlay() { + return Textures.BlockIcons.OVERLAY_FUSION2; + } +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java new file mode 100644 index 0000000000..b7334bd449 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java @@ -0,0 +1,54 @@ +package gregtech.common.tileentities.machines.multi; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import net.minecraft.block.Block; + +public class GT_MetaTileEntity_FusionComputer3 extends GT_MetaTileEntity_FusionComputer{ + + public GT_MetaTileEntity_FusionComputer3(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, 6); + } + + public GT_MetaTileEntity_FusionComputer3(String aName) {super(aName);} + + @Override + public int tier() {return 8;} + + @Override + public long maxEUStore() {return 640000000L*(Math.min(16, this.mEnergyHatches.size()))/16L;} + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_FusionComputer3(mName); + } + @Override + public int getCasingMeta() {return 8;} + + @Override + public Block getFusionCoil() {return GregTech_API.sBlockCasings4;} + + @Override + public int getFusionCoilMeta() {return 7;} + + public String[] getDescription() + {return new String[] { "A SUN DOWN ON EARTH","Fusion Casings MK II around Fusion Coils","2-16 Input Hatches","1-16 Output Hatches","1-16 Energy Hatches","All Hatches must be UV or better","8192EU/t and 40mio EU Cap per Energy Hatch" };} + + @Override + public int tierOverclock() {return 4;} + + @Override + public Block getCasing() { + return GregTech_API.sBlockCasings4; + } + + @Override + public IIconContainer getIconOverlay() { + return Textures.BlockIcons.OVERLAY_FUSION3; + } + +} + diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java new file mode 100644 index 0000000000..3a6a51fa46 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java @@ -0,0 +1,303 @@ +package gregtech.common.tileentities.machines.multi; + +import java.util.ArrayList; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import gregtech.GT_Mod; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +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_Output; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; + +public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBlockBase{ + public GT_MetaTileEntity_HeatExchanger(int aID, String aName, String aNameRegional) + { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_HeatExchanger(String aName) + { + super(aName); + } + + public String[] getDescription() + { + return new String[] { "Controller Block for the Heat Exchanger", "Size: 3x3x4", "Controller (front middle at bottom)", "3x3x4 of Stable Titanium Casing (hollow, Min 24!)", "2 Titanium Pipe Casing Blocks inside the Hollow Casing", "1x Distillated Water Input (one of the Casings)","min 1 Steam Output (one of the Casings)", "1x Maintenance Hatch (one of the Casings)", "1x Hot Fluid Input (botton Center)", "1x Cold Fluid Output (top Center)" }; + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + superheated = aNBT.getBoolean("superheated"); + super.loadNBTData(aNBT);} + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setBoolean("superheated", superheated); + super.saveNBTData(aNBT);} + + public GT_MetaTileEntity_Hatch_Input mInputHotFluidHatch; + public GT_MetaTileEntity_Hatch_Output mOutputColdFluidHatch; + public boolean superheated=false; + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) + { + if (aSide == aFacing) { + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[50], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER) }; + } + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[50] }; + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) + { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeBoiler.png"); + } + + public boolean isCorrectMachinePart(ItemStack aStack) + { + return true; + } + + public boolean isFacingValid(byte aFacing) + { + return aFacing > 1; + } + + public boolean checkRecipe(ItemStack aStack) { + if (mInputHotFluidHatch.getFluid() == null) + return true; + + int fluidAmountToConsume = mInputHotFluidHatch.getFluidAmount(); // how much fluid is in hatch + + int superheated_threshold = 4000; // default: must have 4000L per second to generate superheated steam + float efficiency = 1f; // default: operate at 100% efficiency with no integrated circuitry + float penalty_per_config = 0.015f; // penalize 1.5% efficiency per circuitry level (1-25) + int shs_reduction_per_config = 150; // reduce threshold 150L/s per circuitry level (1-25) + float steam_output_multiplier = 4f; // default: multiply output by 4 + float penalty = 0.0f; // penalty to apply to output based on circuitry level (1-25). + boolean do_lava = false; + + // Do we have an integrated circuit with a valid configuration? + if (mInventory[1] != null && mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit")) { + int circuit_config = mInventory[1].getItemDamage(); + if (circuit_config >= 1 && circuit_config <= 25) { + // If so, apply the penalty and reduced threshold. + penalty = (circuit_config - 1) * penalty_per_config; + superheated_threshold -= (shs_reduction_per_config * (circuit_config - 1)); + } + } + efficiency -= penalty; + + // If we're working with lava, adjust the threshold and multipliers accordingly. + if (GT_ModHandler.isLava(mInputHotFluidHatch.getFluid())) { + superheated_threshold /= 4; + do_lava = true; + } else if (mInputHotFluidHatch.getFluid().isFluidEqual(FluidRegistry.getFluidStack("ic2hotcoolant", 1))) { + steam_output_multiplier = 0.5f; + } else { + // If we're working with neither, fail out + return false; + } + + superheated = fluidAmountToConsume >= superheated_threshold; // set the internal superheated flag if we have enough hot fluid. Used in the onRunningTick method. + fluidAmountToConsume = Math.min(fluidAmountToConsume, superheated_threshold * 2); // Don't consume too much hot fluid per second + mInputHotFluidHatch.drain(fluidAmountToConsume, true); + this.mMaxProgresstime = 20; + this.mEUt = (int) (fluidAmountToConsume * steam_output_multiplier * efficiency); + if (do_lava) { + mOutputColdFluidHatch.fill(FluidRegistry.getFluidStack("ic2pahoehoelava", fluidAmountToConsume), true); + this.mEfficiencyIncrease = 80; + } else { + mOutputColdFluidHatch.fill(FluidRegistry.getFluidStack("ic2coolant", fluidAmountToConsume), true); + this.mEfficiencyIncrease = 80; + } + return true; + } + + private float water; + private int useWater(float input) { + water = water + input; + int usage = (int) water; + water = water - (int) usage; + return usage; + } + + public boolean onRunningTick(ItemStack aStack) { + if (this.mEUt > 0) { + int tGeneratedEU = (int) (this.mEUt * 2L * this.mEfficiency / 10000L); // APPROXIMATELY how much steam to generate. + if (tGeneratedEU > 0) { + + if (superheated) + tGeneratedEU /= 2; // We produce half as much superheated steam if necessary + + int distilledConsumed = useWater(tGeneratedEU / 160f); // how much distilled water to consume + //tGeneratedEU = distilledConsumed * 160; // EXACTLY how much steam to generate, producing a perfect 1:160 ratio with distilled water consumption + + FluidStack distilledStack = GT_ModHandler.getDistilledWater(distilledConsumed); + if (depleteInput(distilledStack)) // Consume the distilled water + { + if (superheated) { + addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", tGeneratedEU)); // Generate superheated steam + } else { + addOutput(GT_ModHandler.getSteam(tGeneratedEU)); // Generate regular steam + } + } else { + explodeMultiblock(); // Generate crater + } + } + return true; + } + return true; + } + private static boolean controller; + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) + { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + + int tCasingAmount = 0;int tFireboxAmount = 0;controller=false; + for (int i = -1; i < 2; i++) { + for (int j = -1; j < 2; j++) { + if ((i != 0) || (j != 0)) + { + for (int k = 0; k <= 3; k++) { + if (!addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, k, zDir + j), 50)&&!addInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, k, zDir + j), 50)&&!addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, k, zDir + j), 50)&&!ignoreController(aBaseMetaTileEntity.getBlockOffset(xDir + i, k, zDir + j))) + { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, k, zDir + j) != getCasingBlock()) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, k, zDir + j) != getCasingMeta()) { + return false; + } + tCasingAmount++; + } + } + }else{ + if(!addHotFluidInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j), 50)){ + return false; + } + if(!addColdFluidOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 3, zDir + j), 50)){ + return false; + } + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != getPipeBlock()) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != getPipeMeta()) { + return false; + } + + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != getPipeBlock()) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != getPipeMeta()) { + return false; + } + } + } + } + return (tCasingAmount >= 24); + } + + public boolean ignoreController(Block tTileEntity){ + if(!controller&&tTileEntity == GregTech_API.sBlockMachines){return true;} + return false; + } + + public boolean addColdFluidOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) return false; + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) return false; + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { + ((GT_MetaTileEntity_Hatch)aMetaTileEntity).mMachineBlock = (byte)aBaseCasingIndex; + mOutputColdFluidHatch = (GT_MetaTileEntity_Hatch_Output)aMetaTileEntity; + return true; + } + return false; + } + + public boolean addHotFluidInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) return false; + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) return false; + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + ((GT_MetaTileEntity_Hatch)aMetaTileEntity).mMachineBlock = (byte)aBaseCasingIndex; + ((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity).mRecipeMap = getRecipeMap(); + mInputHotFluidHatch = (GT_MetaTileEntity_Hatch_Input)aMetaTileEntity; + return true; + } + return false; + } + + public Block getCasingBlock() + { + return GregTech_API.sBlockCasings4; + } + + public byte getCasingMeta() + { + return 2; + } + + public byte getCasingTextureIndex() + { + return 50; + } + + public Block getPipeBlock() + { + return GregTech_API.sBlockCasings2; + } + + public byte getPipeMeta() + { + return 14; + } + + public int getMaxEfficiency(ItemStack aStack) + { + return 10000; + } + + public int getPollutionPerTick(ItemStack aStack) + { + return 0; + } + + public int getDamageToComponent(ItemStack aStack) + { + return 0; + } + + public int getAmountOfOutputs() + { + return 1; + } + + public boolean explodesOnComponentBreak(ItemStack aStack) + { + return false; + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) + { + return new GT_MetaTileEntity_HeatExchanger(this.mName); + } + } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java new file mode 100644 index 0000000000..468da7a845 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java @@ -0,0 +1,180 @@ +package gregtech.common.tileentities.machines.multi;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.gui.GT_GUIContainer_MultiMachine;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+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 java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Map;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+
+public class GT_MetaTileEntity_ImplosionCompressor
+ extends GT_MetaTileEntity_MultiBlockBase
+{
+ public GT_MetaTileEntity_ImplosionCompressor(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_ImplosionCompressor(String aName)
+ {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_ImplosionCompressor(this.mName);
+ }
+
+ public String[] getDescription()
+ {
+ return new String[] { "Controller Block for the Implosion Compressor", "Size: 3x3x3 (Hollow)", "Controller (front centered)", "1x Input (anywhere)", "1x Output (anywhere)", "1x Energy Hatch (anywhere)", "1x Maintenance Hatch (anywhere)", "1x Muffler Hatch (anywhere)", "Solid Steel Casings for the rest (16 at least!)" };
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
+ {
+ if (aSide == aFacing) {
+ return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[16], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR) };
+ }
+ return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[16] };
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ImplosionCompressor.png");
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap()
+ {
+ return GT_Recipe.GT_Recipe_Map.sImplosionRecipes;
+ }
+
+ public boolean isCorrectMachinePart(ItemStack aStack)
+ {
+ return true;
+ }
+
+ public boolean isFacingValid(byte aFacing)
+ {
+ return aFacing > 1;
+ }
+
+ public boolean checkRecipe(ItemStack aStack)
+ {
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ for (int i = 0; i < tInputList.size() - 1; i++) {
+ for (int j = i + 1; j < tInputList.size(); j++) {
+ if (GT_Utility.areStacksEqual((ItemStack)tInputList.get(i), (ItemStack)tInputList.get(j))) {
+ if (((ItemStack)tInputList.get(i)).stackSize >= ((ItemStack)tInputList.get(j)).stackSize)
+ {
+ tInputList.remove(j--);
+ }
+ else
+ {
+ tInputList.remove(i--); break;
+ }
+ }
+ }
+ }
+ ItemStack[] tInputs = (ItemStack[])Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
+ if (tInputList.size() > 0)
+ {
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sImplosionRecipes.findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs);
+ if ((tRecipe != null) && (tRecipe.isRecipeInputEqual(true, null, tInputs)))
+ {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ this.mEUt = (-tRecipe.mEUt);
+ this.mMaxProgresstime = Math.max(1, tRecipe.mDuration);
+ this.mOutputItems = new ItemStack[] { tRecipe.getOutput(0), tRecipe.getOutput(1) };
+ sendLoopStart((byte)20);
+ updateSlots();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
+ {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 20) {
+ GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(5)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack)
+ {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
+ return false;
+ }
+ int tAmount = 0;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ for (int h = -1; h < 2; h++) {
+ if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0))))
+ {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addMufflerToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16)) && (!addOutputToMachineList(tTileEntity, 16)) && (!addEnergyInputToMachineList(tTileEntity, 16)))
+ {
+ Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
+ byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
+ if (((tBlock != GregTech_API.sBlockCasings2) || (tMeta != 0)) && ((tBlock != GregTech_API.sBlockCasings3) || (tMeta != 4))) {
+ return false;
+ }
+ tAmount++;
+ }
+ }
+ }
+ }
+ }
+ return tAmount >= 16;
+ }
+
+ public int getMaxEfficiency(ItemStack aStack)
+ {
+ return 10000;
+ }
+
+ public int getPollutionPerTick(ItemStack aStack)
+ {
+ return 1000;
+ }
+
+ public int getDamageToComponent(ItemStack aStack)
+ {
+ return 0;
+ }
+
+ public int getAmountOfOutputs()
+ {
+ return 2;
+ }
+
+ public boolean explodesOnComponentBreak(ItemStack aStack)
+ {
+ return false;
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ImplosionCompressor
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java new file mode 100644 index 0000000000..df129f8fd7 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java @@ -0,0 +1,269 @@ +package gregtech.common.tileentities.machines.multi;
+
+import gregtech.GT_Mod;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.gui.GT_GUIContainer_MultiMachine;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+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 gregtech.api.util.GT_Recipe.GT_Recipe_Map_Fuel;
+import gregtech.api.util.GT_Utility;
+
+import java.util.ArrayList;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
+public abstract class GT_MetaTileEntity_LargeBoiler
+ extends GT_MetaTileEntity_MultiBlockBase
+{
+ public GT_MetaTileEntity_LargeBoiler(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_LargeBoiler(String aName)
+ {
+ super(aName);
+ }
+
+ public String[] getDescription()
+ {
+ return new String[] { "Controller Block for the Large Boiler", "Size: 3x3x5", "Controller (front middle in Fireboxes)", "3x3 of Fire Boxes (bottom Layer, Min 3!)", "3x3x4 of Casing (above Fireboxes, hollow, Min 24!)", "3 Pipe Casing Blocks inside the Hollow Casing", "1x Input (one of Fireboxes)", "1x Maintenance Hatch (one of Fireboxes)", "1x Muffler Hatch (one of Fireboxes)", "1x Fluid Output (one of Main Casing)" };
+ }
+
+ public abstract Block getCasingBlock();
+
+ public abstract byte getCasingMeta();
+
+ public abstract byte getCasingTextureIndex();
+
+ public abstract Block getPipeBlock();
+
+ public abstract byte getPipeMeta();
+
+ public abstract Block getFireboxBlock();
+
+ public abstract byte getFireboxMeta();
+
+ public abstract byte getFireboxTextureIndex();
+
+ public abstract int getEUt();
+
+ public abstract int getEfficiencyIncrease();
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
+ {
+ if (aSide == aFacing) {
+ return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[getCasingTextureIndex()], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER) };
+ }
+ return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[getCasingTextureIndex()] };
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeBoiler.png");
+ }
+
+ public boolean isCorrectMachinePart(ItemStack aStack)
+ {
+ return true;
+ }
+
+ public boolean isFacingValid(byte aFacing)
+ {
+ return aFacing > 1;
+ }
+
+ public boolean checkRecipe(ItemStack aStack)
+ {
+ for (GT_Recipe tRecipe : GT_Recipe.GT_Recipe_Map.sDieselFuels.mRecipeList)
+ {
+ FluidStack tFluid = GT_Utility.getFluidForFilledItem(tRecipe.getRepresentativeInput(0), true);
+ if ((tFluid != null) && (tRecipe.mSpecialValue > 1))
+ {
+ tFluid.amount = 1000;
+ if (depleteInput(tFluid))
+ {
+ this.mMaxProgresstime = (tRecipe.mSpecialValue / 2);
+ this.mEUt = getEUt();
+ this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease() * 4);
+ return true;
+ }
+ }
+ }
+ for (GT_Recipe tRecipe : GT_Recipe.GT_Recipe_Map.sDenseLiquidFuels.mRecipeList)
+ {
+ FluidStack tFluid = GT_Utility.getFluidForFilledItem(tRecipe.getRepresentativeInput(0), true);
+ if (tFluid != null)
+ {
+ tFluid.amount = 1000;
+ if (depleteInput(tFluid))
+ {
+ this.mMaxProgresstime = Math.max(1, tRecipe.mSpecialValue * 2);
+ this.mEUt = getEUt();
+ this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease());
+ return true;
+ }
+ }
+ }
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ if (!tInputList.isEmpty()) {
+ for (ItemStack tInput : tInputList) {
+ if ((GT_Utility.getFluidForFilledItem(tInput, true) == null) && ((this.mMaxProgresstime = GT_ModHandler.getFuelValue(tInput) / 80) > 0))
+ {
+ this.mEUt = getEUt();
+ this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease());
+ this.mOutputItems = new ItemStack[] { GT_Utility.getContainerItem(tInput, true) };
+ tInput.stackSize -= 1;
+ updateSlots();
+ return true;
+ }
+ }
+ }
+ this.mMaxProgresstime = 0;
+ this.mEUt = 0;
+ return false;
+ }
+
+ public boolean onRunningTick(ItemStack aStack)
+ {
+ if (this.mEUt > 0)
+ {
+ int tGeneratedEU = (int)(this.mEUt * 2L * this.mEfficiency / 10000L);
+ if (tGeneratedEU > 0) {
+ long amount = (tGeneratedEU + 160) / 160;
+ if (depleteInput(Materials.Water.getFluid(amount)) || depleteInput(GT_ModHandler.getDistilledWater(amount))) {
+ addOutput(GT_ModHandler.getSteam(tGeneratedEU));
+ } else {
+ explodeMultiblock();
+ }
+ }
+ return true;
+ }
+ return true;
+ }
+
+private boolean firstRun = true;
+
+@Override
+public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (mProgresstime>0&&firstRun) {firstRun = false;try{
+ GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "extremepressure");}catch (Exception e){}
+ }
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+}
+
+
+
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack)
+ {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+
+ int tCasingAmount = 0;int tFireboxAmount = 0;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if ((i != 0) || (j != 0))
+ {
+ for (int k = 1; k <= 4; k++) {
+ if (!addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, k, zDir + j), getCasingTextureIndex()))
+ {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, k, zDir + j) != getCasingBlock()) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, k, zDir + j) != getCasingMeta()) {
+ return false;
+ }
+ tCasingAmount++;
+ }
+ }
+ }
+ else
+ {
+ for (int k = 1; k <= 3; k++)
+ {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, k, zDir + j) != getPipeBlock()) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, k, zDir + j) != getPipeMeta()) {
+ return false;
+ }
+ }
+ if (!addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 4, zDir + j), getCasingTextureIndex()))
+ {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 4, zDir + j) != getCasingBlock()) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 4, zDir + j) != getCasingMeta()) {
+ return false;
+ }
+ tCasingAmount++;
+ }
+ }
+ }
+ }
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if ((xDir + i != 0) || (zDir + j != 0))
+ {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, getFireboxTextureIndex())) && (!addInputToMachineList(tTileEntity, getFireboxTextureIndex())) && (!addMufflerToMachineList(tTileEntity, getFireboxTextureIndex())))
+ {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != getFireboxBlock()) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != getFireboxMeta()) {
+ return false;
+ }
+ tFireboxAmount++;
+ }
+ }
+ }
+ }
+ return (tCasingAmount >= 24) && (tFireboxAmount >= 3);
+ }
+
+ public int getMaxEfficiency(ItemStack aStack)
+ {
+ return 10000;
+ }
+
+ public int getPollutionPerTick(ItemStack aStack)
+ {
+ return 10;
+ }
+
+ public int getDamageToComponent(ItemStack aStack)
+ {
+ return 0;
+ }
+
+ public int getAmountOfOutputs()
+ {
+ return 1;
+ }
+
+ public boolean explodesOnComponentBreak(ItemStack aStack)
+ {
+ return false;
+ }
+}
+
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+
+ * Qualified Name: gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeBoiler
+
+ * JD-Core Version: 0.7.0.1
+
+ */
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java new file mode 100644 index 0000000000..c0c362d2c5 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java @@ -0,0 +1,81 @@ +package gregtech.common.tileentities.machines.multi;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.block.Block;
+
+public class GT_MetaTileEntity_LargeBoiler_Bronze
+ extends GT_MetaTileEntity_LargeBoiler
+{
+ public GT_MetaTileEntity_LargeBoiler_Bronze(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_LargeBoiler_Bronze(String aName)
+ {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_LargeBoiler_Bronze(this.mName);
+ }
+
+ public Block getCasingBlock()
+ {
+ return GregTech_API.sBlockCasings1;
+ }
+
+ public byte getCasingMeta()
+ {
+ return 10;
+ }
+
+ public byte getCasingTextureIndex()
+ {
+ return 10;
+ }
+
+ public Block getPipeBlock()
+ {
+ return GregTech_API.sBlockCasings2;
+ }
+
+ public byte getPipeMeta()
+ {
+ return 12;
+ }
+
+ public Block getFireboxBlock()
+ {
+ return GregTech_API.sBlockCasings3;
+ }
+
+ public byte getFireboxMeta()
+ {
+ return 13;
+ }
+
+ public byte getFireboxTextureIndex()
+ {
+ return 45;
+ }
+
+ public int getEUt()
+ {
+ return 400;
+ }
+
+ public int getEfficiencyIncrease()
+ {
+ return 16;
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeBoiler_Bronze
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java new file mode 100644 index 0000000000..c6f16a7d4f --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java @@ -0,0 +1,81 @@ +package gregtech.common.tileentities.machines.multi;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.block.Block;
+
+public class GT_MetaTileEntity_LargeBoiler_Steel
+ extends GT_MetaTileEntity_LargeBoiler
+{
+ public GT_MetaTileEntity_LargeBoiler_Steel(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_LargeBoiler_Steel(String aName)
+ {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_LargeBoiler_Steel(this.mName);
+ }
+
+ public Block getCasingBlock()
+ {
+ return GregTech_API.sBlockCasings2;
+ }
+
+ public byte getCasingMeta()
+ {
+ return 0;
+ }
+
+ public byte getCasingTextureIndex()
+ {
+ return 16;
+ }
+
+ public Block getPipeBlock()
+ {
+ return GregTech_API.sBlockCasings2;
+ }
+
+ public byte getPipeMeta()
+ {
+ return 13;
+ }
+
+ public Block getFireboxBlock()
+ {
+ return GregTech_API.sBlockCasings3;
+ }
+
+ public byte getFireboxMeta()
+ {
+ return 14;
+ }
+
+ public byte getFireboxTextureIndex()
+ {
+ return 46;
+ }
+
+ public int getEUt()
+ {
+ return 600;
+ }
+
+ public int getEfficiencyIncrease()
+ {
+ return 12;
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeBoiler_Steel
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java new file mode 100644 index 0000000000..7d11836a19 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java @@ -0,0 +1,75 @@ +package gregtech.common.tileentities.machines.multi;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.block.Block;
+
+public class GT_MetaTileEntity_LargeBoiler_Titanium
+ extends GT_MetaTileEntity_LargeBoiler
+{
+ public GT_MetaTileEntity_LargeBoiler_Titanium(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_LargeBoiler_Titanium(String aName)
+ {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_LargeBoiler_Titanium(this.mName);
+ }
+
+ public Block getCasingBlock()
+ {
+ return GregTech_API.sBlockCasings4;
+ }
+
+ public byte getCasingMeta()
+ {
+ return 2;
+ }
+
+ public byte getCasingTextureIndex()
+ {
+ return 50;
+ }
+
+ public Block getPipeBlock()
+ {
+ return GregTech_API.sBlockCasings2;
+ }
+
+ public byte getPipeMeta()
+ {
+ return 14;
+ }
+
+ public Block getFireboxBlock()
+ {
+ return GregTech_API.sBlockCasings4;
+ }
+
+ public byte getFireboxMeta()
+ {
+ return 3;
+ }
+
+ public byte getFireboxTextureIndex()
+ {
+ return 51;
+ }
+
+ public int getEUt()
+ {
+ return 800;
+ }
+
+ public int getEfficiencyIncrease()
+ {
+ return 8;
+ }
+}
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java new file mode 100644 index 0000000000..399ba2dcf4 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java @@ -0,0 +1,81 @@ +package gregtech.common.tileentities.machines.multi;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.block.Block;
+
+public class GT_MetaTileEntity_LargeBoiler_TungstenSteel
+ extends GT_MetaTileEntity_LargeBoiler
+{
+ public GT_MetaTileEntity_LargeBoiler_TungstenSteel(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_LargeBoiler_TungstenSteel(String aName)
+ {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_LargeBoiler_TungstenSteel(this.mName);
+ }
+
+ public Block getCasingBlock()
+ {
+ return GregTech_API.sBlockCasings4;
+ }
+
+ public byte getCasingMeta()
+ {
+ return 0;
+ }
+
+ public byte getCasingTextureIndex()
+ {
+ return 48;
+ }
+
+ public Block getPipeBlock()
+ {
+ return GregTech_API.sBlockCasings2;
+ }
+
+ public byte getPipeMeta()
+ {
+ return 15;
+ }
+
+ public Block getFireboxBlock()
+ {
+ return GregTech_API.sBlockCasings3;
+ }
+
+ public byte getFireboxMeta()
+ {
+ return 15;
+ }
+
+ public byte getFireboxTextureIndex()
+ {
+ return 47;
+ }
+
+ public int getEUt()
+ {
+ return 1000;
+ }
+
+ public int getEfficiencyIncrease()
+ {
+ return 4;
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeBoiler_TungstenSteel
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java new file mode 100644 index 0000000000..d8b765c82a --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java @@ -0,0 +1,192 @@ +package gregtech.common.tileentities.machines.multi; + +import java.util.ArrayList; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; +import gregtech.api.GregTech_API; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +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_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; +import gregtech.common.items.GT_MetaGenerated_Tool_01; + +public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_MultiBlockBase{ + + public GT_MetaTileEntity_LargeTurbine(int aID, String aName, String aNameRegional){super(aID, aName, aNameRegional);} + public GT_MetaTileEntity_LargeTurbine(String aName){super(aName);} + + + @Override + public boolean isCorrectMachinePart(ItemStack aStack) { + return getMaxEfficiency(aStack) > 0; + } + + protected int baseEff=0; + protected int optFlow=0; + protected int counter=0; + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + byte tSide = getBaseMetaTileEntity().getBackFacing(); + if ((getBaseMetaTileEntity().getAirAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 1)) && (getBaseMetaTileEntity().getAirAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 2))) + { + int tAirCount = 0; + for (byte i = -1; i < 2; i = (byte)(i + 1)) { + for (byte j = -1; j < 2; j = (byte)(j + 1)) { + for (byte k = -1; k < 2; k = (byte)(k + 1)) { + if (getBaseMetaTileEntity().getAirOffset(i, j, k)) { + tAirCount++; + } + } + } + } + if (tAirCount != 10) { + return false; + } + for (byte i = 2; i < 6; i = (byte)(i + 1)) + { + IGregTechTileEntity tTileEntity; + if ((null != (tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(i, 2))) && + (tTileEntity.getFrontFacing() == getBaseMetaTileEntity().getFrontFacing()) && (tTileEntity.getMetaTileEntity() != null) && + ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_LargeTurbine))) { + return false; + } + } + int tX = getBaseMetaTileEntity().getXCoord();int tY = getBaseMetaTileEntity().getYCoord();int tZ = getBaseMetaTileEntity().getZCoord(); + for (byte i = -1; i < 2; i = (byte)(i + 1)) { + for (byte j = -1; j < 2; j = (byte)(j + 1)) { + if ((i != 0) || (j != 0)) { + for (byte k = 0; k < 4; k = (byte)(k + 1)) { + if (((i == 0) || (j == 0)) && ((k == 1) || (k == 2))) + { + if (getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingMeta()) + {}else if (!addToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)))) { + return false; + } + } + else if (getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingBlock()&& getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingMeta()) + {}else {return false; + } + } + } + } + } + this.mDynamoHatches.clear(); + IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 3); + if ((tTileEntity != null) && (tTileEntity.getMetaTileEntity() != null)) { + if ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Dynamo)) { + this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo)tTileEntity.getMetaTileEntity()); + ((GT_MetaTileEntity_Hatch)tTileEntity.getMetaTileEntity()).mMachineBlock = getCasingTextureIndex(); + } else { + return false; + } + } + } + else + { + return false; + } + return true; + } + + public abstract Block getCasingBlock(); + + public abstract byte getCasingMeta(); + + public abstract byte getCasingTextureIndex(); + + private boolean addToMachineList(IGregTechTileEntity tTileEntity){ + return ((addMaintenanceToMachineList(tTileEntity, getCasingTextureIndex())) || (addInputToMachineList(tTileEntity, getCasingTextureIndex())) || (addOutputToMachineList(tTileEntity, getCasingTextureIndex()))|| (addMufflerToMachineList(tTileEntity, getCasingTextureIndex()))); + } + + + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + } + + @Override + public boolean checkRecipe(ItemStack aStack) { + ArrayList<FluidStack> tFluids = getStoredFluids(); + if (tFluids.size() > 0) { + if (baseEff == 0 || optFlow == 0 || counter >= 1000 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled() + || this.getBaseMetaTileEntity().hasInventoryBeenModified()) { + counter = 0; + baseEff = (int) ((50.0F + + (10.0F * ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack))) * 100); + optFlow = (int) Math.max(Float.MIN_NORMAL, + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack).getSpeedMultiplier() + * ((GT_MetaGenerated_Tool) aStack.getItem()).getPrimaryMaterial(aStack).mToolSpeed + * 50); + } else { + counter++; + } + } + + int newPower = fluidIntoPower(tFluids, optFlow, baseEff); // How much the turbine should be producing with this flow + int difference = newPower - this.mEUt; // difference between current output and new output + + // Magic numbers: can always change by at least 10 eu/t, but otherwise by at most 1 percent of the difference in power level (per tick) + // This is how much the turbine can actually change during this tick + int maxChangeAllowed = Math.max(10, (int) Math.ceil(Math.abs(difference) * 0.01)); + + if (Math.abs(difference) > maxChangeAllowed) { // If this difference is too big, use the maximum allowed change + int change = maxChangeAllowed * (difference > 0 ? 1 : -1); // Make the change positive or negative. + this.mEUt += change; // Apply the change + } + else + this.mEUt = newPower; + + if (mEUt <= 0) { + +// this.mEfficiencyIncrease = (-10); + this.mEfficiency = 0; + //stopMachine(); + return false; + } else { + this.mMaxProgresstime = 1; + this.mEfficiencyIncrease = (10); + return true; + } + } + + abstract int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff); + + @Override + public int getDamageToComponent(ItemStack aStack) { + return 1; + } + + public int getMaxEfficiency(ItemStack aStack) + { + if (GT_Utility.isStackInvalid(aStack)) { + return 0; + } + if (aStack.getItem() instanceof GT_MetaGenerated_Tool_01) { + return 10000; + } + return 0; + } + + @Override + public int getAmountOfOutputs() {return 0;} + @Override + public boolean explodesOnComponentBreak(ItemStack aStack) {return true;} +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java new file mode 100644 index 0000000000..2f750ab914 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java @@ -0,0 +1,116 @@ +package gregtech.common.tileentities.machines.multi; + +import java.util.ArrayList; +import java.util.Collection; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.items.GT_MetaGenerated_Tool; +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 gregtech.api.util.GT_Utility; + +public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeTurbine{ + + public GT_MetaTileEntity_LargeTurbine_Gas(int aID, String aName, String aNameRegional){super(aID, aName, aNameRegional);} + public GT_MetaTileEntity_LargeTurbine_Gas(String aName){super(aName);} + + @Override + public 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 ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5):new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]}; + } + + + public String[] getDescription() + { + return new String[] { + "Controller Block for the Large Gas Turbine", + "Size: 3x3x4 (Hollow)", "Controller (front centered)", + "1x Input Hatch (side centered)", + "1x Dynamo Hatch (back centered)", + "1x Maintenance Hatch (side centered)", + "1x Muffler Hatch (side centered)", + "Turbine Casings for the rest (24 at least!)", + "Needs a Turbine Item (inside controller GUI)"}; + } + + public int getFuelValue(FluidStack aLiquid) { + if (aLiquid == null || GT_Recipe_Map.sTurbineFuels == null) return 0; + FluidStack tLiquid; + Collection<GT_Recipe> tRecipeList = GT_Recipe_Map.sTurbineFuels.mRecipeList; + if (tRecipeList != null) for (GT_Recipe tFuel : tRecipeList) if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null) if (aLiquid.isFluidEqual(tLiquid)) return tFuel.mSpecialValue; + return 0; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {return new GT_MetaTileEntity_LargeTurbine_Gas(mName);} + @Override + public Block getCasingBlock() { + return GregTech_API.sBlockCasings4; + } + @Override + public byte getCasingMeta() { + return 9; + } + @Override + public byte getCasingTextureIndex() { + return 46; + } + @Override + public int getPollutionPerTick(ItemStack aStack) { + return 10; + } + + @Override + int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) { + int tEU = 0; + + int actualOptimalFlow = 0; + + if (aFluids.size() >= 1) { + 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 = (int) (aOptFlow / fuelValue); + + int remainingFlow = (int) (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; + + for (int i = 0; i < aFluids.size(); i++) { + if (aFluids.get(i).isFluidEqual(firstFuelType)) { + flow = aFluids.get(i).amount; // Get all (steam) in hatch + flow = Math.min(flow, Math.min(remainingFlow, (int) (actualOptimalFlow * 1.25f))); // try to use up to 125% of optimal flow w/o exceeding remainingFlow + depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount + remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches + totalFlow += flow; // track total input used + } + } + + tEU = (int) (Math.min((float) actualOptimalFlow, totalFlow) * fuelValue); + + if (totalFlow != actualOptimalFlow) { + float efficiency = 1.0f - Math.abs(((totalFlow - (float) actualOptimalFlow) / actualOptimalFlow)); + if (efficiency < 0) + efficiency = 0; // Can happen with really ludicrously poor inefficiency. + tEU *= efficiency; + tEU = Math.max(1, tEU * aBaseEff / 10000); + } else { + tEU = tEU * aBaseEff / 10000; + } + + return tEU; + + } + return 0; + } + + +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java new file mode 100644 index 0000000000..d57aa52db8 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java @@ -0,0 +1,96 @@ +package gregtech.common.tileentities.machines.multi; + +import java.util.ArrayList; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import gregtech.GT_Mod; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; + +public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_LargeTurbine{ + + public GT_MetaTileEntity_LargeTurbine_HPSteam(int aID, String aName, String aNameRegional){super(aID, aName, aNameRegional);} + public GT_MetaTileEntity_LargeTurbine_HPSteam(String aName){super(aName);} + + @Override + public 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 ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5):new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]}; + } + + + public String[] getDescription() + { + return new String[] { + "Controller Block for the Large High Pressure Steam Turbine", + "Size: 3x3x4 (Hollow)", "Controller (front centered)", + "1x Input Hatch (side centered)", "1x Output Hatch(side centered)", + "1x Dynamo Hatch (back centered)", + "1x Maintenance Hatch (side centered)", + "Turbine Casings for the rest (24 at least!)", + "Needs a Turbine Item (inside controller GUI)" }; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {return new GT_MetaTileEntity_LargeTurbine_HPSteam(mName);} + @Override + public Block getCasingBlock() { + return GregTech_API.sBlockCasings4; + } + @Override + public byte getCasingMeta() { + return 9; + } + @Override + public byte getCasingTextureIndex() { + return 46; + } + @Override + public int getPollutionPerTick(ItemStack aStack) { + return 0; + } + public boolean achievement=false; + + @Override + int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) { + int tEU = 0; + int totalFlow = 0; // Byproducts are based on actual flow + int flow = 0; + int remainingFlow = (int) (aOptFlow * 1.25f); // Allowed to use up to 125% of optimal flow + + for (int i = 0; i < aFluids.size() && remainingFlow > 0; i++) { + if (aFluids.get(i).getFluid().getUnlocalizedName(aFluids.get(i)).equals("ic2.fluidSuperheatedSteam")) { + flow = aFluids.get(i).amount; // Get all (steam) in hatch + flow = Math.min(flow, Math.min(remainingFlow, (int) (aOptFlow * 1.25f))); // try to use up to 125% of optimal flow w/o exceeding remainingFlow + depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount + remainingFlow -= flow; // track amount we're allowed to keep depleting from hatches + totalFlow += flow; // track total used + if(!achievement){ + try{GT_Mod.instance.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "efficientsteam");}catch(Exception e){} + achievement=true; + } + } + } + + tEU = (int) (Math.min((float) aOptFlow, totalFlow)); + addOutput(GT_ModHandler.getSteam(totalFlow)); + if (totalFlow > 0 && totalFlow != aOptFlow) { + float efficiency = 1.0f - Math.abs(((totalFlow - (float) aOptFlow) / aOptFlow)); + tEU *= efficiency; + tEU = Math.max(1, tEU * aBaseEff / 10000); + } else { + tEU = tEU * aBaseEff / 10000; + } + + return tEU; + } + + +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java new file mode 100644 index 0000000000..5b7ea5c362 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java @@ -0,0 +1,115 @@ +package gregtech.common.tileentities.machines.multi; + +import java.util.ArrayList; +import java.util.Collection; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import gregtech.GT_Mod; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.items.GT_MetaGenerated_Tool; +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 gregtech.api.util.GT_Recipe.GT_Recipe_Map; + +public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_LargeTurbine{ + + public GT_MetaTileEntity_LargeTurbine_Plasma(int aID, String aName, String aNameRegional){super(aID, aName, aNameRegional);} + public GT_MetaTileEntity_LargeTurbine_Plasma(String aName){super(aName);} + + @Override + public 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 ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5):new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]}; + } + + + public String[] getDescription() + { + return new String[] { + "Controller Block for the Large Plasma Generator", + "Size: 3x3x4 (Hollow)", "Controller (front centered)", + "1x Input Hatch (side centered)", + "1x Dynamo Hatch (back centered)", + "1x Maintenance Hatch (side centered)", + "Turbine Casings for the rest (24 at least!)", + "Needs a Turbine Item (inside controller GUI)" }; + } + + public int getFuelValue(FluidStack aLiquid) { + if (aLiquid == null || GT_Recipe_Map.sTurbineFuels == null) return 0; + FluidStack tLiquid; + Collection<GT_Recipe> tRecipeList = GT_Recipe_Map.sPlasmaFuels.mRecipeList; + if (tRecipeList != null) for (GT_Recipe tFuel : tRecipeList) if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null) if (aLiquid.isFluidEqual(tLiquid)) return tFuel.mSpecialValue; + return 0; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {return new GT_MetaTileEntity_LargeTurbine_Plasma(mName);} + @Override + public Block getCasingBlock() { + return GregTech_API.sBlockCasings4; + } + @Override + public byte getCasingMeta() { + return 9; + } + @Override + public byte getCasingTextureIndex() { + return 46; + } + @Override + public int getPollutionPerTick(ItemStack aStack) { + return 0; + } + + @Override + int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) { + aOptFlow *= 20; + int tEU = 0; + + int actualOptimalFlow = 0; + + if (aFluids.size() >= 1) { + 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 = (int) ((aOptFlow + fuelValue -1 )/ fuelValue); + int remainingFlow = (int) (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; + + for (int i = 0; i < aFluids.size(); i++) { + if (aFluids.get(i).isFluidEqual(firstFuelType)) { + flow = aFluids.get(i).amount; // Get all (steam) in hatch + flow = Math.min(flow, Math.min(remainingFlow, (int) (actualOptimalFlow * 1.25f))); // try to use up to 125% of optimal flow w/o exceeding remainingFlow + depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount + remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches + totalFlow += flow; // track total input used + } + } + + tEU = (int) (Math.min((float) actualOptimalFlow, totalFlow) * fuelValue); + + if (totalFlow != actualOptimalFlow) { + float efficiency = 1.0f - Math.abs(((totalFlow - (float) actualOptimalFlow) / actualOptimalFlow)); + if (efficiency < 0) + efficiency = 0; // Can happen with really ludicrously poor inefficiency. + tEU *= efficiency; + tEU = Math.max(1, tEU * aBaseEff / 10000); + } else { + tEU = tEU * aBaseEff / 10000; + } + return tEU; + + } + return 0; + } + + +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java new file mode 100644 index 0000000000..7a3f45037a --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java @@ -0,0 +1,105 @@ +package gregtech.common.tileentities.machines.multi; + +import java.util.ArrayList; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import gregtech.GT_Mod; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; + +public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_LargeTurbine{ + + public GT_MetaTileEntity_LargeTurbine_Steam(int aID, String aName, String aNameRegional){super(aID, aName, aNameRegional);} + public GT_MetaTileEntity_LargeTurbine_Steam(String aName){super(aName);} + + @Override + public 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 ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5):new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]}; + } + + + public String[] getDescription() + { + return new String[] { + "Controller Block for the Large Steam Turbine", + "Size: 3x3x4 (Hollow)", "Controller (front centered)", + "1x Input Hatch (side centered)", "1x Output Hatch(side centered)", + "1x Dynamo Hatch (back centered)", + "1x Maintenance Hatch (side centered)", + "Turbine Casings for the rest (24 at least!)", + "Needs a Turbine Item (inside controller GUI)" }; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {return new GT_MetaTileEntity_LargeTurbine_Steam(mName);} + @Override + public Block getCasingBlock() { + return GregTech_API.sBlockCasings4; + } + @Override + public byte getCasingMeta() { + return 9; + } + @Override + public byte getCasingTextureIndex() { + return 46; + } + @Override + public int getPollutionPerTick(ItemStack aStack) { + return 0; + } + + private float water; + private int useWater(float input){ + water = water + input; + int usage = (int)water; + water = water - (int)usage; + return usage; + } + + private boolean achievement = false; + + @Override + int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) { + int tEU = 0; + int totalFlow = 0; // Byproducts are based on actual flow + int flow = 0; + int remainingFlow = (int) (aOptFlow * 1.25f); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. + + for (int i = 0; i < aFluids.size() && remainingFlow > 0; i++) { // loop through each hatch; extract inputs and track totals. + String fluidName = aFluids.get(i).getFluid().getUnlocalizedName(aFluids.get(i)); + if (fluidName.equals("fluid.steam") || fluidName.equals("ic2.fluidSteam") || fluidName.equals("fluid.mfr.steam.still.name")) { + flow = aFluids.get(i).amount; // Get all (steam) in hatch + flow = Math.min(flow, Math.min(remainingFlow, (int) (aOptFlow * 1.25f))); // try to use up to 125% of optimal flow w/o exceeding remainingFlow + depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount + remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches + totalFlow += flow; // track total input used + if(!achievement){ + try{GT_Mod.instance.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "muchsteam");}catch(Exception e){} + achievement=true; + } + } + } + + tEU = (int) (Math.min((float) aOptFlow, totalFlow)); + int waterToOutput = useWater(totalFlow / 160.0f); + addOutput(GT_ModHandler.getDistilledWater(waterToOutput)); + if (totalFlow > 0 && totalFlow != aOptFlow) { + float efficiency = 1.0f - Math.abs(((totalFlow - (float) aOptFlow) / aOptFlow)); + tEU *= efficiency; + tEU = Math.max(1, tEU * aBaseEff / 20000); + } else { + tEU = tEU * aBaseEff / 20000; + } + + return tEU; + } +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java new file mode 100644 index 0000000000..f1017a18a3 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java @@ -0,0 +1,195 @@ +package gregtech.common.tileentities.machines.multi;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.gui.GT_GUIContainer_MultiMachine;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+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 gregtech.api.util.GT_Utility;
+
+import java.util.ArrayList;
+
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+
+public class GT_MetaTileEntity_MultiFurnace
+ extends GT_MetaTileEntity_MultiBlockBase
+{
+ private int mLevel = 0;
+
+ public GT_MetaTileEntity_MultiFurnace(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_MultiFurnace(String aName)
+ {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_MultiFurnace(this.mName);
+ }
+
+ public String[] getDescription()
+ {
+ return new String[] { "Smelts up to 6-18 Items at once", "Controller Block for the Multi Smelter", "Size: 3x3x3 (Hollow)", "Controller (front middle at bottom)", "8x Heating Coils (middle Layer, hollow)", "1x Input (one of bottom)", "1x Output (one of bottom)", "1x Energy Hatch (one of bottom)", "1x Maintenance Hatch (one of bottom)", "1x Muffler Hatch (top middle)", "Heat Proof Machine Casings for the rest" };
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
+ {
+ if (aSide == aFacing) {
+ return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[11], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER) };
+ }
+ return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[11] };
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiFurnace.png");
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap()
+ {
+ return GT_Recipe.GT_Recipe_Map.sFurnaceRecipes;
+ }
+
+ public boolean isCorrectMachinePart(ItemStack aStack)
+ {
+ return true;
+ }
+
+ public boolean isFacingValid(byte aFacing)
+ {
+ return aFacing > 1;
+ }
+
+ public boolean checkRecipe(ItemStack aStack)
+ {
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ if (!tInputList.isEmpty())
+ {
+ byte tTier = (byte)Math.max(1, GT_Utility.getTier(getMaxInputVoltage()));
+
+ int j = 0;
+ this.mOutputItems = new ItemStack[6 * this.mLevel];
+ for (int i = 0; (i < 100) && (j < this.mOutputItems.length); i++) {
+ if (null != (this.mOutputItems[j] = GT_ModHandler.getSmeltingOutput((ItemStack)tInputList.get(i % tInputList.size()), true, null))) {
+ j++;
+ }
+ }
+ if (j > 0)
+ {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ this.mEUt = (-4 * (1 << tTier - 1) * (1 << tTier - 1) * this.mLevel);
+ this.mMaxProgresstime = Math.max(1, 512 / (1 << tTier - 1));
+ }
+ updateSlots();
+ return true;
+ }
+ return false;
+ }
+
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack)
+ {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+
+ this.mLevel = 0;
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) {
+ return false;
+ }
+ addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 2, zDir), 11);
+
+ byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 1, zDir);
+ switch (tUsedMeta)
+ {
+ case 12:
+ this.mLevel = 1; break;
+ case 13:
+ this.mLevel = 2; break;
+ case 14:
+ this.mLevel = 3; break;
+ default:
+ return false;
+ }
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if ((i != 0) || (j != 0))
+ {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != tUsedMeta) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != 11) {
+ return false;
+ }
+ }
+ }
+ }
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if ((xDir + i != 0) || (zDir + j != 0))
+ {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, 11)) && (!addInputToMachineList(tTileEntity, 11)) && (!addOutputToMachineList(tTileEntity, 11)) && (!addEnergyInputToMachineList(tTileEntity, 11)))
+ {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 11) {
+ return false;
+ }
+ }
+ }
+ }
+ }
+ return true;
+ }
+
+ public int getMaxEfficiency(ItemStack aStack)
+ {
+ return 10000;
+ }
+
+ public int getPollutionPerTick(ItemStack aStack)
+ {
+ return 20;
+ }
+
+ public int getDamageToComponent(ItemStack aStack)
+ {
+ return 0;
+ }
+
+ public int getAmountOfOutputs()
+ {
+ return 18;
+ }
+
+ public boolean explodesOnComponentBreak(ItemStack aStack)
+ {
+ return false;
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_MultiFurnace
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java new file mode 100644 index 0000000000..410eea616c --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java @@ -0,0 +1,294 @@ +package gregtech.common.tileentities.machines.multi; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.apache.commons.lang3.ArrayUtils; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_GT_Recipe; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; + +public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBlockBase{ + + public GT_MetaTileEntity_ProcessingArray(int aID, String aName, String aNameRegional) + { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_ProcessingArray(String aName) + { + super(aName); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) + { + return new GT_MetaTileEntity_ProcessingArray(this.mName); + } + + public String[] getDescription() + { + return new String[] { "Controller Block for the Processing Array", + "Size: 3x3x3 (Hollow)", + "Controller (front centered)", + "1x Input (anywhere)", + "1x Output (anywhere)", + "1x Energy Hatch (anywhere)", + "1x Maintenance Hatch (anywhere)", + "Robust Tungstensteel Casings for the rest (16 at least!)", + "Place up to 16 Single Block GT Machines into the GUI Inventory", + "They will work the same way as placed directly in world"}; + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) + { + if (aSide == aFacing) { + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[48], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER) }; + } + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[48] }; + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) + { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png"); + } + + public GT_Recipe.GT_Recipe_Map getRecipeMap() + { + if(mInventory[1]==null)return null; + String tmp = mInventory[1].getUnlocalizedName().replaceAll("gt.blockmachines.basicmachine.", ""); + if(tmp.startsWith("centrifuge")){ + return GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes; + }else if(tmp.startsWith("electrolyzer")){ + return GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes; + }else if(tmp.startsWith("alloysmelter")){ + return GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes; + }else if(tmp.startsWith("assembler")){ + return GT_Recipe.GT_Recipe_Map.sAssemblerRecipes; + }else if(tmp.startsWith("compressor")){ + return GT_Recipe.GT_Recipe_Map.sCompressorRecipes; + }else if(tmp.startsWith("extractor")){ + return GT_Recipe.GT_Recipe_Map.sExtractorRecipes; + }else if(tmp.startsWith("macerator")){ + return GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; + }else if(tmp.startsWith("recycler")){ + return GT_Recipe.GT_Recipe_Map.sRecyclerRecipes; + }else if(tmp.startsWith("thermalcentrifuge")){ + return GT_Recipe.GT_Recipe_Map.sThermalCentrifugeRecipes; + }else if(tmp.startsWith("orewasher")){ + return GT_Recipe.GT_Recipe_Map.sOreWasherRecipes; + }else if(tmp.startsWith("chemicalreactor")){ + return GT_Recipe.GT_Recipe_Map.sChemicalRecipes; + }else if(tmp.startsWith("chemicalbath")){ + return GT_Recipe.GT_Recipe_Map.sChemicalBathRecipes; + }else if(tmp.startsWith("electromagneticseparator")){ + return GT_Recipe.GT_Recipe_Map.sElectroMagneticSeparatorRecipes; + }else if(tmp.startsWith("autoclave")){ + return GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes; + }else if(tmp.startsWith("mixer")){ + return GT_Recipe.GT_Recipe_Map.sMixerRecipes; + }else if(tmp.startsWith("hammer")){ + return GT_Recipe.GT_Recipe_Map.sHammerRecipes; + }else if(tmp.startsWith("sifter")){ + return GT_Recipe.GT_Recipe_Map.sSifterRecipes; + }else if(tmp.startsWith("extruder")){ + return GT_Recipe.GT_Recipe_Map.sExtruderRecipes; + }else if(tmp.startsWith("laserengraver")){ + return GT_Recipe.GT_Recipe_Map.sLaserEngraverRecipes; + }else if(tmp.startsWith("bender")){ + return GT_Recipe.GT_Recipe_Map.sBenderRecipes; + }else if(tmp.startsWith("wiremill")){ + return GT_Recipe.GT_Recipe_Map.sWiremillRecipes; + }else if(tmp.startsWith("arcfurnace")){ + return GT_Recipe.GT_Recipe_Map.sArcFurnaceRecipes; + } + return null; + } + + public boolean isCorrectMachinePart(ItemStack aStack) + { + if(aStack!=null&&aStack.getUnlocalizedName().startsWith("gt.blockmachines.basicmachine.")){ + return true;} + return false; + } + + public boolean isFacingValid(byte aFacing) + { + return aFacing > 1; + } + + GT_Recipe mLastRecipe; + public boolean checkRecipe(ItemStack aStack){ + if(!isCorrectMachinePart(mInventory[1])){return false;} + GT_Recipe.GT_Recipe_Map map = getRecipeMap(); + if(map==null){return false;} + ArrayList<ItemStack> tInputList = getStoredInputs(); + int tTier = 0; + if(mInventory[1].getUnlocalizedName().endsWith("1")){tTier=1;} + if(mInventory[1].getUnlocalizedName().endsWith("2")){tTier=2;} + if(mInventory[1].getUnlocalizedName().endsWith("3")){tTier=3;} + if(mInventory[1].getUnlocalizedName().endsWith("4")){tTier=4;} + if(mInventory[1].getUnlocalizedName().endsWith("5")){tTier=5;} + for (int i = 0; i < tInputList.size() - 1; i++) { + for (int j = i + 1; j < tInputList.size(); j++) { + if (GT_Utility.areStacksEqual((ItemStack)tInputList.get(i), (ItemStack)tInputList.get(j))) { + if (((ItemStack)tInputList.get(i)).stackSize >= ((ItemStack)tInputList.get(j)).stackSize) + { + tInputList.remove(j--); + } + else + { + tInputList.remove(i--); break; + } + } + } + } + ItemStack[] tInputs = (ItemStack[])Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2); + + ArrayList<FluidStack> tFluidList = getStoredFluids(); + for (int i = 0; i < tFluidList.size() - 1; i++) { + for (int j = i + 1; j < tFluidList.size(); j++) { + if (GT_Utility.areFluidsEqual((FluidStack)tFluidList.get(i), (FluidStack)tFluidList.get(j))) { + if (((FluidStack)tFluidList.get(i)).amount >= ((FluidStack)tFluidList.get(j)).amount) + { + tFluidList.remove(j--); + } + else + { + tFluidList.remove(i--); break; + } + } + } + } + FluidStack[] tFluids = (FluidStack[])Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1); + if(tInputList.size() > 0 || tFluids.length>0){ + GT_Recipe tRecipe = map.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + if (tRecipe != null) { + mLastRecipe = tRecipe; + this.mEUt = 0; + this.mOutputItems = null; + this.mOutputFluids = null; + this.mMaxProgresstime = tRecipe.mDuration; + int machines = Math.min(16,mInventory[1].stackSize); + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + int i = 0; + for(;i<machines;i++){ + if(!tRecipe.isRecipeInputEqual(true, tFluids, tInputs))break; + } + if (tRecipe.mEUt <= 16) + { + this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1)); + } + else + { + this.mEUt = tRecipe.mEUt; + this.mMaxProgresstime = tRecipe.mDuration; + while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) + { + this.mEUt *= 4; + this.mMaxProgresstime /= 2; + } + } + this.mEUt*=i; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + ItemStack[] tOut = new ItemStack[tRecipe.mOutputs.length]; + for(int h = 0;h<tRecipe.mOutputs.length;h++){ + tOut[h] = tRecipe.getOutput(h).copy(); + tOut[h].stackSize =0; + }FluidStack tFOut=null; + if(tRecipe.getFluidOutput(0)!=null) tFOut = tRecipe.getFluidOutput(0).copy(); + for(int f =0; f < tOut.length ; f++){ + if(tRecipe.mOutputs[f]!=null&&tOut[f]!=null){ + for(int g =0;g<i;g++){ + if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f)) tOut[f].stackSize += tRecipe.mOutputs[f].stackSize; + } + } + } + if(tFOut!=null){ + int tSize = tFOut.amount; + tFOut.amount = tSize * i; + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + List<ItemStack> overStacks = new ArrayList<ItemStack>(); + for(int f =0; f < tOut.length ; f++){ + if(tOut[f].getMaxStackSize()<tOut[f].stackSize){ + while(tOut[f].getMaxStackSize()<tOut[f].stackSize){ + ItemStack tmp = tOut[f].copy(); + tmp.stackSize = tmp.getMaxStackSize(); + tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize(); + overStacks.add(tmp); + } + } + } + if(overStacks.size()>0){ + ItemStack[] tmp = new ItemStack[overStacks.size()]; + tmp = overStacks.toArray(tmp); + tOut = ArrayUtils.addAll(tOut, tmp); + } + List<ItemStack> tSList = new ArrayList<ItemStack>(); + for(ItemStack tS : tOut){ + if(tS.stackSize>0)tSList.add(tS); + } + tOut = tSList.toArray(new ItemStack[tSList.size()]); + this.mOutputItems = tOut; + this.mOutputFluids = new FluidStack[]{tFOut}; + updateSlots(); + return true; + } + } + return false; + } + + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) + { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) { + return false; + } + int tAmount = 0; + for (int i = -1; i < 2; i++) { + for (int j = -1; j < 2; j++) { + for (int h = -1; h < 2; h++) { + if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))) + { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j); + if ((!addMaintenanceToMachineList(tTileEntity, 48)) && (!addInputToMachineList(tTileEntity, 48)) && (!addOutputToMachineList(tTileEntity, 48)) && (!addEnergyInputToMachineList(tTileEntity, 48))) + { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings4) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0) { + return false; + } + tAmount++; + } + } + } + } + } + return tAmount >= 16; + } + + public int getMaxEfficiency(ItemStack aStack){return 10000;} + public int getPollutionPerTick(ItemStack aStack){return 0;} + public int getDamageToComponent(ItemStack aStack){return 0;} + public int getAmountOfOutputs(){return 1;} + public boolean explodesOnComponentBreak(ItemStack aStack){return false;} + }
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java new file mode 100644 index 0000000000..e416905b7c --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java @@ -0,0 +1,175 @@ +package gregtech.common.tileentities.machines.multi;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.gui.GT_GUIContainer_MultiMachine;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+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 java.util.ArrayList;
+
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+
+public class GT_MetaTileEntity_VacuumFreezer
+ extends GT_MetaTileEntity_MultiBlockBase
+{
+ public GT_MetaTileEntity_VacuumFreezer(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_VacuumFreezer(String aName)
+ {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_VacuumFreezer(this.mName);
+ }
+
+ public String[] getDescription()
+ {
+ return new String[] { "Controller Block for the Vacuum Freezer", "Size: 3x3x3 (Hollow)", "Controller (front centered)", "1x Input (anywhere)", "1x Output (anywhere)", "1x Energy Hatch (anywhere)", "1x Maintenance Hatch (anywhere)", "Frost Proof Casings for the rest (16 at least!)" };
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
+ {
+ if (aSide == aFacing) {
+ return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[17], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER) };
+ }
+ return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[17] };
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png");
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap()
+ {
+ return GT_Recipe.GT_Recipe_Map.sVacuumRecipes;
+ }
+
+ public boolean isCorrectMachinePart(ItemStack aStack)
+ {
+ return true;
+ }
+
+ public boolean isFacingValid(byte aFacing)
+ {
+ return aFacing > 1;
+ }
+
+ public boolean checkRecipe(ItemStack aStack)
+ {
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ for (ItemStack tInput : tInputList)
+ {
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte)Math.max(1, GT_Utility.getTier(tVoltage));
+
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], null, new ItemStack[] { tInput });
+ if (tRecipe != null) {
+ if (tRecipe.isRecipeInputEqual(true, null, new ItemStack[] { tInput }))
+ {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16)
+ {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
+ }
+ else
+ {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)])
+ {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputItems = new ItemStack[] { tRecipe.getOutput(0) };
+ updateSlots();
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack)
+ {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
+ return false;
+ }
+ int tAmount = 0;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ for (int h = -1; h < 2; h++) {
+ if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0))))
+ {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, 17)) && (!addInputToMachineList(tTileEntity, 17)) && (!addOutputToMachineList(tTileEntity, 17)) && (!addEnergyInputToMachineList(tTileEntity, 17)))
+ {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings2) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 1) {
+ return false;
+ }
+ tAmount++;
+ }
+ }
+ }
+ }
+ }
+ return tAmount >= 16;
+ }
+
+ public int getMaxEfficiency(ItemStack aStack)
+ {
+ return 10000;
+ }
+
+ public int getPollutionPerTick(ItemStack aStack)
+ {
+ return 0;
+ }
+
+ public int getDamageToComponent(ItemStack aStack)
+ {
+ return 0;
+ }
+
+ public int getAmountOfOutputs()
+ {
+ return 1;
+ }
+
+ public boolean explodesOnComponentBreak(ItemStack aStack)
+ {
+ return false;
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_VacuumFreezer
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java new file mode 100644 index 0000000000..e8e06e94a8 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java @@ -0,0 +1,122 @@ +package gregtech.common.tileentities.machines.steam;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.gui.GT_GUIContainer_BasicMachine;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Bronze;
+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 java.util.Map;
+
+import net.minecraft.entity.player.InventoryPlayer;
+
+public class GT_MetaTileEntity_AlloySmelter_Bronze
+ extends GT_MetaTileEntity_BasicMachine_Bronze
+{
+ public GT_MetaTileEntity_AlloySmelter_Bronze(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional, "Combination Smelter", 2, 1, true);
+ }
+
+ public GT_MetaTileEntity_AlloySmelter_Bronze(String aName, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aDescription, aTextures, 2, 1, true);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_AlloySmelter_Bronze(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeAlloySmelter.png", GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.mUnlocalizedName);
+ }
+
+ public int checkRecipe()
+ {
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[1], null, getAllInputs());
+ if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs())))
+ {
+ this.mOutputItems[0] = tRecipe.getOutput(0);
+ if (tRecipe.mEUt <= 16)
+ {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = (tRecipe.mDuration * 2);
+ }
+ else
+ {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = (tRecipe.mDuration * 2);
+ }
+ return 2;
+ }
+ return 0;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
+ {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(208)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess()
+ {
+ sendLoopStart((byte)1);
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE) };
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_ALLOY_SMELTER) };
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE) };
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_ALLOY_SMELTER) };
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE) };
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_ALLOY_SMELTER) };
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE) };
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER) };
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.steam.GT_MetaTileEntity_AlloySmelter_Bronze
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java new file mode 100644 index 0000000000..e2d9ddbf62 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java @@ -0,0 +1,122 @@ +package gregtech.common.tileentities.machines.steam;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.gui.GT_GUIContainer_BasicMachine;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel;
+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 java.util.Map;
+
+import net.minecraft.entity.player.InventoryPlayer;
+
+public class GT_MetaTileEntity_AlloySmelter_Steel
+ extends GT_MetaTileEntity_BasicMachine_Steel
+{
+ public GT_MetaTileEntity_AlloySmelter_Steel(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional, "Combination Smelter", 2, 1, true);
+ }
+
+ public GT_MetaTileEntity_AlloySmelter_Steel(String aName, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aDescription, aTextures, 2, 1, true);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_AlloySmelter_Steel(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelAlloySmelter.png", GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.mUnlocalizedName);
+ }
+
+ public int checkRecipe()
+ {
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[2], null, getAllInputs());
+ if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs())))
+ {
+ this.mOutputItems[0] = tRecipe.getOutput(0);
+ if (tRecipe.mEUt <= 16)
+ {
+ this.mEUt = (tRecipe.mEUt * 3);
+ this.mMaxProgresstime = tRecipe.mDuration;
+ }
+ else
+ {
+ this.mEUt = (tRecipe.mEUt * 3);
+ this.mMaxProgresstime = tRecipe.mDuration;
+ }
+ return 2;
+ }
+ return 0;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
+ {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(208)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess()
+ {
+ sendLoopStart((byte)1);
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE) };
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_ALLOY_SMELTER) };
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE) };
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_ALLOY_SMELTER) };
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE) };
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_ALLOY_SMELTER) };
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE) };
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER) };
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.steam.GT_MetaTileEntity_AlloySmelter_Steel
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java new file mode 100644 index 0000000000..8b9d8400c8 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java @@ -0,0 +1,118 @@ +package gregtech.common.tileentities.machines.steam;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.gui.GT_GUIContainer_BasicMachine;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Bronze;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+
+import java.util.Map;
+
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+
+public class GT_MetaTileEntity_Compressor_Bronze
+ extends GT_MetaTileEntity_BasicMachine_Bronze
+{
+ public GT_MetaTileEntity_Compressor_Bronze(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional, "Compressing Items", 1, 1, false);
+ }
+
+ public GT_MetaTileEntity_Compressor_Bronze(String aName, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aDescription, aTextures, 1, 1, false);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeCompressor.png", "ic2.compressor");
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_Compressor_Bronze(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public int checkRecipe()
+ {
+ if (null != (this.mOutputItems[0] = GT_ModHandler.getCompressorOutput(getInputAt(0), true, getOutputAt(0))))
+ {
+ this.mEUt = 2;
+ this.mMaxProgresstime = 800;
+ return 2;
+ }
+ return 0;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
+ {
+ if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {return false;}
+ return GT_ModHandler.getCompressorOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
+ {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(203)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess()
+ {
+ sendLoopStart((byte)1);
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE) };
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR) };
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE) };
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR) };
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE) };
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR) };
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE) };
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR) };
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.steam.GT_MetaTileEntity_Compressor_Bronze
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java new file mode 100644 index 0000000000..ec478e620f --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java @@ -0,0 +1,118 @@ +package gregtech.common.tileentities.machines.steam;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.gui.GT_GUIContainer_BasicMachine;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+
+import java.util.Map;
+
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+
+public class GT_MetaTileEntity_Compressor_Steel
+ extends GT_MetaTileEntity_BasicMachine_Steel
+{
+ public GT_MetaTileEntity_Compressor_Steel(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional, "Compressing Items", 1, 1, false);
+ }
+
+ public GT_MetaTileEntity_Compressor_Steel(String aName, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aDescription, aTextures, 1, 1, false);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelCompressor.png", "ic2.compressor");
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_Compressor_Steel(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public int checkRecipe()
+ {
+ if (null != (this.mOutputItems[0] = GT_ModHandler.getCompressorOutput(getInputAt(0), true, getOutputAt(0))))
+ {
+ this.mEUt = 6;
+ this.mMaxProgresstime = 400;
+ return 2;
+ }
+ return 0;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
+ {
+ if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {return false;}
+ return GT_ModHandler.getCompressorOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
+ {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(203)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess()
+ {
+ sendLoopStart((byte)1);
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE) };
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR) };
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE) };
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR) };
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE) };
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR) };
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE) };
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR) };
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.steam.GT_MetaTileEntity_Compressor_Steel
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java new file mode 100644 index 0000000000..bfcf602ca3 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java @@ -0,0 +1,118 @@ +package gregtech.common.tileentities.machines.steam;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.gui.GT_GUIContainer_BasicMachine;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Bronze;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+
+import java.util.Map;
+
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+
+public class GT_MetaTileEntity_Extractor_Bronze
+ extends GT_MetaTileEntity_BasicMachine_Bronze
+{
+ public GT_MetaTileEntity_Extractor_Bronze(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional, "Extracting your first Rubber", 1, 1, false);
+ }
+
+ public GT_MetaTileEntity_Extractor_Bronze(String aName, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aDescription, aTextures, 1, 1, false);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeExtractor.png", "ic2.extractor");
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_Extractor_Bronze(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public int checkRecipe()
+ {
+ if (null != (this.mOutputItems[0] = GT_ModHandler.getExtractorOutput(getInputAt(0), true, getOutputAt(0))))
+ {
+ this.mEUt = 2;
+ this.mMaxProgresstime = 800;
+ return 2;
+ }
+ return 0;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
+ {
+ if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {return false;}
+ return GT_ModHandler.getExtractorOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
+ {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(200)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess()
+ {
+ sendLoopStart((byte)1);
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE) };
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR) };
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE) };
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR) };
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE) };
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR) };
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE) };
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR) };
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.steam.GT_MetaTileEntity_Extractor_Bronze
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java new file mode 100644 index 0000000000..d2a0cc3c70 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java @@ -0,0 +1,118 @@ +package gregtech.common.tileentities.machines.steam;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.gui.GT_GUIContainer_BasicMachine;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+
+import java.util.Map;
+
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+
+public class GT_MetaTileEntity_Extractor_Steel
+ extends GT_MetaTileEntity_BasicMachine_Steel
+{
+ public GT_MetaTileEntity_Extractor_Steel(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional, "Extracting your first Rubber", 1, 1, false);
+ }
+
+ public GT_MetaTileEntity_Extractor_Steel(String aName, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aDescription, aTextures, 1, 1, false);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelExtractor.png", "ic2.extractor");
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_Extractor_Steel(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public int checkRecipe()
+ {
+ if (null != (this.mOutputItems[0] = GT_ModHandler.getExtractorOutput(getInputAt(0), true, getOutputAt(0))))
+ {
+ this.mEUt = 6;
+ this.mMaxProgresstime = 400;
+ return 2;
+ }
+ return 0;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
+ {
+ if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {return false;}
+ return GT_ModHandler.getExtractorOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
+ {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(200)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess()
+ {
+ sendLoopStart((byte)1);
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE) };
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR) };
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE) };
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR) };
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE) };
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR) };
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE) };
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR) };
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.steam.GT_MetaTileEntity_Extractor_Steel
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java new file mode 100644 index 0000000000..5596571384 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java @@ -0,0 +1,122 @@ +package gregtech.common.tileentities.machines.steam;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.gui.GT_GUIContainer_BasicMachine;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Bronze;
+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 java.util.Map;
+
+import net.minecraft.entity.player.InventoryPlayer;
+
+public class GT_MetaTileEntity_ForgeHammer_Bronze
+ extends GT_MetaTileEntity_BasicMachine_Bronze
+{
+ public GT_MetaTileEntity_ForgeHammer_Bronze(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional, "Forge Hammer", 1, 1, false);
+ }
+
+ public GT_MetaTileEntity_ForgeHammer_Bronze(String aName, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aDescription, aTextures, 1, 1, false);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_ForgeHammer_Bronze(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeHammer.png", GT_Recipe.GT_Recipe_Map.sHammerRecipes.mUnlocalizedName, (byte)6, (byte)3);
+ }
+
+ public int checkRecipe()
+ {
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[1], null, getAllInputs());
+ if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs())))
+ {
+ this.mOutputItems[0] = tRecipe.getOutput(0);
+ if (tRecipe.mEUt <= 16)
+ {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = (tRecipe.mDuration * 2);
+ }
+ else
+ {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = (tRecipe.mDuration * 2);
+ }
+ return 2;
+ }
+ return 0;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
+ {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(1)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess()
+ {
+ sendLoopStart((byte)1);
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_HAMMER_ACTIVE) };
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_HAMMER) };
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_HAMMER_ACTIVE) };
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_HAMMER) };
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_HAMMER_ACTIVE) };
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_HAMMER) };
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE) };
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_HAMMER) };
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.steam.GT_MetaTileEntity_ForgeHammer_Bronze
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java new file mode 100644 index 0000000000..fda0620572 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java @@ -0,0 +1,122 @@ +package gregtech.common.tileentities.machines.steam;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.gui.GT_GUIContainer_BasicMachine;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel;
+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 java.util.Map;
+
+import net.minecraft.entity.player.InventoryPlayer;
+
+public class GT_MetaTileEntity_ForgeHammer_Steel
+ extends GT_MetaTileEntity_BasicMachine_Steel
+{
+ public GT_MetaTileEntity_ForgeHammer_Steel(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional, "Forge Hammer", 1, 1, false);
+ }
+
+ public GT_MetaTileEntity_ForgeHammer_Steel(String aName, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aDescription, aTextures, 1, 1, false);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_ForgeHammer_Steel(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelHammer.png", GT_Recipe.GT_Recipe_Map.sHammerRecipes.mUnlocalizedName, (byte)6, (byte)3);
+ }
+
+ public int checkRecipe()
+ {
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[2], null, getAllInputs());
+ if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs())))
+ {
+ this.mOutputItems[0] = tRecipe.getOutput(0);
+ if (tRecipe.mEUt <= 16)
+ {
+ this.mEUt = (tRecipe.mEUt * 3);
+ this.mMaxProgresstime = tRecipe.mDuration;
+ }
+ else
+ {
+ this.mEUt = (tRecipe.mEUt * 3);
+ this.mMaxProgresstime = tRecipe.mDuration;
+ }
+ return 2;
+ }
+ return 0;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
+ {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(1)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess()
+ {
+ sendLoopStart((byte)1);
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_HAMMER_ACTIVE) };
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_HAMMER) };
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_HAMMER_ACTIVE) };
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_HAMMER) };
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_HAMMER_ACTIVE) };
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_HAMMER) };
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE) };
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_HAMMER) };
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.steam.GT_MetaTileEntity_ForgeHammer_Steel
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java new file mode 100644 index 0000000000..29606fceee --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java @@ -0,0 +1,118 @@ +package gregtech.common.tileentities.machines.steam;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.gui.GT_GUIContainer_BasicMachine;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Bronze;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+
+import java.util.Map;
+
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+
+public class GT_MetaTileEntity_Furnace_Bronze
+ extends GT_MetaTileEntity_BasicMachine_Bronze
+{
+ public GT_MetaTileEntity_Furnace_Bronze(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional, "Smelting things with compressed Steam", 1, 1, true);
+ }
+
+ public GT_MetaTileEntity_Furnace_Bronze(String aName, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aDescription, aTextures, 1, 1, true);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeFurnace.png", "smelting");
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_Furnace_Bronze(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public int checkRecipe()
+ {
+ if (null != (this.mOutputItems[0] = GT_ModHandler.getSmeltingOutput(getInputAt(0), true, getOutputAt(0))))
+ {
+ this.mEUt = 4;
+ this.mMaxProgresstime = 256;
+ return 2;
+ }
+ return 0;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
+ {
+ if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {return false;}
+ return GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
+ {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(207)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess()
+ {
+ sendLoopStart((byte)1);
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE_ACTIVE) };
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE) };
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE_ACTIVE) };
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE) };
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE_ACTIVE) };
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE) };
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE) };
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE) };
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.steam.GT_MetaTileEntity_Furnace_Bronze
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java new file mode 100644 index 0000000000..3bce5fd489 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java @@ -0,0 +1,118 @@ +package gregtech.common.tileentities.machines.steam;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.gui.GT_GUIContainer_BasicMachine;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+
+import java.util.Map;
+
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+
+public class GT_MetaTileEntity_Furnace_Steel
+ extends GT_MetaTileEntity_BasicMachine_Steel
+{
+ public GT_MetaTileEntity_Furnace_Steel(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional, "Smelting things with compressed Steam", 1, 1, true);
+ }
+
+ public GT_MetaTileEntity_Furnace_Steel(String aName, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aDescription, aTextures, 1, 1, true);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelFurnace.png", "smelting");
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_Furnace_Steel(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public int checkRecipe()
+ {
+ if (null != (this.mOutputItems[0] = GT_ModHandler.getSmeltingOutput(getInputAt(0), true, getOutputAt(0))))
+ {
+ this.mEUt = 12;
+ this.mMaxProgresstime = 128;
+ return 2;
+ }
+ return 0;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
+ {
+ if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {return false;}
+ return GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
+ {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(207)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess()
+ {
+ sendLoopStart((byte)1);
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE_ACTIVE) };
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE) };
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE_ACTIVE) };
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE) };
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE_ACTIVE) };
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE) };
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE) };
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE) };
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.steam.GT_MetaTileEntity_Furnace_Steel
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java new file mode 100644 index 0000000000..6a28464ec7 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java @@ -0,0 +1,132 @@ +package gregtech.common.tileentities.machines.steam;
+
+import static gregtech.api.enums.GT_Values.V;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.gui.GT_GUIContainer_BasicMachine;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Bronze;
+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 gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+
+import java.util.Map;
+import java.util.Random;
+
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+import net.minecraftforge.fluids.FluidStack;
+
+public class GT_MetaTileEntity_Macerator_Bronze
+ extends GT_MetaTileEntity_BasicMachine_Bronze
+{
+ public GT_MetaTileEntity_Macerator_Bronze(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional, "Macerating your Ores", 1, 1, false);
+ }
+
+ public GT_MetaTileEntity_Macerator_Bronze(String aName, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aDescription, aTextures, 1, 1, false);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeMacerator.png", "ic2.macerator");
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_Macerator_Bronze(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick)
+ {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive()) && (aBaseMetaTileEntity.getFrontFacing() != 1) && (aBaseMetaTileEntity.getCoverIDAtSide((byte)1) == 0) && (!aBaseMetaTileEntity.getOpacityAtSide((byte)1)))
+ {
+ Random tRandom = aBaseMetaTileEntity.getWorld().rand;
+ aBaseMetaTileEntity.getWorld().spawnParticle("smoke", aBaseMetaTileEntity.getXCoord() + 0.8F - tRandom.nextFloat() * 0.6F, aBaseMetaTileEntity.getYCoord() + 0.9F + tRandom.nextFloat() * 0.2F, aBaseMetaTileEntity.getZCoord() + 0.8F - tRandom.nextFloat() * 0.6F, 0.0D, 0.0D, 0.0D);
+ }
+ }
+
+ public int checkRecipe()
+ {
+ GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes;
+ if (tMap == null) return DID_NOT_FIND_RECIPE;
+ GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[1], null, null, getAllInputs());
+ if (tRecipe == null) return DID_NOT_FIND_RECIPE;
+ if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe;
+ if (!canOutput(tRecipe)) {mOutputBlocked++; return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;}
+ if(tRecipe.getOutput(0)!=null) mOutputItems[0] = tRecipe.getOutput(0);
+ this.mEUt = 2;
+ this.mMaxProgresstime = 800;
+ getInputAt(0).stackSize-=tRecipe.mInputs[0].stackSize;
+ return FOUND_AND_SUCCESSFULLY_USED_RECIPE;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
+ {
+ if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {return false;}
+ return GT_ModHandler.getMaceratorOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
+ {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(201)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess()
+ {
+ sendLoopStart((byte)1);
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE) };
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_MACERATOR) };
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE) };
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR) };
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR_ACTIVE) };
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR) };
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE) };
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_MACERATOR) };
+ }
+}
diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java new file mode 100644 index 0000000000..4f8104ccc7 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java @@ -0,0 +1,137 @@ +package gregtech.common.tileentities.machines.steam;
+
+import static gregtech.api.enums.GT_Values.V;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.gui.GT_GUIContainer_BasicMachine;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel;
+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 gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+
+import java.util.Map;
+import java.util.Random;
+
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+
+public class GT_MetaTileEntity_Macerator_Steel
+ extends GT_MetaTileEntity_BasicMachine_Steel
+{
+ public GT_MetaTileEntity_Macerator_Steel(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional, "Macerating your Ores", 1, 1, false);
+ }
+
+ public GT_MetaTileEntity_Macerator_Steel(String aName, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aDescription, aTextures, 1, 1, false);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelMacerator.png", "ic2.macerator");
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GT_MetaTileEntity_Macerator_Steel(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick)
+ {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive()) && (aBaseMetaTileEntity.getFrontFacing() != 1) && (aBaseMetaTileEntity.getCoverIDAtSide((byte)1) == 0) && (!aBaseMetaTileEntity.getOpacityAtSide((byte)1)))
+ {
+ Random tRandom = aBaseMetaTileEntity.getWorld().rand;
+ aBaseMetaTileEntity.getWorld().spawnParticle("smoke", aBaseMetaTileEntity.getXCoord() + 0.8F - tRandom.nextFloat() * 0.6F, aBaseMetaTileEntity.getYCoord() + 0.9F + tRandom.nextFloat() * 0.2F, aBaseMetaTileEntity.getZCoord() + 0.8F - tRandom.nextFloat() * 0.6F, 0.0D, 0.0D, 0.0D);
+ }
+ }
+
+ public int checkRecipe()
+ {
+ GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes;
+ if (tMap == null) return DID_NOT_FIND_RECIPE;
+ GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[1], null, null, getAllInputs());
+ if (tRecipe == null) return DID_NOT_FIND_RECIPE;
+ if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe;
+ if (!canOutput(tRecipe)) {mOutputBlocked++; return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;}
+ if(tRecipe.getOutput(0)!=null) mOutputItems[0] = tRecipe.getOutput(0);
+ this.mEUt = 6;
+ this.mMaxProgresstime = 400;
+ getInputAt(0).stackSize-=tRecipe.mInputs[0].stackSize;
+ return FOUND_AND_SUCCESSFULLY_USED_RECIPE;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
+ {
+ if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {return false;}
+ return GT_ModHandler.getMaceratorOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
+ {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(201)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess()
+ {
+ sendLoopStart((byte)1);
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE) };
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_MACERATOR) };
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE) };
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR) };
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR_ACTIVE) };
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR) };
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE) };
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor)
+ {
+ return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_MACERATOR) };
+ }
+}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.steam.GT_MetaTileEntity_Macerator_Steel
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file |