From 7224ac4299098c70efae9dbd04c50a97e3f5f583 Mon Sep 17 00:00:00 2001 From: Blood Asp Date: Thu, 23 Apr 2015 18:14:22 +0200 Subject: Initial Commit --- .../basic/GT_MetaTileEntity_Boxinator.java | 109 +++++++++++ .../basic/GT_MetaTileEntity_Disassembler.java | 71 +++++++ .../basic/GT_MetaTileEntity_Massfabricator.java | 83 ++++++++ .../basic/GT_MetaTileEntity_PotionBrewer.java | 165 ++++++++++++++++ .../machines/basic/GT_MetaTileEntity_Printer.java | 71 +++++++ .../basic/GT_MetaTileEntity_Replicator.java | 125 ++++++++++++ .../basic/GT_MetaTileEntity_RockBreaker.java | 88 +++++++++ .../machines/basic/GT_MetaTileEntity_Scanner.java | 211 +++++++++++++++++++++ 8 files changed, 923 insertions(+) create mode 100644 main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java create mode 100644 main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java create mode 100644 main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java create mode 100644 main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java create mode 100644 main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java create mode 100644 main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java create mode 100644 main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java create mode 100644 main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java (limited to 'main/java/gregtech/common/tileentities/machines/basic') diff --git a/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java b/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java new file mode 100644 index 0000000000..8d05b6e5a2 --- /dev/null +++ b/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java @@ -0,0 +1,109 @@ +/* 1: */ package gregtech.common.tileentities.machines.basic; +/* 2: */ +/* 3: */ import gregtech.api.enums.ItemList; +import gregtech.api.enums.Textures; +/* 4: */ import gregtech.api.enums.Textures.BlockIcons; +/* 5: */ import gregtech.api.interfaces.ITexture; +/* 6: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 7: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 8: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +/* 9: */ import gregtech.api.objects.GT_RenderedTexture; +/* 10: */ import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; +/* 11: */ import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +/* 12: */ import gregtech.api.util.GT_Utility; +/* 13: */ import net.minecraft.item.ItemStack; +/* 14: */ +/* 15: */ public class GT_MetaTileEntity_Boxinator +/* 16: */ extends GT_MetaTileEntity_BasicMachine +/* 17: */ { +/* 18: */ public GT_MetaTileEntity_Boxinator(int aID, String aName, String aNameRegional, int aTier) +/* 19: */ { +/* 20:18 */ 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) }); +/* 21: */ } +/* 22: */ +/* 23: */ public GT_MetaTileEntity_Boxinator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) +/* 24: */ { +/* 25:22 */ super(aName, aTier, 1, aDescription, aTextures, 2, 1, aGUIName, aNEIName); +/* 26: */ } +/* 27: */ +/* 28: */ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 29: */ { +/* 30:27 */ return new GT_MetaTileEntity_Boxinator(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); +/* 31: */ } +/* 32: */ +/* 33: */ public GT_Recipe.GT_Recipe_Map getRecipeList() +/* 34: */ { +/* 35:32 */ return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes; +/* 36: */ } +/* 37: */ +/* 38: */ public int checkRecipe() +/* 39: */ { +/* 40:37 */ int tCheck = super.checkRecipe(); +/* 41:38 */ if (tCheck != 0) { +/* 42:38 */ return tCheck; +/* 43: */ } +/* 44:39 */ if ((GT_Utility.isStackValid(getInputAt(0))) && (GT_Utility.isStackValid(getInputAt(1))) && (GT_Utility.getContainerItem(getInputAt(0), true) == null)) +/* 45: */ { +/* 46:40 */ if ((ItemList.Schematic_1by1.isStackEqual(getInputAt(1))) && (getInputAt(0).stackSize >= 1)) +/* 47: */ { +/* 48:41 */ this.mOutputItems[0] = GT_ModHandler.getRecipeOutput(new ItemStack[] { getInputAt(0) }); +/* 49:42 */ if (this.mOutputItems[0] != null) { +/* 50:42 */ if (canOutput(new ItemStack[] { this.mOutputItems[0] })) +/* 51: */ { +/* 52:43 */ getInputAt(0).stackSize -= 1; +/* 53:44 */ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1)); +/* 54:45 */ this.mMaxProgresstime = (16 / (1 << this.mTier - 1)); +/* 55:46 */ return 2; +/* 56: */ } +/* 57: */ } +/* 58:48 */ return 0; +/* 59: */ } +/* 60:50 */ if ((ItemList.Schematic_2by2.isStackEqual(getInputAt(1))) && (getInputAt(0).stackSize >= 4)) +/* 61: */ { +/* 62:51 */ this.mOutputItems[0] = GT_ModHandler.getRecipeOutput(new ItemStack[] { getInputAt(0), getInputAt(0), null, getInputAt(0), getInputAt(0) }); +/* 63:52 */ if (this.mOutputItems[0] != null) { +/* 64:52 */ if (canOutput(new ItemStack[] { this.mOutputItems[0] })) +/* 65: */ { +/* 66:53 */ getInputAt(0).stackSize -= 4; +/* 67:54 */ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1)); +/* 68:55 */ this.mMaxProgresstime = (32 / (1 << this.mTier - 1)); +/* 69:56 */ return 2; +/* 70: */ } +/* 71: */ } +/* 72:58 */ return 0; +/* 73: */ } +/* 74:60 */ if ((ItemList.Schematic_3by3.isStackEqual(getInputAt(1))) && (getInputAt(0).stackSize >= 9)) +/* 75: */ { +/* 76:61 */ 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) }); +/* 77:62 */ if (this.mOutputItems[0] != null) { +/* 78:62 */ if (canOutput(new ItemStack[] { this.mOutputItems[0] })) +/* 79: */ { +/* 80:63 */ getInputAt(0).stackSize -= 9; +/* 81:64 */ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1)); +/* 82:65 */ this.mMaxProgresstime = (64 / (1 << this.mTier - 1)); +/* 83:66 */ return 2; +/* 84: */ } +/* 85: */ } +/* 86:68 */ return 0; +/* 87: */ } +/* 88: */ } +/* 89:71 */ return 0; +/* 90: */ } +/* 91: */ +/* 92: */ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) +/* 93: */ { +/* 94:76 */ if (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) +/* 95: */ { +/* 96:76 */ if (((getInputSlot() == aIndex) || (!ItemList.Crate_Empty.isStackEqual(aStack))) && (!ItemList.Schematic_1by1.isStackEqual(getInputAt(1))) && (!ItemList.Schematic_2by2.isStackEqual(getInputAt(1))) && (!ItemList.Schematic_3by3.isStackEqual(getInputAt(1)))) {} +/* 97:76 */ return 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; +/* 98: */ } +/* 99:77 */ return false; +/* :0: */ } +/* :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_Boxinator + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java b/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java new file mode 100644 index 0000000000..4a123f4639 --- /dev/null +++ b/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java @@ -0,0 +1,71 @@ +/* 1: */ package gregtech.common.tileentities.machines.basic; +/* 2: */ +/* 3: */ import gregtech.api.enums.Textures; +import gregtech.api.enums.Textures.BlockIcons; +/* 4: */ import gregtech.api.interfaces.ITexture; +/* 5: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 6: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 7: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +/* 8: */ import gregtech.api.objects.GT_RenderedTexture; +/* 9: */ import gregtech.api.util.GT_Utility; +/* 10: */ import net.minecraft.item.ItemStack; +/* 11: */ import net.minecraft.nbt.NBTTagCompound; +/* 12: */ +/* 13: */ public class GT_MetaTileEntity_Disassembler +/* 14: */ extends GT_MetaTileEntity_BasicMachine +/* 15: */ { +/* 16: */ public GT_MetaTileEntity_Disassembler(int aID, String aName, String aNameRegional, int aTier) +/* 17: */ { +/* 18:15 */ 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) }); +/* 19: */ } +/* 20: */ +/* 21: */ public GT_MetaTileEntity_Disassembler(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) +/* 22: */ { +/* 23:19 */ super(aName, aTier, 1, aDescription, aTextures, 1, 9, aGUIName, aNEIName); +/* 24: */ } +/* 25: */ +/* 26: */ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 27: */ { +/* 28:24 */ return new GT_MetaTileEntity_Disassembler(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); +/* 29: */ } +/* 30: */ +/* 31: */ public int checkRecipe() +/* 32: */ { +/* 33:29 */ if ((getInputAt(0) != null) && (isOutputEmpty())) +/* 34: */ { +/* 35:30 */ NBTTagCompound tNBT = getInputAt(0).getTagCompound(); +/* 36:31 */ if (tNBT != null) +/* 37: */ { +/* 38:32 */ tNBT = tNBT.getCompoundTag("GT.CraftingComponents"); +/* 39:33 */ if (tNBT != null) +/* 40: */ { +/* 41:34 */ getInputAt(0).stackSize -= 1; +/* 42:35 */ this.mEUt = (16 * (1 << this.mTier - 1) * (1 << this.mTier - 1)); +/* 43:36 */ this.mMaxProgresstime = 160; +/* 44:37 */ for (int i = 0; i < this.mOutputItems.length; i++) { +/* 45:37 */ if (getBaseMetaTileEntity().getRandomNumber(100) < 50 + 10 * this.mTier) +/* 46: */ { +/* 47:38 */ this.mOutputItems[i] = GT_Utility.loadItem(tNBT, "Ingredient." + i); +/* 48:39 */ if (this.mOutputItems[i] != null) { +/* 49:39 */ this.mMaxProgresstime *= 2; +/* 50: */ } +/* 51: */ } +/* 52: */ } +/* 53:41 */ return 2; +/* 54: */ } +/* 55: */ } +/* 56: */ } +/* 57:45 */ return 0; +/* 58: */ } +/* 59: */ +/* 60: */ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) +/* 61: */ { +/* 62:50 */ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (aStack.getTagCompound() != null) && (aStack.getTagCompound().getCompoundTag("GT.CraftingComponents") != null); +/* 63: */ } +/* 64: */ } + + +/* 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/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java b/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java new file mode 100644 index 0000000000..2a26825db4 --- /dev/null +++ b/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java @@ -0,0 +1,83 @@ +/* 1: */ package gregtech.common.tileentities.machines.basic; +/* 2: */ +/* 3: */ import gregtech.api.enums.ConfigCategories; +/* 4: */ import gregtech.api.enums.ItemList; +/* 5: */ import gregtech.api.enums.Materials; +import gregtech.api.enums.Textures; +/* 6: */ import gregtech.api.enums.Textures.BlockIcons; +/* 7: */ import gregtech.api.interfaces.ITexture; +/* 8: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 9: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 10: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +/* 11: */ import gregtech.api.objects.GT_RenderedTexture; +/* 12: */ import gregtech.api.util.GT_Config; +/* 13: */ import net.minecraftforge.fluids.FluidStack; +/* 14: */ +/* 15: */ public class GT_MetaTileEntity_Massfabricator +/* 16: */ extends GT_MetaTileEntity_BasicMachine +/* 17: */ { +/* 18:17 */ public static int sUUAperUUM = 1; +/* 19:17 */ public static int sUUASpeedBonus = 4; +/* 20:17 */ public static int sDurationMultiplier = 3215; +/* 21:18 */ public static boolean sRequiresUUA = false; +/* 22: */ +/* 23: */ public GT_MetaTileEntity_Massfabricator(int aID, String aName, String aNameRegional, int aTier) +/* 24: */ { +/* 25:21 */ 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) }); +/* 26: */ } +/* 27: */ +/* 28: */ public GT_MetaTileEntity_Massfabricator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) +/* 29: */ { +/* 30:25 */ super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); +/* 31: */ } +/* 32: */ +/* 33: */ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 34: */ { +/* 35:30 */ return new GT_MetaTileEntity_Massfabricator(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); +/* 36: */ } +/* 37: */ +/* 38: */ public void onConfigLoad(GT_Config aConfig) +/* 39: */ { +/* 40:35 */ super.onConfigLoad(aConfig); +/* 41:36 */ sDurationMultiplier = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUM_Duration_Multiplier", sDurationMultiplier); +/* 42:37 */ sUUAperUUM = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_per_UUM", sUUAperUUM); +/* 43:38 */ sUUASpeedBonus = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Speed_Bonus", sUUASpeedBonus); +/* 44:39 */ sRequiresUUA = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Requirement", sRequiresUUA); +/* 45:40 */ Materials.UUAmplifier.mChemicalFormula = ("Mass Fabricator Eff/Speed Bonus: x" + sUUASpeedBonus); +/* 46: */ } +/* 47: */ +/* 48: */ public int checkRecipe() +/* 49: */ { +/* 50:45 */ FluidStack tFluid = getDrainableStack(); +/* 51:46 */ if ((tFluid == null) || (tFluid.amount < getCapacity())) +/* 52: */ { +/* 53:47 */ this.mOutputFluid = Materials.UUMatter.getFluid(1L); +/* 54:48 */ this.mEUt = ((int)gregtech.api.enums.GT_Values.V[this.mTier]); +/* 55:49 */ this.mMaxProgresstime = (sDurationMultiplier / (1 << this.mTier - 1)); +/* 56:51 */ if (((tFluid = getFillableStack()) != null) && (tFluid.amount >= sUUAperUUM) && (tFluid.isFluidEqual(Materials.UUAmplifier.getFluid(1L)))) +/* 57: */ { +/* 58:52 */ tFluid.amount -= sUUAperUUM; +/* 59:53 */ this.mMaxProgresstime /= sUUASpeedBonus; +/* 60:54 */ return 2; +/* 61: */ } +/* 62:56 */ return (sRequiresUUA) || (ItemList.Circuit_Integrated.isStackEqual(getInputAt(0), true, true)) ? 1 : 2; +/* 63: */ } +/* 64:58 */ return 0; +/* 65: */ } +/* 66: */ +/* 67: */ public boolean isFluidInputAllowed(FluidStack aFluid) +/* 68: */ { +/* 69:63 */ return aFluid.isFluidEqual(Materials.UUAmplifier.getFluid(1L)); +/* 70: */ } +/* 71: */ +/* 72: */ public int getCapacity() +/* 73: */ { +/* 74:68 */ return Math.max(sUUAperUUM, 1000); +/* 75: */ } +/* 76: */ } + + +/* 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/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java b/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java new file mode 100644 index 0000000000..7bfacc6b06 --- /dev/null +++ b/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java @@ -0,0 +1,165 @@ +/* 1: */ package gregtech.common.tileentities.machines.basic; +/* 2: */ +/* 3: */ import gregtech.api.enums.Materials; +/* 4: */ import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +/* 5: */ import gregtech.api.enums.Textures.BlockIcons; +/* 6: */ import gregtech.api.interfaces.ITexture; +/* 7: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 8: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 9: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +/* 10: */ import gregtech.api.objects.GT_RenderedTexture; +/* 11: */ import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +/* 12: */ import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +/* 13: */ import gregtech.api.util.GT_Utility; +/* 14: */ import net.minecraft.init.Items; +/* 15: */ import net.minecraft.item.ItemStack; +/* 16: */ import net.minecraftforge.fluids.Fluid; +/* 17: */ import net.minecraftforge.fluids.FluidRegistry; +/* 18: */ import net.minecraftforge.fluids.FluidStack; +/* 19: */ +/* 20: */ public class GT_MetaTileEntity_PotionBrewer +/* 21: */ extends GT_MetaTileEntity_BasicMachine +/* 22: */ { +/* 23: */ public GT_MetaTileEntity_PotionBrewer(int aID, String aName, String aNameRegional, int aTier) +/* 24: */ { +/* 25: 21 */ 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) }); +/* 26: */ } +/* 27: */ +/* 28: */ public GT_MetaTileEntity_PotionBrewer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) +/* 29: */ { +/* 30: 25 */ super(aName, aTier, 1, aDescription, aTextures, 1, 0, aGUIName, aNEIName); +/* 31: */ } +/* 32: */ +/* 33: */ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 34: */ { +/* 35: 30 */ return new GT_MetaTileEntity_PotionBrewer(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); +/* 36: */ } +/* 37: */ +/* 38: */ public GT_Recipe.GT_Recipe_Map getRecipeList() +/* 39: */ { +/* 40: 35 */ return GT_Recipe.GT_Recipe_Map.sBrewingRecipes; +/* 41: */ } +/* 42: */ +/* 43: */ public int checkRecipe() +/* 44: */ { +/* 45: 40 */ int tCheck = super.checkRecipe(); +/* 46: 41 */ if (tCheck != 0) { +/* 47: 41 */ return tCheck; +/* 48: */ } +/* 49: 43 */ FluidStack aFluid = getFillableStack(); +/* 50: 44 */ if ((getDrainableStack() == null) && (aFluid != null) && (getInputAt(0) != null)) +/* 51: */ { +/* 52: 45 */ String tInputName = aFluid.getFluid().getName(); +/* 53: 46 */ if (tInputName.startsWith("potion.")) +/* 54: */ { +/* 55: 47 */ tInputName = tInputName.replaceFirst("potion.", ""); +/* 56: 48 */ int tFirstDot = tInputName.indexOf('.') + 1; +/* 57: 49 */ String tModifier = tFirstDot <= 0 ? "" : tInputName.substring(tFirstDot); +/* 58: 50 */ if (!tModifier.isEmpty()) { +/* 59: 50 */ tInputName = tInputName.replaceFirst("." + tModifier, ""); +/* 60: */ } +/* 61: 52 */ if (GT_Utility.areStacksEqual(new ItemStack(Items.fermented_spider_eye, 1, 0), getInputAt(0))) +/* 62: */ { +/* 63: 53 */ if (tInputName.equals("poison")) { +/* 64: 53 */ return setOutput("potion.damage" + tModifier); +/* 65: */ } +/* 66: 54 */ if (tInputName.equals("health")) { +/* 67: 54 */ return setOutput("potion.damage" + tModifier); +/* 68: */ } +/* 69: 55 */ if (tInputName.equals("waterbreathing")) { +/* 70: 55 */ return setOutput("potion.damage" + tModifier); +/* 71: */ } +/* 72: 56 */ if (tInputName.equals("nightvision")) { +/* 73: 56 */ return setOutput("potion.invisibility" + tModifier); +/* 74: */ } +/* 75: 57 */ if (tInputName.equals("fireresistance")) { +/* 76: 57 */ return setOutput("potion.slowness" + tModifier); +/* 77: */ } +/* 78: 58 */ if (tInputName.equals("speed")) { +/* 79: 58 */ return setOutput("potion.slowness" + tModifier); +/* 80: */ } +/* 81: 59 */ if (tInputName.equals("strength")) { +/* 82: 59 */ return setOutput("potion.weakness" + tModifier); +/* 83: */ } +/* 84: 60 */ if (tInputName.equals("regen")) { +/* 85: 60 */ return setOutput("potion.poison" + tModifier); +/* 86: */ } +/* 87: 61 */ return setOutput("potion.weakness"); +/* 88: */ } +/* 89: 63 */ if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glowstone, 1L), getInputAt(0))) +/* 90: */ { +/* 91: 64 */ if (!tModifier.startsWith("strong")) { +/* 92: 64 */ return setOutput("potion." + tInputName + ".strong" + (tModifier.isEmpty() ? "" : new StringBuilder().append(".").append(tModifier).toString())); +/* 93: */ } +/* 94: 65 */ if (tModifier.startsWith("long")) { +/* 95: 65 */ return setOutput("potion." + tInputName + tModifier.replaceFirst("long", "")); +/* 96: */ } +/* 97: 66 */ return setOutput("potion.thick"); +/* 98: */ } +/* 99: 68 */ if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L), getInputAt(0))) +/* 100: */ { +/* 101: 69 */ if (!tModifier.startsWith("long")) { +/* 102: 69 */ return setOutput("potion." + tInputName + ".long" + (tModifier.isEmpty() ? "" : new StringBuilder().append(".").append(tModifier).toString())); +/* 103: */ } +/* 104: 70 */ if (tModifier.startsWith("strong")) { +/* 105: 70 */ return setOutput("potion." + tInputName + tModifier.replaceFirst("strong", "")); +/* 106: */ } +/* 107: 71 */ return setOutput("potion.mundane"); +/* 108: */ } +/* 109: 73 */ if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Gunpowder, 1L), getInputAt(0))) +/* 110: */ { +/* 111: 74 */ if (!tInputName.endsWith(".splash")) { +/* 112: 74 */ return setOutput("potion." + tInputName + ".splash"); +/* 113: */ } +/* 114: 75 */ return setOutput("potion.mundane"); +/* 115: */ } +/* 116: */ } +/* 117: */ } +/* 118: 79 */ return 0; +/* 119: */ } +/* 120: */ +/* 121: */ private final int setOutput(String aFluidName) +/* 122: */ { +/* 123: 83 */ this.mOutputFluid = FluidRegistry.getFluidStack(aFluidName, 750); +/* 124: 84 */ if (this.mOutputFluid == null) +/* 125: */ { +/* 126: 85 */ this.mOutputFluid = FluidRegistry.getFluidStack("potion.mundane", getFillableStack().amount); +/* 127: 86 */ getInputAt(0).stackSize -= 1; +/* 128: 87 */ getFillableStack().amount = 0; +/* 129: 88 */ this.mEUt = (4 * (1 << this.mTier - 1) * (1 << this.mTier - 1)); +/* 130: 89 */ this.mMaxProgresstime = (128 / (1 << this.mTier - 1)); +/* 131: 90 */ return 2; +/* 132: */ } +/* 133: 92 */ if (getFillableStack().amount < 750) { +/* 134: 92 */ return 0; +/* 135: */ } +/* 136: 93 */ getInputAt(0).stackSize -= 1; +/* 137: 94 */ getFillableStack().amount -= 750; +/* 138: 95 */ this.mEUt = (4 * (1 << this.mTier - 1) * (1 << this.mTier - 1)); +/* 139: 96 */ this.mMaxProgresstime = (128 / (1 << this.mTier - 1)); +/* 140: 97 */ return 2; +/* 141: */ } +/* 142: */ +/* 143: */ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) +/* 144: */ { +/* 145:102 */ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack)); +/* 146: */ } +/* 147: */ +/* 148: */ public boolean isFluidInputAllowed(FluidStack aFluid) +/* 149: */ { +/* 150:107 */ return (aFluid.getFluid().getName().startsWith("potion.")) || (super.isFluidInputAllowed(aFluid)); +/* 151: */ } +/* 152: */ +/* 153: */ public int getCapacity() +/* 154: */ { +/* 155:112 */ return 750; +/* 156: */ } +/* 157: */ } + + +/* 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/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java b/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java new file mode 100644 index 0000000000..8cd02d4c3d --- /dev/null +++ b/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java @@ -0,0 +1,71 @@ +/* 1: */ package gregtech.common.tileentities.machines.basic; +/* 2: */ +/* 3: */ import gregtech.api.enums.OrePrefixes; +/* 4: */ import gregtech.api.interfaces.ITexture; +/* 5: */ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +/* 6: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 7: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +/* 8: */ import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +/* 9: */ import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +/* 10: */ import gregtech.api.util.GT_Utility; + +/* 11: */ import java.util.ArrayList; + +/* 12: */ import net.minecraft.item.ItemStack; +/* 13: */ +/* 14: */ public class GT_MetaTileEntity_Printer +/* 15: */ extends GT_MetaTileEntity_BasicMachine +/* 16: */ { +/* 17: */ public GT_MetaTileEntity_Printer(int aID, String aName, String aNameRegional, int aTier) +/* 18: */ { +/* 19:19 */ 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]); +/* 20: */ } +/* 21: */ +/* 22: */ public GT_MetaTileEntity_Printer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) +/* 23: */ { +/* 24:23 */ super(aName, aTier, 1, aDescription, aTextures, 2, 2, aGUIName, aNEIName); +/* 25: */ } +/* 26: */ +/* 27: */ public int checkRecipe() +/* 28: */ { +/* 29:28 */ if (getOutputAt(0) != null) +/* 30: */ { +/* 31:29 */ this.mOutputBlocked += 1; +/* 32: */ } +/* 33:30 */ else if ((GT_Utility.isStackValid(getInputAt(0))) && (getInputAt(0).stackSize > 0) && +/* 34:31 */ (GT_Utility.isStackInvalid(getSpecialSlot())) && +/* 35:32 */ (OrePrefixes.block.contains(getInputAt(0)))) +/* 36: */ { +/* 37:33 */ ArrayList tList = GT_OreDictUnificator.getOres(GT_OreDictUnificator.getAssociation(getInputAt(0))); +/* 38:34 */ if (tList.size() > 1) +/* 39: */ { +/* 40:35 */ tList.add(tList.get(0)); +/* 41:36 */ int i = 0; +/* 42:36 */ for (int j = tList.size() - 1; i < j; i++) { +/* 43:37 */ if (GT_Utility.areStacksEqual(getInputAt(0), (ItemStack)tList.get(i))) +/* 44: */ { +/* 45:38 */ this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[] { tList.get(i + 1) }); +/* 46:39 */ this.mEUt = (1 * (1 << this.mTier - 1) * (1 << this.mTier - 1)); +/* 47:40 */ this.mMaxProgresstime = (32 / (1 << this.mTier - 1)); +/* 48:41 */ getInputAt(0).stackSize -= 1; +/* 49:42 */ return 2; +/* 50: */ } +/* 51: */ } +/* 52: */ } +/* 53: */ } +/* 54:49 */ this.mMaxProgresstime = 0; +/* 55:50 */ return 0; +/* 56: */ } +/* 57: */ +/* 58: */ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 59: */ { +/* 60:56 */ return null; +/* 61: */ } +/* 62: */ } + + +/* 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/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java b/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java new file mode 100644 index 0000000000..c2020ca7fa --- /dev/null +++ b/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java @@ -0,0 +1,125 @@ +/* 1: */ package gregtech.common.tileentities.machines.basic; +/* 2: */ +/* 3: */ import gregtech.api.GregTech_API; +/* 4: */ import gregtech.api.enums.Element; +/* 5: */ import gregtech.api.enums.ItemList; +/* 6: */ import gregtech.api.enums.Materials; +/* 7: */ import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +/* 8: */ import gregtech.api.enums.Textures.BlockIcons; +/* 9: */ import gregtech.api.interfaces.ITexture; +/* 10: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 11: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 12: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +/* 13: */ import gregtech.api.objects.GT_RenderedTexture; +/* 14: */ import gregtech.api.util.GT_OreDictUnificator; +/* 15: */ import gregtech.api.util.GT_Utility; +/* 16: */ import gregtech.common.items.behaviors.Behaviour_DataOrb; + +/* 17: */ import java.util.ArrayList; +/* 18: */ import java.util.Collection; +/* 19: */ import java.util.Iterator; + +/* 20: */ import net.minecraft.item.ItemStack; +/* 21: */ import net.minecraftforge.fluids.FluidStack; +/* 22: */ +/* 23: */ public class GT_MetaTileEntity_Replicator +/* 24: */ extends GT_MetaTileEntity_BasicMachine +/* 25: */ { +/* 26:18 */ private static int sHeaviestElementMass = 0; +/* 27: */ +/* 28: */ public GT_MetaTileEntity_Replicator(int aID, String aName, String aNameRegional, int aTier) +/* 29: */ { +/* 30:21 */ 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) }); +/* 31: */ } +/* 32: */ +/* 33: */ public GT_MetaTileEntity_Replicator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) +/* 34: */ { +/* 35:25 */ super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); +/* 36: */ } +/* 37: */ +/* 38: */ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 39: */ { +/* 40:30 */ return new GT_MetaTileEntity_Replicator(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); +/* 41: */ } +/* 42: */ +/* 43: */ public int checkRecipe() +/* 44: */ { +/* 45:35 */ FluidStack tFluid = getFillableStack(); +/* 46:36 */ if ((tFluid != null) && (tFluid.isFluidEqual(Materials.UUMatter.getFluid(1L)))) +/* 47: */ { +/* 48:37 */ ItemStack tDataOrb = getSpecialSlot(); +/* 49:38 */ if ((ItemList.Tool_DataOrb.isStackEqual(tDataOrb, false, true)) && (Behaviour_DataOrb.getDataTitle(tDataOrb).equals("Elemental-Scan"))) +/* 50: */ { +/* 51:39 */ Materials tMaterial = (Materials)Element.get(Behaviour_DataOrb.getDataName(tDataOrb)).mLinkedMaterials.get(0); +/* 52:40 */ long tMass = tMaterial.getMass(); +/* 53:41 */ if ((tFluid.amount >= tMass) && (tMass > 0L)) +/* 54: */ { +/* 55:42 */ this.mEUt = ((int)gregtech.api.enums.GT_Values.V[this.mTier]); +/* 56:43 */ this.mMaxProgresstime = ((int)(tMass * 512L / (1 << this.mTier - 1))); +/* 57:44 */ if ((this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.dust, tMaterial, 1L)) == null) +/* 58: */ { +/* 59:45 */ if ((this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.cell, tMaterial, 1L)) != null) { +/* 60:46 */ if ((this.mOutputFluid = GT_Utility.getFluidForFilledItem(this.mOutputItems[0], true)) == null) +/* 61: */ { +/* 62:47 */ if (ItemList.Cell_Empty.isStackEqual(getInputAt(0))) { +/* 63:48 */ if (canOutput(new ItemStack[] { this.mOutputItems[0] })) +/* 64: */ { +/* 65:49 */ getInputAt(0).stackSize -= 1; FluidStack +/* 66:50 */ tmp231_230 = tFluid;tmp231_230.amount = ((int)(tmp231_230.amount - tMass)); +/* 67:51 */ return 2; +/* 68: */ } +/* 69: */ } +/* 70: */ } +/* 71: */ else +/* 72: */ { +/* 73:55 */ this.mOutputItems[0] = null; +/* 74:56 */ if ((getDrainableStack() == null) || ((getDrainableStack().isFluidEqual(this.mOutputFluid)) && (getDrainableStack().amount < 16000))) +/* 75: */ { +/* 76:57 */ FluidStack tmp287_286 = tFluid;tmp287_286.amount = ((int)(tmp287_286.amount - tMass)); +/* 77:58 */ return 2; +/* 78: */ } +/* 79: */ } +/* 80: */ } +/* 81: */ } +/* 82:62 */ else if (canOutput(new ItemStack[] { this.mOutputItems[0] })) +/* 83: */ { +/* 84:63 */ FluidStack tmp322_321 = tFluid;tmp322_321.amount = ((int)(tmp322_321.amount - tMass)); +/* 85:64 */ return 2; +/* 86: */ } +/* 87: */ } +/* 88: */ } +/* 89: */ } +/* 90:69 */ return 0; +/* 91: */ } +/* 92: */ +/* 93: */ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) +/* 94: */ { +/* 95:74 */ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (ItemList.Cell_Empty.isStackEqual(aStack)); +/* 96: */ } +/* 97: */ +/* 98: */ public boolean isFluidInputAllowed(FluidStack aFluid) +/* 99: */ { +/* :0:79 */ return aFluid.isFluidEqual(Materials.UUMatter.getFluid(1L)); +/* :1: */ } +/* :2: */ +/* :3: */ public int getCapacity() +/* :4: */ { +/* :5:84 */ if ((sHeaviestElementMass == 0) && (GregTech_API.sPostloadFinished)) +/* :6: */ { +/* :7: */ Materials tMaterial; +/* :8:84 */ for (Iterator i$ = Materials.VALUES.iterator(); i$.hasNext(); sHeaviestElementMass = Math.max(sHeaviestElementMass, (int)tMaterial.getMass())) +/* :9: */ { +/* ;0:84 */ tMaterial = (Materials)i$.next(); +/* ;1:84 */ if ((tMaterial.mElement == null) || (tMaterial.mElement.mIsIsotope)) {} +/* ;2: */ } +/* ;3: */ } +/* ;4:85 */ return sHeaviestElementMass; +/* ;5: */ } +/* ;6: */ } + + +/* 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/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java b/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java new file mode 100644 index 0000000000..6bcc5b5074 --- /dev/null +++ b/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java @@ -0,0 +1,88 @@ +/* 1: */ package gregtech.common.tileentities.machines.basic; +/* 2: */ +/* 3: */ import gregtech.api.enums.Materials; +/* 4: */ import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +/* 5: */ import gregtech.api.enums.Textures.BlockIcons; +/* 6: */ import gregtech.api.interfaces.ITexture; +/* 7: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 8: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 9: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +/* 10: */ import gregtech.api.objects.GT_RenderedTexture; +/* 11: */ import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +/* 12: */ import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +/* 13: */ import gregtech.api.util.GT_Utility; +/* 14: */ import net.minecraft.init.Blocks; +/* 15: */ import net.minecraft.item.ItemStack; +/* 16: */ +/* 17: */ public class GT_MetaTileEntity_RockBreaker +/* 18: */ extends GT_MetaTileEntity_BasicMachine +/* 19: */ { +/* 20: */ public GT_MetaTileEntity_RockBreaker(int aID, String aName, String aNameRegional, int aTier) +/* 21: */ { +/* 22:19 */ 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) }); +/* 23: */ } +/* 24: */ +/* 25: */ public GT_MetaTileEntity_RockBreaker(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) +/* 26: */ { +/* 27:23 */ super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); +/* 28: */ } +/* 29: */ +/* 30: */ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 31: */ { +/* 32:28 */ return new GT_MetaTileEntity_RockBreaker(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); +/* 33: */ } +/* 34: */ +/* 35: */ public GT_Recipe.GT_Recipe_Map getRecipeList() +/* 36: */ { +/* 37:33 */ return GT_Recipe.GT_Recipe_Map.sRockBreakerFakeRecipes; +/* 38: */ } +/* 39: */ +/* 40: */ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) +/* 41: */ { +/* 42:38 */ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack)); +/* 43: */ } +/* 44: */ +/* 45: */ public int checkRecipe() +/* 46: */ { +/* 47:43 */ IGregTechTileEntity aBaseMetaTileEntity = getBaseMetaTileEntity(); +/* 48:44 */ 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)) +/* 49: */ { +/* 50:45 */ ItemStack tOutput = null; +/* 51:46 */ if (aBaseMetaTileEntity.getBlockOffset(0, 1, 0) == Blocks.lava) { +/* 52:47 */ tOutput = new ItemStack(Blocks.stone, 1); +/* 53:49 */ } 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)) { +/* 54:50 */ tOutput = new ItemStack(Blocks.cobblestone, 1); +/* 55: */ } +/* 56:52 */ if (tOutput != null) { +/* 57:53 */ if (GT_Utility.areStacksEqual(getInputAt(0), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L))) +/* 58: */ { +/* 59:54 */ tOutput = new ItemStack(Blocks.obsidian, 1); +/* 60:55 */ if (canOutput(new ItemStack[] { tOutput })) +/* 61: */ { +/* 62:56 */ getInputAt(0).stackSize -= 1; +/* 63:57 */ this.mOutputItems[0] = tOutput; +/* 64:58 */ this.mMaxProgresstime = (128 / (1 << this.mTier - 1)); +/* 65:59 */ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1)); +/* 66:60 */ return 2; +/* 67: */ } +/* 68: */ } +/* 69:63 */ else if (canOutput(new ItemStack[] { tOutput })) +/* 70: */ { +/* 71:64 */ this.mOutputItems[0] = tOutput; +/* 72:65 */ this.mMaxProgresstime = (16 / (1 << this.mTier - 1)); +/* 73:66 */ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1)); +/* 74:67 */ return 2; +/* 75: */ } +/* 76: */ } +/* 77: */ } +/* 78:72 */ return 0; +/* 79: */ } +/* 80: */ } + + +/* 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/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java b/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java new file mode 100644 index 0000000000..9c27b3f34a --- /dev/null +++ b/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java @@ -0,0 +1,211 @@ +/* 1: */ package gregtech.common.tileentities.machines.basic; +/* 2: */ +/* 3: */ import forestry.api.genetics.AlleleManager; +/* 4: */ import forestry.api.genetics.IAlleleRegistry; +/* 5: */ import forestry.api.genetics.IIndividual; +/* 6: */ import gregtech.api.GregTech_API; +/* 7: */ import gregtech.api.enums.Element; +/* 8: */ import gregtech.api.enums.GT_Values; +/* 9: */ import gregtech.api.enums.ItemList; +/* 10: */ import gregtech.api.enums.Materials; +/* 11: */ import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +/* 12: */ import gregtech.api.enums.Textures.BlockIcons; +/* 13: */ import gregtech.api.interfaces.ITexture; +/* 14: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 15: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 16: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +/* 17: */ import gregtech.api.objects.GT_RenderedTexture; +/* 18: */ import gregtech.api.objects.ItemData; +/* 19: */ import gregtech.api.objects.MaterialStack; +/* 20: */ import gregtech.api.util.GT_Log; +/* 21: */ import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +/* 22: */ import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +/* 23: */ import gregtech.api.util.GT_Utility; +/* 24: */ import gregtech.common.items.behaviors.Behaviour_DataOrb; + +/* 25: */ import java.util.Map; + +/* 26: */ import net.minecraft.init.Items; +/* 27: */ import net.minecraft.item.ItemStack; +/* 28: */ import net.minecraft.nbt.NBTTagCompound; +/* 29: */ import net.minecraftforge.fluids.FluidStack; +/* 30: */ +/* 31: */ public class GT_MetaTileEntity_Scanner +/* 32: */ extends GT_MetaTileEntity_BasicMachine +/* 33: */ { +/* 34: */ public GT_MetaTileEntity_Scanner(int aID, String aName, String aNameRegional, int aTier) +/* 35: */ { +/* 36: 29 */ 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) }); +/* 37: */ } +/* 38: */ +/* 39: */ public GT_MetaTileEntity_Scanner(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) +/* 40: */ { +/* 41: 33 */ super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); +/* 42: */ } +/* 43: */ +/* 44: */ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 45: */ { +/* 46: 38 */ return new GT_MetaTileEntity_Scanner(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); +/* 47: */ } +/* 48: */ +/* 49: */ public int checkRecipe() +/* 50: */ { +/* 51: 43 */ ItemStack aStack = getInputAt(0); +/* 52: 44 */ if (getOutputAt(0) != null) +/* 53: */ { +/* 54: 45 */ this.mOutputBlocked += 1; +/* 55: */ } +/* 56: 46 */ else if ((GT_Utility.isStackValid(aStack)) && (aStack.stackSize > 0)) +/* 57: */ { +/* 58: 47 */ if ((getFillableStack() != null) && (getFillableStack().containsFluid(Materials.Honey.getFluid(100L)))) { +/* 59: */ try +/* 60: */ { +/* 61: 49 */ Object tIndividual = AlleleManager.alleleRegistry.getIndividual(aStack); +/* 62: 50 */ if (tIndividual != null) +/* 63: */ { +/* 64: 51 */ if (((IIndividual)tIndividual).analyze()) +/* 65: */ { +/* 66: 52 */ getFillableStack().amount -= 100; +/* 67: 53 */ this.mOutputItems[0] = GT_Utility.copy(new Object[] { aStack }); +/* 68: 54 */ aStack.stackSize = 0; +/* 69: 55 */ NBTTagCompound tNBT = new NBTTagCompound(); +/* 70: 56 */ ((IIndividual)tIndividual).writeToNBT(tNBT); +/* 71: 57 */ this.mOutputItems[0].setTagCompound(tNBT); +/* 72: 58 */ this.mMaxProgresstime = (500 / (1 << this.mTier - 1)); +/* 73: 59 */ this.mEUt = (2 * (1 << this.mTier - 1) * (1 << this.mTier - 1)); +/* 74: 60 */ return 2; +/* 75: */ } +/* 76: 62 */ this.mOutputItems[0] = GT_Utility.copy(new Object[] { aStack }); +/* 77: 63 */ aStack.stackSize = 0; +/* 78: 64 */ this.mMaxProgresstime = 1; +/* 79: 65 */ this.mEUt = 1; +/* 80: 66 */ return 2; +/* 81: */ } +/* 82: */ } +/* 83: */ catch (Throwable e) +/* 84: */ { +/* 85: 69 */ if (GT_Values.D1) { +/* 86: 69 */ e.printStackTrace(GT_Log.err); +/* 87: */ } +/* 88: */ } +/* 89: */ } +/* 90: 72 */ if (ItemList.IC2_Crop_Seeds.isStackEqual(aStack, true, true)) +/* 91: */ { +/* 92: 73 */ NBTTagCompound tNBT = aStack.getTagCompound(); +/* 93: 74 */ if (tNBT == null) { +/* 94: 74 */ tNBT = new NBTTagCompound(); +/* 95: */ } +/* 96: 75 */ if (tNBT.getByte("scan") < 4) +/* 97: */ { +/* 98: 76 */ tNBT.setByte("scan", (byte)4); +/* 99: 77 */ this.mMaxProgresstime = (160 / (1 << this.mTier - 1)); +/* 100: 78 */ this.mEUt = (8 * (1 << this.mTier - 1) * (1 << this.mTier - 1)); +/* 101: */ } +/* 102: */ else +/* 103: */ { +/* 104: 80 */ this.mMaxProgresstime = 1; +/* 105: 81 */ this.mEUt = 1; +/* 106: */ } +/* 107: 83 */ aStack.stackSize -= 1; +/* 108: 84 */ this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[] { aStack }); +/* 109: 85 */ this.mOutputItems[0].setTagCompound(tNBT); +/* 110: 86 */ return 2; +/* 111: */ } +/* 112: 88 */ if (ItemList.Tool_DataOrb.isStackEqual(getSpecialSlot(), false, true)) +/* 113: */ { +/* 114: 89 */ if (ItemList.Tool_DataOrb.isStackEqual(aStack, false, true)) +/* 115: */ { +/* 116: 90 */ aStack.stackSize -= 1; +/* 117: 91 */ this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[] { getSpecialSlot() }); +/* 118: 92 */ this.mMaxProgresstime = (512 / (1 << this.mTier - 1)); +/* 119: 93 */ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1)); +/* 120: 94 */ return 2; +/* 121: */ } +/* 122: 96 */ ItemData tData = GT_OreDictUnificator.getAssociation(aStack); +/* 123: 97 */ 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)) +/* 124: */ { +/* 125: 98 */ getSpecialSlot().stackSize -= 1; +/* 126: 99 */ aStack.stackSize -= 1; +/* 127: */ +/* 128:101 */ this.mOutputItems[0] = ItemList.Tool_DataOrb.get(1L, new Object[0]); +/* 129:102 */ Behaviour_DataOrb.setDataTitle(this.mOutputItems[0], "Elemental-Scan"); +/* 130:103 */ Behaviour_DataOrb.setDataName(this.mOutputItems[0], tData.mMaterial.mMaterial.mElement.name()); +/* 131: */ +/* 132:105 */ this.mMaxProgresstime = ((int)(tData.mMaterial.mMaterial.getMass() * 8192L / (1 << this.mTier - 1))); +/* 133:106 */ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1)); +/* 134:107 */ return 2; +/* 135: */ } +/* 136: */ } +/* 137:110 */ if (ItemList.Tool_DataStick.isStackEqual(getSpecialSlot(), false, true)) +/* 138: */ { +/* 139:111 */ if (ItemList.Tool_DataStick.isStackEqual(aStack, false, true)) +/* 140: */ { +/* 141:112 */ aStack.stackSize -= 1; +/* 142:113 */ this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[] { getSpecialSlot() }); +/* 143:114 */ this.mMaxProgresstime = (128 / (1 << this.mTier - 1)); +/* 144:115 */ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1)); +/* 145:116 */ return 2; +/* 146: */ } +/* 147:118 */ if (aStack.getItem() == Items.written_book) +/* 148: */ { +/* 149:119 */ getSpecialSlot().stackSize -= 1; +/* 150:120 */ aStack.stackSize -= 1; +/* 151: */ +/* 152:122 */ this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[] { getSpecialSlot() }); +/* 153:123 */ this.mOutputItems[0].setTagCompound(aStack.getTagCompound()); +/* 154:124 */ this.mMaxProgresstime = (128 / (1 << this.mTier - 1)); +/* 155:125 */ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1)); +/* 156:126 */ return 2; +/* 157: */ } +/* 158:128 */ if (aStack.getItem() == Items.filled_map) +/* 159: */ { +/* 160:129 */ getSpecialSlot().stackSize -= 1; +/* 161:130 */ aStack.stackSize -= 1; +/* 162: */ +/* 163:132 */ this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[] { getSpecialSlot() }); +/* 164:133 */ this.mOutputItems[0].setTagCompound(GT_Utility.getNBTContainingShort(new NBTTagCompound(), "map_id", (short)aStack.getItemDamage())); +/* 165:134 */ this.mMaxProgresstime = (128 / (1 << this.mTier - 1)); +/* 166:135 */ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1)); +/* 167:136 */ return 2; +/* 168: */ } +/* 169: */ } +/* 170: */ } +/* 171:140 */ return 0; +/* 172: */ } +/* 173: */ +/* 174: */ public GT_Recipe.GT_Recipe_Map getRecipeList() +/* 175: */ { +/* 176:145 */ return GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes; +/* 177: */ } +/* 178: */ +/* 179: */ public int getCapacity() +/* 180: */ { +/* 181:150 */ return 1000; +/* 182: */ } +/* 183: */ +/* 184: */ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) +/* 185: */ { +/* 186:155 */ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack)); +/* 187: */ } +/* 188: */ +/* 189: */ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) +/* 190: */ { +/* 191:160 */ super.startSoundLoop(aIndex, aX, aY, aZ); +/* 192:161 */ if (aIndex == 1) { +/* 193:161 */ GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(212)), 10, 1.0F, aX, aY, aZ); +/* 194: */ } +/* 195: */ } +/* 196: */ +/* 197: */ public void startProcess() +/* 198: */ { +/* 199:166 */ sendLoopStart((byte)1); +/* 200: */ } +/* 201: */ } + + +/* 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 -- cgit