diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-01-10 16:16:47 +0000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-01-10 16:16:47 +0000 |
commit | 5290f9e58b8260f30a1578d02a4b5e70f94e9204 (patch) | |
tree | c531fc3c6f5b32f4bb657e6ef61e55233a23a05b /src | |
parent | b5cd08ed95eeeb11611ca065c63c3fba574790fe (diff) | |
download | GT5-Unofficial-5290f9e58b8260f30a1578d02a4b5e70f94e9204.tar.gz GT5-Unofficial-5290f9e58b8260f30a1578d02a4b5e70f94e9204.tar.bz2 GT5-Unofficial-5290f9e58b8260f30a1578d02a4b5e70f94e9204.zip |
+ Added some new Textures, also found some that existed but never got loaded.
% Adjusted Casings required for the Matter Fabricator.
$ Fixed Large Assembler not requiring power.
$ Fixed the Matter Fabricator, it's now much simpler to use.
$ Fixed bug pertaining to the extra slot in the Matter Fabricators GUI.
Diffstat (limited to 'src')
12 files changed, 389 insertions, 518 deletions
diff --git a/src/Java/gregtech/api/util/Recipe_GT.java b/src/Java/gregtech/api/util/Recipe_GT.java index 9e32e6e498..8a5abb529d 100644 --- a/src/Java/gregtech/api/util/Recipe_GT.java +++ b/src/Java/gregtech/api/util/Recipe_GT.java @@ -239,7 +239,7 @@ public class Recipe_GT extends GT_Recipe implements IComparableRecipe{ public static final Collection<Gregtech_Recipe_Map> sMappings = new ArrayList<>(); //public static final GT_Recipe_Map sChemicalBathRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.chemicalbath", "Chemical Bath", null, RES_PATH_GUI + "basicmachines/ChemicalBath", 1, 3, 1, 1, 1, E, 1, E, true, true); public static final GT_Recipe_Map sCokeOvenRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.cokeoven", "Coke Oven", null, RES_PATH_GUI + "basicmachines/Dehydrator", 2, 2, 1, 0, 1, E, 1, E, true, true); - public static final GT_Recipe_Map sMatterFab2Recipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.matterfab2", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, E, 1, E, true, true); + public static final GT_Recipe_Map sMatterFab2Recipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.matterfab2", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Default", 9, 9, 0, 0, 1, E, 1, E, true, true); //public static final Gregtech_Recipe_Map sMatterFabRecipes = new Gregtech_Recipe_Map(new HashSet<GregtechRecipe>(200), "gt.recipe.matterfab", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Massfabricator", 1, 3, 1, 1, 1, E, 1, E, true, true); public static final GT_Recipe_Map_Fuel sRocketFuels = new GT_Recipe_Map_Fuel(new HashSet<GT_Recipe>(10), "gt.recipe.rocketenginefuel", "Rocket Engine Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 3000, " EU", true, true); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java index a3f48ffd30..808eb90728 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java @@ -27,12 +27,12 @@ public class CONTAINER_MatterFab extends GT_ContainerMetaTile_Machine { @Override public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new SlotNoInput(mTileEntity, 1, 152, 5)); + //addSlotToContainer(new SlotNoInput(mTileEntity, 1, 152, 5)); } @Override public int getSlotCount() { - return 1; + return 0; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index 1e5f138d7b..383522cb7f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -385,10 +385,32 @@ GT_MetaTileEntity_MultiBlockBase { return checkRecipeGeneric(tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll); } + + public boolean checkRecipeGeneric(GT_Recipe aRecipe, + int aMaxParallelRecipes, int aEUPercent, + int aSpeedBonusPercent, int aOutputChanceRoll) { + if (aRecipe == null) { + return false; + } + ArrayList<ItemStack> tItems = getStoredInputs(); + ArrayList<FluidStack> tFluids = getStoredFluids(); + ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]); + FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]); + return checkRecipeGeneric(tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, aRecipe); + } + public boolean checkRecipeGeneric( ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, int aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) { + return checkRecipeGeneric(aItemInputs, aFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, null); + } + + + public boolean checkRecipeGeneric( + ItemStack[] aItemInputs, FluidStack[] aFluidInputs, + int aMaxParallelRecipes, int aEUPercent, + int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { // Based on the Processing Array. A bit overkill, but very flexible. @@ -397,6 +419,7 @@ GT_MetaTileEntity_MultiBlockBase { //If no core, return false; if (aControlCoreTier == 0) { + log("No control core found."); return false; } @@ -413,11 +436,12 @@ GT_MetaTileEntity_MultiBlockBase { //Check to see if Voltage Tier > Control Core Tier if (tTier > aControlCoreTier) { + log("Control core found is lower tier than power tier."); return false; } - GT_Recipe tRecipe = findRecipe( + GT_Recipe tRecipe = aRecipe != null ? aRecipe : findRecipe( getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); @@ -982,11 +1006,12 @@ GT_MetaTileEntity_MultiBlockBase { @Override public final void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); + resetRecipeMapForAllInputHatches(); onModeChangeByScrewdriver(aSide, aPlayer, aX, aY, aZ); } public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - resetRecipeMapForAllInputHatches(); + } @@ -1320,10 +1345,12 @@ GT_MetaTileEntity_MultiBlockBase { if (mRecipeResult == null) { + log("Invalid recipe, Fallback lookup. "+this.getRecipeMap().mRecipeList.size()+" | "+this.getRecipeMap().mNEIName); if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { try { return (GT_Recipe) findRecipe08.invoke(getRecipeMap(), aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { + e.printStackTrace(); return null; } } @@ -1331,6 +1358,7 @@ GT_MetaTileEntity_MultiBlockBase { try { return (GT_Recipe) findRecipe09.invoke(getRecipeMap(), aTileEntity, aRecipe, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids, aSpecialSlot, aInputs); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { + e.printStackTrace(); return null; } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java index a4d682bdae..123df8fe0f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java @@ -42,10 +42,10 @@ public class CasingTextureHandler { return TexturesGtBlock.Casing_Material_Tumbaga.getIcon(); //Broken Pink Fusion Casings case 8: - return Textures.BlockIcons.MACHINE_CASING_FUSION_2.getIcon(); + return TexturesGtBlock.TEXTURE_ORGANIC_PANEL_A_GLOWING.getIcon(); //Matter Fabricator Casings case 9: - return TexturesGtBlock.Casing_Machine_Dimensional_Adv.getIcon(); + return TexturesGtBlock.TEXTURE_METAL_PANEL_F.getIcon(); //Iron Blast Fuance Textures case 10: return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java index 4e3a49bfba..dfeb271f95 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java @@ -373,6 +373,12 @@ public class TexturesGtBlock { public static final CustomIcon Overlay_MatterFab = Internal_Overlay_MatterFab; private static final CustomIcon Internal_Overlay_MatterFab_Active = new CustomIcon("TileEntities/adv_machine_matterfab_active"); public static final CustomIcon Overlay_MatterFab_Active = Internal_Overlay_MatterFab_Active; + + private static final CustomIcon Internal_Overlay_MatterFab_Animated = new CustomIcon("TileEntities/adv_machine_matterfab_animated"); + public static final CustomIcon Overlay_MatterFab_Animated = Internal_Overlay_MatterFab_Animated; + private static final CustomIcon Internal_Overlay_MatterFab_Active_Animated = new CustomIcon("TileEntities/adv_machine_matterfab_active_animated"); + public static final CustomIcon Overlay_MatterFab_Active_Animated = Internal_Overlay_MatterFab_Active_Animated; + private static final CustomIcon Internal_Overlay_Oil = new CustomIcon("TileEntities/adv_machine_oil"); public static final CustomIcon Overlay_Oil = Internal_Overlay_Oil; private static final CustomIcon Internal_Overlay_UU_Matter = new CustomIcon("TileEntities/adv_machine_uum"); @@ -389,9 +395,16 @@ public class TexturesGtBlock { public static final CustomIcon TEXTURE_METAL_PANEL_C = new CustomIcon("metro/TEXTURE_METAL_PANEL_C"); public static final CustomIcon TEXTURE_METAL_PANEL_D = new CustomIcon("metro/TEXTURE_METAL_PANEL_D"); public static final CustomIcon TEXTURE_METAL_PANEL_E = new CustomIcon("metro/TEXTURE_METAL_PANEL_E"); + public static final CustomIcon TEXTURE_METAL_PANEL_F = new CustomIcon("metro/TEXTURE_METAL_PANEL_F"); + public static final CustomIcon TEXTURE_METAL_PANEL_G = new CustomIcon("metro/TEXTURE_METAL_PANEL_G"); + public static final CustomIcon TEXTURE_METAL_PANEL_H = new CustomIcon("metro/TEXTURE_METAL_PANEL_H"); + public static final CustomIcon TEXTURE_METAL_PANEL_I = new CustomIcon("metro/TEXTURE_METAL_PANEL_I"); + public static final CustomIcon TEXTURE_MAGIC_PANEL_A = new CustomIcon("metro/TEXTURE_MAGIC_A"); + public static final CustomIcon TEXTURE_ORGANIC_PANEL_A = new CustomIcon("metro/TEXTURE_ORGANIC_PANEL_A"); public static final CustomIcon TEXTURE_ORGANIC_PANEL_A_GLOWING = new CustomIcon("metro/TEXTURE_ORGANIC_PANEL_A_GLOWING"); + public static final CustomIcon TEXTURE_STONE_BIRD_A = new CustomIcon("metro/TEXTURE_STONE_BIRD_A"); public static final CustomIcon TEXTURE_STONE_BIRD_A_LEFT = new CustomIcon("metro/TEXTURE_STONE_BIRD_A_LEFT"); public static final CustomIcon TEXTURE_STONE_BIRD_A_RIGHT = new CustomIcon("metro/TEXTURE_STONE_BIRD_A_RIGHT"); @@ -400,10 +413,17 @@ public class TexturesGtBlock { public static final CustomIcon TEXTURE_STONE_GREEN_A = new CustomIcon("metro/TEXTURE_STONE_GREEN_A"); public static final CustomIcon TEXTURE_STONE_TABLET_A = new CustomIcon("metro/TEXTURE_STONE_TABLET_A"); public static final CustomIcon TEXTURE_STONE_TABLET_B = new CustomIcon("metro/TEXTURE_STONE_TABLET_B"); + public static final CustomIcon TEXTURE_TECH_A = new CustomIcon("metro/TEXTURE_TECH_A"); public static final CustomIcon TEXTURE_TECH_B = new CustomIcon("metro/TEXTURE_TECH_B"); public static final CustomIcon TEXTURE_TECH_C = new CustomIcon("metro/TEXTURE_TECH_C"); + public static final CustomIcon TEXTURE_TECH_PANEL_A = new CustomIcon("metro/TEXTURE_TECH_PANEL_A"); + public static final CustomIcon TEXTURE_TECH_PANEL_B = new CustomIcon("metro/TEXTURE_TECH_PANEL_B"); + public static final CustomIcon TEXTURE_TECH_PANEL_C = new CustomIcon("metro/TEXTURE_TECH_PANEL_C"); + + public static final CustomIcon TEXTURE_TECH_PANEL_RADIOACTIVE = new CustomIcon("TileEntities/DecayablesChest_bottom"); + public static final CustomIcon TEXTURE_TECH_PANEL_RADIOACTIVE_ALT = new CustomIcon("TileEntities/DecayablesChest_top"); //Overlay Arrays diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java index c0cf169f04..135b31c616 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java @@ -102,7 +102,8 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase { @Override public boolean onRunningTick(ItemStack aStack) { - return true; + return super.onRunningTick(aStack); + //return true; } @Override @@ -200,18 +201,24 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase { } + private static GT_Recipe_Map fCircuitMap; + @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { if (this.mMachineMode == MODE.ASSEMBLY) { return GT_Recipe.GT_Recipe_Map.sAssemblerRecipes; } else if (this.mMachineMode == MODE.CIRCUIT && !CORE.GTNH) { + if (fCircuitMap != null) { + return fCircuitMap; + } GT_Recipe_Map r; try { Field f = ReflectionUtils.getField(GT_Recipe.GT_Recipe_Map.class, "sCircuitAssemblerRecipes"); if (f != null) { r = (GT_Recipe_Map) f.get(null); if (r != null) { + fCircuitMap = r; return r; } } @@ -232,7 +239,7 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase { if (isModernGT && !CORE.GTNH) { mMachineMode = mMachineMode.nextMode(); if (mMachineMode == MODE.CRAFTING) { - PlayerUtils.messagePlayer(aPlayer, "Running the Auto-Crafter in mode: �dAuto-Crafting"); + PlayerUtils.messagePlayer(aPlayer, "Running the Auto-Crafter in mode: �dAutoCrafting"); } else if (mMachineMode == MODE.ASSEMBLY) { PlayerUtils.messagePlayer(aPlayer, "Running the Auto-Crafter in mode: �aAssembly"); } else if (mMachineMode == MODE.DISASSEMBLY) { @@ -251,14 +258,13 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase { } if (mMachineMode == MODE.CRAFTING) { - PlayerUtils.messagePlayer(aPlayer, "You are now running the Auto-Crafter in mode: �dAuto-Crafting"); + PlayerUtils.messagePlayer(aPlayer, "You are now running the Auto-Crafter in mode: �dAutoCrafting"); } else if (mMachineMode == MODE.ASSEMBLY) { PlayerUtils.messagePlayer(aPlayer, "You are now running the Auto-Crafter in mode: �aAssembly"); } else { PlayerUtils.messagePlayer(aPlayer, "You are now running the Auto-Crafter in mode: �cDisassembly"); } - } - super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); + } } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java index 3817c6985e..d4cd08cf44 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java @@ -1,16 +1,10 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; -import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; - import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import org.apache.commons.lang3.ArrayUtils; +import java.util.Collection; import gregtech.api.enums.ConfigCategories; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; @@ -20,27 +14,23 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Config; +import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.Recipe_GT; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.api.objects.data.Triplet; -import gtPlusPlus.api.objects.minecraft.GenericStack; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.recipe.common.CI; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.gui.GUI_MatterFab; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; @@ -48,28 +38,26 @@ import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlockBase { - - public final static int JUNK_TO_SCRAP = 19; - public final static int JUNK_TO_UUA = 20; - public final static int SCRAP_UUA = 21; - public final static int PRODUCE_UUM = 22; public static int sUUAperUUM = 1; public static int sUUASpeedBonus = 4; public static int sDurationMultiplier = 3200; + private int mMatterProduced = 0; private int mScrapProduced = 0; private int mAmplifierProduced = 0; private int mScrapUsed = 0; private int mAmplifierUsed = 0; + private int mMode = 0; + private final static int MODE_SCRAP = 1; + private final static int MODE_UU = 0; + public static boolean sRequiresUUA = false; private static FluidStack[] mUU = new FluidStack[2]; private static ItemStack mScrap[] = new ItemStack[2]; private static Block IC2Glass = Block.getBlockFromItem(ItemUtils.getItem("IC2:blockAlloyGlass")); - private GT_Recipe mFakeRecipe; - public int getAmplifierUsed(){ return this.mAmplifierUsed; } @@ -118,7 +106,7 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { if (aSide == aFacing) { return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[TAE.GTPP_INDEX(9)], - new GT_RenderedTexture(aActive ? TexturesGtBlock.Casing_Machine_Screen_3 : TexturesGtBlock.Casing_Machine_Screen_1)}; + new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_MatterFab_Active_Animated : TexturesGtBlock.Overlay_MatterFab_Animated)}; } return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[TAE.GTPP_INDEX(9)]}; } @@ -133,13 +121,13 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo return "MatterFabricator"; } - public ItemStack getScrapPile() { + public static ItemStack getScrapPile() { if (mScrap[0] == null) { mScrap[0] = ItemUtils.getSimpleStack(ItemUtils.getItem("IC2:itemScrap")); } return mScrap[0]; } - public ItemStack getScrapBox() { + public static ItemStack getScrapBox() { if (mScrap[1] == null) { mScrap[1] = ItemUtils.getSimpleStack(ItemUtils.getItem("IC2:itemScrapbox")); } @@ -158,53 +146,16 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo 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); + //Materials.UUAmplifier.mChemicalFormula = ("Mass Fabricator Eff/Speed Bonus: x" + sUUASpeedBonus); } @Override public boolean checkRecipe(final ItemStack aStack) { - Logger.INFO("Doing Recipe."); ArrayList<ItemStack> tItems = getStoredInputs(); ArrayList<FluidStack> tFluids = getStoredFluids(); ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]); FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]); - - if (tItems.size() == 0 && tFluids.size() == 0) { - if (this.mMode != PRODUCE_UUM) { - Logger.INFO("Not Processing."); - return false; - } - } - else { - if (tItems.size() != 0 && tFluids.size() == 0) { - - int yu = 0; - - for (ItemStack h : tItems) { - if (h != null) { - if (h.getItem() != getScrapPile().getItem() && h.getItem() != getScrapBox().getItem() && h.getItem() != CI.getNumberedCircuit(0).getItem()) { - yu++; - Logger.INFO("Found "+h.getDisplayName()+"++"); - } - else { - Logger.INFO("Found "+h.getDisplayName()); - if (h.getItem() == CI.getNumberedCircuit(0).getItem()) { - this.mMode = getGUICircuit(new ItemStack[] {h}); - } - - } - } - } - - if (yu == 0 && this.mMode != PRODUCE_UUM) { - Logger.INFO("Not Processing."); - return false; - } - - } - } - - return checkRecipeGeneric(tItemInputs, tFluidInputs, 1, 75, 500, 100); + return checkRecipeGeneric(tItemInputs, tFluidInputs, 4, 80, 00, 100); } @@ -212,6 +163,10 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2; final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2; + + Block aContainmentGlass = ModBlocks.blockCasings3Misc; + int aContainmentMeta = 15; + for (int i = -2; i < 3; i++) { for (int j = -2; j < 3; j++) { for (int h = 0; h < 4; h++) { @@ -283,10 +238,14 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo } else if (((i != -2) || (i != 2)) && ((j != -2) || (j != 2))){ - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != IC2Glass) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != aContainmentGlass) { Logger.INFO("Glass Casings Missing from somewhere in the second layer."); return false; } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != aContainmentMeta) { + Logger.INFO("Glass Casings wrong meta from the second layer."); + return false; + } } } if (h == 2) { @@ -302,10 +261,15 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo } else if (((i != -2) || (i != 2)) && ((j != -2) || (j != 2))){ - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != IC2Glass) { + + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != aContainmentGlass) { Logger.INFO("Glass Casings Missing from somewhere in the third layer."); return false; } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != aContainmentMeta) { + Logger.INFO("Glass Casings wrong meta from the third layer."); + return false; + } } } if (h == 3) { @@ -352,275 +316,6 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo return new GregtechMetaTileEntity_MassFabricator(this.mName); } - public static Map<String, GT_Recipe> mCachedRecipeMap = new ConcurrentHashMap<String, GT_Recipe>(); - - /** - * Special Recipe Generator - */ - - private GT_Recipe generateCustomRecipe(int mode, ItemStack[] aItemInputs, FluidStack[] aFluidInputs) { - ItemStack[] inputs = null; - ItemStack[] outputs = null; - FluidStack fluidIn = null; - FluidStack fluidOut = null; - Triplet<Integer, ItemStack[], FluidStack[]> K = new Triplet<Integer, ItemStack[], FluidStack[]>(mode, aItemInputs, aFluidInputs); - //int mapKey = ((K == null || aItemInputs == null || aItemInputs.length < 1) ? -1 : K.hashCode()); - String mapKey = Utils.calculateChecksumMD5(K); - if (mCachedRecipeMap.containsKey(mapKey)) { - Logger.INFO("2.x. Returning Cached Result."); - return mCachedRecipeMap.get(mapKey); - } - - final boolean oldRecipe = Utils.invertBoolean(CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK); - Logger.INFO("2.x.1 | "+mapKey); - - int baseEuCost = 0; - int baseTimeCost = 0; - - final int mEuPerRecycleOperation = 32; - final int mTicksPerRecycleOperation = 4; - final int mEuPerAmplifabOperation = 32; - final int mTicksPerAmplifabOperation = 160*20; - final int mEuPerMatterFabOperation = 32; - final int mTicksPerMatterFabOperation = 160*20; - - final Item SP = this.getScrapPile().getItem(); - final Item SB = this.getScrapBox().getItem(); - final Item CR = CI.getNumberedCircuit(0).getItem(); - Logger.INFO("2.x.2"); - - /** - * Count Inputs - */ - - ItemStack[] mStrippedInputs = new ItemStack[aItemInputs.length]; - int mStrippedIndex = 0; - - int inputCount = 0; - if (aItemInputs.length > 0) { - for (int y=0;y<aItemInputs.length;y++) { - if (aItemInputs[y].getItem() != SP && aItemInputs[y].getItem() != SB && aItemInputs[y].getItem() != CR) { - inputCount += aItemInputs[y].stackSize; - mStrippedInputs[mStrippedIndex++] = aItemInputs[y].copy(); - } - } - } - - Logger.INFO("2.x.3"); - - /** - * Set Inputs and Outputs depending on mode. - */ - - //Recycler mode - if (mode == JUNK_TO_SCRAP) { - if (mStrippedInputs.length > 0) { - Logger.INFO("2.x.4.1"); - inputs = mStrippedInputs; - outputs = getScrapPiles(inputCount); - baseEuCost = mEuPerRecycleOperation; - baseTimeCost = mTicksPerRecycleOperation; - } - } - - //Hybrid mode - else if (mode == JUNK_TO_UUA) { - if (mStrippedInputs.length > 0) { - Logger.INFO("2.x.4.2"); - inputs = mStrippedInputs; - GenericStack x = getUUAFromScrapStack(getScrapPiles(inputCount)); - outputs = new ItemStack[]{x.getItemStack()}; - fluidOut = x.getFluidStack(); - baseEuCost = 512; - baseTimeCost = mTicksPerRecycleOperation; - } - } - - //Amplifabricator mode - else if (mode == SCRAP_UUA) { - if (mStrippedInputs.length > 0) { - Logger.INFO("2.x.4.3"); - inputs = mStrippedInputs; - GenericStack x = getUUAFromScrapStack(inputs); - outputs = new ItemStack[]{x.getItemStack()}; - fluidOut = x.getFluidStack(); - baseEuCost = mEuPerAmplifabOperation; - baseTimeCost = mTicksPerAmplifabOperation; - } - } - - //Matter Fabricator mode - else if (mode == PRODUCE_UUM) { - Logger.INFO("2.x.4.4"); - if (sDurationMultiplier != 0) { - baseTimeCost = sDurationMultiplier; - } - if (doesHatchContainUUA()) { - fluidIn = FluidUtils.getFluidStack(mUU[0], sUUAperUUM); - } - else { - if (sRequiresUUA) { - //Return null because if this is the case, the machine cannot run at all. - return null; - } - else { - fluidIn = GT_Values.NF; - } - } - fluidOut = FluidUtils.getFluidStack(mUU[1], 1); - baseEuCost = mEuPerMatterFabOperation; - baseTimeCost = (fluidIn == GT_Values.NF ? mTicksPerMatterFabOperation: mTicksPerMatterFabOperation/sUUASpeedBonus); - } - Logger.INFO("2.x.5"); - - - //Pre 5.09 compat - if (oldRecipe) { - baseEuCost = (baseEuCost/8); - } - - Recipe_GT B = null; - try { - B = new Recipe_GT( - true, - inputs, //Inputs - outputs, //Outputs - null, // Special? - new int[] {10000}, //Chances - new FluidStack[] {fluidIn}, //Fluid Inputs - new FluidStack[] {fluidOut}, //Fluid Outputs - baseTimeCost, //duration - baseEuCost, //eu/t - 0); - } - catch (Throwable t) { - t.printStackTrace(); - } - - //Cache generated recipe - if (B != null) { - mCachedRecipeMap.put(mapKey, B); - Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(B); - } - - //The Recipe Itself. - return B; - } - - private ItemStack[] getScrapPiles(int inputSize) { - - if (inputSize < 1) { - Logger.INFO("2.x.4.x.x"); - return null; - } - - Logger.INFO("2.x.4.x.1"); - - //Generate Trash - ItemStack[] mOutputs; - AutoMap<ItemStack> mTemp = new AutoMap<ItemStack>(); - for (int r=0;r<inputSize;r++) { - Logger.INFO("2.x.4.x.1.0"); - if (MathUtils.randInt(0, 5) != 6) { - mTemp.put(getScrapPile()); - } - } - Logger.INFO("2.x.4.x.2"); - //int mSlots = (int) Math.ceil((mTemp.size()/64) / 100.0); - int mSlots = (int) (mTemp.size()/64); - Logger.INFO("2.x.4.x.3 | mSlots: "+mSlots); - mOutputs = new ItemStack[(mSlots > 0 ? mSlots : 1)]; - Logger.INFO("2.x.4.x.4 | mOutputs: "+mOutputs.length); - int totalScrap = mTemp.size(); - Logger.INFO("2.x.4.x.5"); - int index = 0; - Logger.INFO("2.x.4.x.6"); - try { - if (totalScrap > 0) { - Logger.INFO("2.x.4.x.6.x | "+totalScrap); - while (totalScrap > 0) { - Logger.INFO("2.x.4.x.6.xx | "+index); - //if (index < mOutputs.length) { - if (mOutputs[index] == null) { //TODO - Logger.WARNING("2.x.4.x.6.1"); - mOutputs[index] = getScrapPile(); - totalScrap--; - } - else { - Logger.WARNING("2.x.4.x.6.2"); - if (mOutputs[index].stackSize < 64) { - mOutputs[index].stackSize++; - totalScrap--; - } - } - - if (mOutputs[index] != null && mOutputs[index].stackSize >= 64) { - Logger.WARNING("2.x.4.x.6.0"); - index++; - } - //} - } - } - } - catch (Throwable t) { - t.printStackTrace(); - - } - Logger.WARNING("2.x.4.x.7"); - return mOutputs; - } - - public GenericStack getUUAFromScrapStack(ItemStack[] scrapStack) { - //9=1 - int mbUUA = 0; - int temp = 0; - for (int u=0;u<scrapStack.length;u++) { - temp++; - if(temp == 9) { - temp = 0; - mbUUA++; - } - } - - int remainder = (scrapStack.length % 9); - GenericStack mOutput = new GenericStack(); - ItemStack mScrapOutput = null; - FluidStack mUUAOutput = null; - if (remainder > 0) { - mScrapOutput= ItemUtils.getSimpleStack(getScrapPile(), remainder); - } - if (mbUUA > 0) { - mUUAOutput = FluidUtils.getFluidStack(mUU[0], mbUUA); - } - mOutput.setItemStack(mScrapOutput); - mOutput.setFluidStack(mUUAOutput); - return mOutput; - } - - private GT_Recipe getFakeRecipeForMode(ItemStack[] aItemInputs, FluidStack[] aFluidInputs) { - if (this.mMode == JUNK_TO_SCRAP) { - Logger.WARNING("2.1"); - return generateCustomRecipe(JUNK_TO_SCRAP, aItemInputs, aFluidInputs); - } - else if (this.mMode == JUNK_TO_UUA) { - Logger.WARNING("2.2"); - return generateCustomRecipe(JUNK_TO_UUA, aItemInputs, aFluidInputs); - } - else if (this.mMode == SCRAP_UUA) { - Logger.WARNING("2.3"); - return generateCustomRecipe(SCRAP_UUA, aItemInputs, aFluidInputs); - } - else if (this.mMode == PRODUCE_UUM) { - Logger.WARNING("2.4"); - return generateCustomRecipe(PRODUCE_UUM, aItemInputs, aFluidInputs); - } - else { - Logger.WARNING("2.5"); - return null; - } - } - - public boolean doesHatchContainUUA() { if (mUU[0] == null) { mUU[0] = Materials.UUAmplifier.getFluid(100); @@ -650,7 +345,7 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo @Override public GT_Recipe_Map getRecipeMap() { - return null; + return this.mMode == MODE_SCRAP ? GT_Recipe_Map.sRecyclerRecipes : Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes; //return Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes; } @@ -658,188 +353,94 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo public boolean checkRecipeGeneric( ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, int aEUPercent, - int aSpeedBonusPercent, int aOutputChanceRoll) { - - // Based on the Processing Array. A bit overkill, but very flexible. - // Reset outputs and progress stats - this.mEUt = 0; - this.mMaxProgresstime = 0; - this.mOutputItems = new ItemStack[]{}; - this.mOutputFluids = new FluidStack[]{}; - - Logger.INFO("1."); - Logger.INFO("2."); - mFakeRecipe = getFakeRecipeForMode(aItemInputs, aFluidInputs); - Logger.INFO("3."); - - long tVoltage = getMaxInputVoltage(); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - Logger.INFO("4."); - - GT_Recipe tRecipe = mFakeRecipe; - - // Remember last recipe - an optimization for findRecipe() - this.mLastRecipe = tRecipe; - - if (tRecipe == null) { - Logger.INFO("Bad Recipe Generated."); - return false; - } - - if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) { - Logger.INFO("Cannot buffer output."); - return false; - } - - // EU discount - float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f; - float tTotalEUt = 0.0f; - - int parallelRecipes = 0; - - // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits - for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) { - if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { - break; + int aSpeedBonusPercent, int aOutputChanceRoll) { + + if (this.mMode == MODE_SCRAP) { + + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + GT_Recipe c = new Recipe_GT(false, new ItemStack[] { GT_Utility.copyAmount(1, aItemInputs[0]) }, + GT_ModHandler.getRecyclerOutput(GT_Utility.copyAmount(64, aItemInputs[0]), 0) == null ? null + : new ItemStack[] { ItemList.IC2_Scrap.get(1) }, + null, new int[] { 2000 }, null, null, 100, + (int) gregtech.api.enums.GT_Values.V[2], 0); + + // EU discount + float tRecipeEUt = (c.mEUt * aEUPercent) / 100.0f; + float tTotalEUt = 0.0f; + + int parallelRecipes = 0; + // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits + for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) { + if (!c.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { + log("Broke at "+parallelRecipes+"."); + break; + } + log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); + tTotalEUt += tRecipeEUt; } - tTotalEUt += tRecipeEUt; - } - - if (parallelRecipes == 0) { - return false; - } - - // -- Try not to fail after this point - inputs have already been consumed! -- - - // Convert speed bonus to duration multiplier - // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration. - aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent); - float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent); - this.mMaxProgresstime = (int)(tRecipe.mDuration * tTimeFactor); - - this.mEUt = (int)Math.ceil(tTotalEUt); - - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - - // Overclock - if (this.mEUt <= 16) { - this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1)); - this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1)); - } else { - while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { - this.mEUt *= 4; - this.mMaxProgresstime /= 2; + if (parallelRecipes == 0) { + this.mEUt = (int) gregtech.api.enums.GT_Values.V[tTier]; + this.mMaxProgresstime = 10; + return true; } + + return super.checkRecipeGeneric(c, 32, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll); } - - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); - } - - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - - // Collect fluid outputs - FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length]; - for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) { - if (tRecipe.getFluidOutput(h) != null) { - tOutputFluids[h] = tRecipe.getFluidOutput(h).copy(); - tOutputFluids[h].amount *= parallelRecipes; - } + + //Return normal Recipe handling + return super.checkRecipeGeneric(aItemInputs, aFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll); } - - // Collect output item types - ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length]; - for (int h = 0; h < tRecipe.mOutputs.length; h++) { - if (tRecipe.getOutput(h) != null) { - tOutputItems[h] = tRecipe.getOutput(h).copy(); - tOutputItems[h].stackSize = 0; - } + + private GT_Recipe generateScrapRecipe(ItemStack[] aInputs) { + if (aInputs.length < 1) { + return null; } - - // Set output item stack sizes (taking output chance into account) - for (int f = 0; f < tOutputItems.length; f++) { - if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) { - for (int g = 0; g < parallelRecipes; g++) { - if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f)) - tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize; + else { + AutoMap<ItemStack> aInputsFiltered = new AutoMap<ItemStack>(); + ItemStack circuit = CI.getNumberedCircuit(1); + for (ItemStack f : aInputs) { + if (f == null || f.getItem() == circuit.getItem()) { + continue; } } + + } + + + return null; + } - tOutputItems = removeNulls(tOutputItems); - - // Sanitize item stack size, splitting any stacks greater than max stack size - List<ItemStack> splitStacks = new ArrayList<ItemStack>(); - for (ItemStack tItem : tOutputItems) { - while (tItem.getMaxStackSize() < tItem.stackSize) { - ItemStack tmp = tItem.copy(); - tmp.stackSize = tmp.getMaxStackSize(); - tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize(); - splitStacks.add(tmp); - } - } - - if (splitStacks.size() > 0) { - ItemStack[] tmp = new ItemStack[splitStacks.size()]; - tmp = splitStacks.toArray(tmp); - tOutputItems = ArrayUtils.addAll(tOutputItems, tmp); - } - - // Strip empty stacks - List<ItemStack> tSList = new ArrayList<ItemStack>(); - for (ItemStack tS : tOutputItems) { - if (tS.stackSize > 0) tSList.add(tS); + @Override + public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + int aMode = this.mMode + 1; + if (aMode > 1) { + this.mMode = MODE_UU; + PlayerUtils.messagePlayer(aPlayer, "Mode ["+this.mMode+"]: Matter/AmpliFabricator"); } - tOutputItems = tSList.toArray(new ItemStack[tSList.size()]); - - // Commit outputs - this.mOutputItems = tOutputItems; - this.mOutputFluids = tOutputFluids; - updateSlots(); - - /** - * Amp Stat Recording - */ - - for (int u=0;u<tRecipe.mFluidInputs.length;u++) { - if (tRecipe.mFluidInputs[u].isFluidEqual(mUU[0])) { - if (tRecipe.mFluidInputs[u].amount > 0) { - mAmplifierUsed += tRecipe.mFluidInputs[u].amount; - } - } - } - for (int u=0;u<tOutputFluids.length;u++) { - if (tOutputFluids[u].isFluidEqual(mUU[0])) { - mAmplifierProduced += tOutputFluids[u].amount; - } - /** - * UUM Stat Recording - */ - if (tOutputFluids[u].isFluidEqual(mUU[1])) { - mMatterProduced += tOutputFluids[u].amount; - } + else if (aMode == 1) { + this.mMode = MODE_SCRAP; + PlayerUtils.messagePlayer(aPlayer, "Mode ["+this.mMode+"]: Recycler"); } - - /** - * Scrap Stat Recording - */ - for (int u=0;u<tRecipe.mInputs.length;u++) { - if (tRecipe.mInputs[u].getItem() == getScrapPile().getItem()) { - mScrapUsed += tRecipe.mInputs[u].stackSize; - } - } - for (int u=0;u<tOutputItems.length;u++) { - if (tOutputItems[u].getItem() == getScrapPile().getItem()) { - mScrapProduced += tOutputItems[u].stackSize; - } + else { + this.mMode = MODE_SCRAP; + PlayerUtils.messagePlayer(aPlayer, "Mode ["+this.mMode+"]: Recycler"); + } + GT_Recipe_Map r = this.getRecipeMap(); + final Collection<GT_Recipe> x = r.mRecipeList; + Logger.INFO("Dumping " + r.mUnlocalizedName + " Recipes for Debug. size: "+x.size()); + for (final GT_Recipe newBo : x) { + Logger.INFO("========================"); + Logger.INFO("Dumping Input: " + ItemUtils.getArrayStackNames(newBo.mInputs)); + Logger.INFO("Dumping Inputs " + ItemUtils.getFluidArrayStackNames(newBo.mFluidInputs)); + Logger.INFO("Dumping Duration: " + newBo.mDuration); + Logger.INFO("Dumping EU/t: " + newBo.mEUt); + Logger.INFO("Dumping Output: " + ItemUtils.getArrayStackNames(newBo.mOutputs)); + Logger.INFO("Dumping Output: " + ItemUtils.getFluidArrayStackNames(newBo.mFluidOutputs)); + Logger.INFO("========================"); } - - // Play sounds (GT++ addition - GT multiblocks play no sounds) - startProcess(); - - return true; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java index de36c6952a..8064c68559 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java @@ -1,9 +1,17 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.Recipe_GT; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.recipe.common.CI; +import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMetaTileEntity_MassFabricator; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; public class GregtechIndustrialMassFabricator { @@ -11,6 +19,7 @@ public class GregtechIndustrialMassFabricator { if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { Logger.INFO("Gregtech5u Content | Registering Industrial Matter Fabricator Multiblock."); if (CORE.ConfigSwitches.enableMultiblock_MatterFabricator) { + generateRecipes(); run1(); } } @@ -21,6 +30,201 @@ public class GregtechIndustrialMassFabricator { // Industrial Matter Fabricator Multiblock GregtechItemList.Industrial_MassFab.set(new GregtechMetaTileEntity_MassFabricator(799, "industrialmassfab.controller.tier.single", "Matter Fabrication CPU").getStackForm(1L)); + } + + private static void generateRecipes() { + + //Generate Scrap->UUA Recipes + + + + //Basic UUA1 + GT_Recipe UUA_From_Scrap = new Recipe_GT( + false, + new ItemStack[] {CI.getNumberedCircuit(9), ItemUtils.getSimpleStack(getScrapPile(), 9)}, + new ItemStack[] {GT_Values.NI}, + null, null, + new FluidStack[] {GT_Values.NF}, + new FluidStack[] {Materials.UUAmplifier.getFluid(1)}, + 9*20, + 32, + 0); + //Basic UUA2 + GT_Recipe UUA_From_ScrapBoxes = new Recipe_GT( + false, + new ItemStack[] {CI.getNumberedCircuit(19), ItemUtils.getSimpleStack(getScrapBox(), 1)}, + new ItemStack[] {GT_Values.NI}, + null, null, + new FluidStack[] {GT_Values.NF}, + new FluidStack[] {Materials.UUAmplifier.getFluid(1)}, + 9*20, + 32, + 0); + + Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(UUA_From_Scrap); + Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(UUA_From_ScrapBoxes); + + if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { + //Basic UUM + GT_Recipe generateUUM = new Recipe_GT( + false, + new ItemStack[] {CI.getNumberedCircuit(1)}, + new ItemStack[] {GT_Values.NI}, + null, null, + new FluidStack[] {GT_Values.NF}, + new FluidStack[] {Materials.UUMatter.getFluid(1)}, + 160*20, + 32, + 0); + + //Basic UUM + GT_Recipe generateUUMFromUUA = new Recipe_GT( + false, + new ItemStack[] {CI.getNumberedCircuit(2)}, + new ItemStack[] {GT_Values.NI}, + null, null, + new FluidStack[] {Materials.UUAmplifier.getFluid(1)}, + new FluidStack[] {Materials.UUMatter.getFluid(1)}, + 40*20, + 32, + 0); + + Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(generateUUM); + Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA); + } + else { + + //Basic UUM + GT_Recipe generateUUM_LV = new Recipe_GT( + false, + new ItemStack[] {CI.getNumberedCircuit(15)}, + new ItemStack[] {GT_Values.NI}, + null, null, + new FluidStack[] {GT_Values.NF}, + new FluidStack[] {Materials.UUMatter.getFluid(1)}, + 160*20, + 256, + 0); + GT_Recipe generateUUM_MV = new Recipe_GT( + false, + new ItemStack[] {CI.getNumberedCircuit(14)}, + new ItemStack[] {GT_Values.NI}, + null, null, + new FluidStack[] {GT_Values.NF}, + new FluidStack[] {Materials.UUMatter.getFluid(1)}, + 160*20, + 512, + 0); + GT_Recipe generateUUM_HV = new Recipe_GT( + false, + new ItemStack[] {CI.getNumberedCircuit(13)}, + new ItemStack[] {GT_Values.NI}, + null, null, + new FluidStack[] {GT_Values.NF}, + new FluidStack[] {Materials.UUMatter.getFluid(1)}, + 160*20, + 1024, + 0); + GT_Recipe generateUUM_EV = new Recipe_GT( + false, + new ItemStack[] {CI.getNumberedCircuit(12)}, + new ItemStack[] {GT_Values.NI}, + null, null, + new FluidStack[] {GT_Values.NF}, + new FluidStack[] {Materials.UUMatter.getFluid(1)}, + 160*20, + 2048, + 0); + GT_Recipe generateUUM_IV = new Recipe_GT( + false, + new ItemStack[] {CI.getNumberedCircuit(11)}, + new ItemStack[] {GT_Values.NI}, + null, null, + new FluidStack[] {GT_Values.NF}, + new FluidStack[] {Materials.UUMatter.getFluid(1)}, + 160*20, + 4096, + 0); + + //Basic UUM + GT_Recipe generateUUMFromUUA_LV = new Recipe_GT( + false, + new ItemStack[] {CI.getNumberedCircuit(5)}, + new ItemStack[] {GT_Values.NI}, + null, null, + new FluidStack[] {Materials.UUAmplifier.getFluid(1)}, + new FluidStack[] {Materials.UUMatter.getFluid(1)}, + 40*20, + 256, + 0); + GT_Recipe generateUUMFromUUA_MV = new Recipe_GT( + false, + new ItemStack[] {CI.getNumberedCircuit(4)}, + new ItemStack[] {GT_Values.NI}, + null, null, + new FluidStack[] {Materials.UUAmplifier.getFluid(1)}, + new FluidStack[] {Materials.UUMatter.getFluid(1)}, + 40*20, + 512, + 0); + GT_Recipe generateUUMFromUUA_HV = new Recipe_GT( + false, + new ItemStack[] {CI.getNumberedCircuit(3)}, + new ItemStack[] {GT_Values.NI}, + null, null, + new FluidStack[] {Materials.UUAmplifier.getFluid(1)}, + new FluidStack[] {Materials.UUMatter.getFluid(1)}, + 40*20, + 1024, + 0); + GT_Recipe generateUUMFromUUA_EV = new Recipe_GT( + false, + new ItemStack[] {CI.getNumberedCircuit(2)}, + new ItemStack[] {GT_Values.NI}, + null, null, + new FluidStack[] {Materials.UUAmplifier.getFluid(1)}, + new FluidStack[] {Materials.UUMatter.getFluid(1)}, + 40*20, + 2048, + 0); + GT_Recipe generateUUMFromUUA_IV = new Recipe_GT( + false, + new ItemStack[] {CI.getNumberedCircuit(1)}, + new ItemStack[] {GT_Values.NI}, + null, null, + new FluidStack[] {Materials.UUAmplifier.getFluid(1)}, + new FluidStack[] {Materials.UUMatter.getFluid(1)}, + 40*20, + 4096, + 0); + + Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(generateUUM_LV); + Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(generateUUM_MV); + Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(generateUUM_HV); + Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(generateUUM_EV); + Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(generateUUM_IV); + Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA_LV); + Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA_MV); + Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA_HV); + Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA_EV); + Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA_IV); + + } + + Logger.INFO("Generated "+Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.mRecipeList.size()+" Matter Fabricator recipes."); + + + + + } + + + public static ItemStack getScrapPile() { + return ItemUtils.getSimpleStack(ItemUtils.getItem("IC2:itemScrap")); + } + public static ItemStack getScrapBox() { + return ItemUtils.getSimpleStack(ItemUtils.getItem("IC2:itemScrapbox")); } + }
\ No newline at end of file diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_matterfab_active_animated.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_matterfab_active_animated.png Binary files differnew file mode 100644 index 0000000000..801481e0be --- /dev/null +++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_matterfab_active_animated.png diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_matterfab_active_animated.png.mcmeta b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_matterfab_active_animated.png.mcmeta new file mode 100644 index 0000000000..49e988e8bb --- /dev/null +++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_matterfab_active_animated.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation":{ + "frametime":2, + "frames": [1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 9, 9] + } +}
\ No newline at end of file diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_matterfab_animated.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_matterfab_animated.png Binary files differnew file mode 100644 index 0000000000..96716ec7e9 --- /dev/null +++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_matterfab_animated.png diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_matterfab_animated.png.mcmeta b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_matterfab_animated.png.mcmeta new file mode 100644 index 0000000000..49e988e8bb --- /dev/null +++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_matterfab_animated.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation":{ + "frametime":2, + "frames": [1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 9, 9] + } +}
\ No newline at end of file |