From f1f31e9e3ad4185295c18c50634cafa093e6e256 Mon Sep 17 00:00:00 2001 From: Technus Date: Mon, 14 Aug 2017 14:47:06 +0200 Subject: Merge --- .../java/com/github/technus/tectech/TecTech.java | 2 +- src/main/java/com/github/technus/tectech/Util.java | 68 +- .../classes/aOredictDequantizationInfo.java | 8 +- .../classes/aOredictQuantizationInfo.java | 6 + .../classes/bTransformationInfo.java | 7 +- .../definitions/dAtomDefinition.java | 4 + .../technus/tectech/gtppAddon/GtppAtomLoader.java | 45 + .../technus/tectech/loader/BloodyRecipeLoader.java | 11 + .../technus/tectech/loader/RecipeLoader.java | 11 +- .../GT_MetaTileEntity_EM_essentiaDequantizer.java | 54 +- .../GT_MetaTileEntity_EM_essentiaQuantizer.java | 54 +- .../github/technus/tectech/nei/NEI_TT_Config.java | 25 + .../tectech/nei/TT_NEI_ResearchHandler.java | 922 ++++++++++----------- .../github/technus/tectech/nei/TT_NEI_config.java | 25 - .../github/technus/tectech/proxy/ClientProxy.java | 10 + .../github/technus/tectech/proxy/CommonProxy.java | 2 + .../github/technus/tectech/recipe/TT_recipe.java | 7 +- .../technus/tectech/recipe/TT_recipeAdder.java | 18 +- .../technus/tectech/thing/CustomItemList.java | 2 +- .../tectech/thing/casing/GT_Block_HintTT.java | 6 +- .../tectech/thing/casing/GT_Item_HintTT.java | 15 +- .../thing/item/ConstructibleTriggerItem.java | 120 ++- .../thing/metaTileEntity/IConstructable.java | 15 + .../GT_MetaTileEntity_Hatch_DataConnector.java | 3 +- .../hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java | 34 +- ...GT_MetaTileEntity_Hatch_ElementalContainer.java | 16 +- .../hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java | 34 +- .../hatch/GT_MetaTileEntity_Hatch_Holder.java | 7 - .../GT_MetaTileEntity_Hatch_InputElemental.java | 10 +- .../GT_MetaTileEntity_Hatch_MufflerElemental.java | 17 +- .../GT_MetaTileEntity_Hatch_OutputElemental.java | 10 +- .../thing/metaTileEntity/iConstructible.java | 9 - .../multi/GT_MetaTileEntity_EM_annihilation.java | 16 +- .../multi/GT_MetaTileEntity_EM_bhg.java | 28 +- .../multi/GT_MetaTileEntity_EM_collider.java | 21 +- .../multi/GT_MetaTileEntity_EM_computer.java | 28 +- .../multi/GT_MetaTileEntity_EM_crafter.java | 16 +- .../multi/GT_MetaTileEntity_EM_decay.java | 18 +- .../multi/GT_MetaTileEntity_EM_dequantizer.java | 31 +- .../multi/GT_MetaTileEntity_EM_infuser.java | 15 +- .../multi/GT_MetaTileEntity_EM_junction.java | 18 +- .../multi/GT_MetaTileEntity_EM_quantizer.java | 29 +- .../multi/GT_MetaTileEntity_EM_research.java | 199 ++++- .../multi/GT_MetaTileEntity_EM_scanner.java | 24 +- .../multi/GT_MetaTileEntity_EM_stabilizer.java | 16 +- .../multi/GT_MetaTileEntity_EM_switch.java | 62 +- .../multi/GT_MetaTileEntity_EM_transformer.java | 61 +- .../multi/GT_MetaTileEntity_EM_wormhole.java | 16 +- .../multi/GT_MetaTileEntity_MultiblockBase_EM.java | 126 ++- .../multi/GT_MetaTileEntity_TM_microwave.java | 21 +- .../GT_MetaTileEntity_DebugPowerGenerator.java | 4 +- .../GT_MetaTileEntity_DebugStructureWriter.java | 2 +- .../gui/GT_GUIContainer_DebugPowerGenerator.java | 6 +- .../entity/projectiles/projectileRenderEM.java | 4 +- 54 files changed, 1474 insertions(+), 864 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/gtppAddon/GtppAtomLoader.java create mode 100644 src/main/java/com/github/technus/tectech/loader/BloodyRecipeLoader.java create mode 100644 src/main/java/com/github/technus/tectech/nei/NEI_TT_Config.java delete mode 100644 src/main/java/com/github/technus/tectech/nei/TT_NEI_config.java create mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/IConstructable.java delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/iConstructible.java (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index f6d5fecbd5..34426b0075 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -26,7 +26,7 @@ import net.minecraftforge.fluids.FluidStack; import java.util.HashMap; @Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION, dependencies = "required-after:Forge@[10.13.4.1614,);" - + "required-after:YAMCore@[0.5.70,);" + "required-after:gregtech;" + "after:CoFHCore;" + "after:Thaumcraft;") + + "required-after:YAMCore@[0.5.70,);" + "required-after:gregtech;" + "after:CoFHCore;" + "after:Thaumcraft;" + "after:dreamcraft;" + "after:miscutils;") public class TecTech { @SidedProxy(clientSide = Reference.CLIENTSIDE, serverSide = Reference.SERVERSIDE) public static CommonProxy proxy; diff --git a/src/main/java/com/github/technus/tectech/Util.java b/src/main/java/com/github/technus/tectech/Util.java index cf039bcb8d..27f1c8377b 100644 --- a/src/main/java/com/github/technus/tectech/Util.java +++ b/src/main/java/com/github/technus/tectech/Util.java @@ -12,6 +12,7 @@ import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; @@ -307,17 +308,29 @@ public class Util { byte[] blockMeta,//use numbers 0-9 for casing types int horizontalOffset, int verticalOffset, int depthOffset, IGregTechTileEntity aBaseMetaTileEntity, boolean hintsOnly) { - World world = aBaseMetaTileEntity.getWorld(); + byte facing = aBaseMetaTileEntity.getFrontFacing(); + return StructureBuilder(structure,blockType,blockMeta, + horizontalOffset,verticalOffset,depthOffset, + aBaseMetaTileEntity.getWorld().getTileEntity(aBaseMetaTileEntity.getXCoord(),aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord()), + facing,hintsOnly); + } + + public static boolean StructureBuilder(String[][] structure,//0-9 casing, +- air no air, A... ignore 'A'-CHAR+1 blocks + Block[] blockType,//use numbers 0-9 for casing types + byte[] blockMeta,//use numbers 0-9 for casing types + int horizontalOffset, int verticalOffset, int depthOffset, + TileEntity tileEntity, int facing, boolean hintsOnly) { + if(!tileEntity.hasWorldObj()) return false; + World world = tileEntity.getWorldObj(); if ((world.isRemote && !hintsOnly)||(!world.isRemote && hintsOnly)) return false; //TE Rotation - byte facing = aBaseMetaTileEntity.getFrontFacing(); int x, y, z, a, b, c, pointer; final int - baseX=aBaseMetaTileEntity.getXCoord(), - baseZ=aBaseMetaTileEntity.getZCoord(), - baseY=aBaseMetaTileEntity.getYCoord(); + baseX=tileEntity.xCoord, + baseZ=tileEntity.zCoord, + baseY=tileEntity.yCoord; //a,b,c - relative to block face! //x,y,z - relative to block position on map! @@ -393,18 +406,8 @@ public class Util { TecTech.proxy.hint_particle(world,x, y, z, blockType[pointer], blockMeta[pointer]); } else if ((pointer = block - ' ') >= 0) { switch(pointer){ - case 0: TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 0); break; - case 1: TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 1); break; - case 2: TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 2); break; - case 3: TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 3); break; - case 4: TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 4); break; - case 5: TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 5); break; - case 6: TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 6); break; - case 7: TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 7); break; - case 8: TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 8); break; - case 9: TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 9); break; - case 10:TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 10); break; - case 11:TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 11); break; + case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: + TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, pointer); break; default:TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 12); } } else TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 15); @@ -422,18 +425,8 @@ public class Util { world.setBlock(x, y, z, blockType[pointer], blockMeta[pointer], 2); } else if ((pointer = block - ' ') >= 0) { switch(pointer){ - case 0: world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 0, 2); break; - case 1: world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 1,2); break; - case 2: world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 2,2); break; - case 3: world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 3,2); break; - case 4: world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 4,2); break; - case 5: world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 5, 2); break; - case 6: world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 6, 2); break; - case 7: world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 7,2); break; - case 8: world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 8,2); break; - case 9: world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 9,2); break; - case 10:world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 10,2); break; - case 11:world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 11, 2); break; + case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: + world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, pointer, 2); break; default:world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 12, 2); } } else world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 15,2); @@ -791,4 +784,21 @@ public class Util { public static String getUniqueIdentifier(ItemStack is) { return GameRegistry.findUniqueIdentifierFor(is.getItem()).modId + ":" + is.getUnlocalizedName(); } + + + public static final String[] VN = new String[]{"ULV", "LV", "MV", "HV", "EV", "IV", "LuV", "ZPM", "UV", "UHV", "UEV", "UIV", "UMV", "UXV", "OpV", "MAX"}; + public static final long[] V = new long[]{8L, 32L, 128L, 512L, 2048L, 8192L, 32768L, 131072L, 524288L, 2097152L, 8388608L, 33554432L, 134217728L, 536870912L, 1073741824L, Integer.MAX_VALUE-7}; + + public static byte getTier(long l) { + byte i = -1; + + do { + ++i; + if (i >= V.length) { + return i; + } + } while(l > V[i]); + + return i; + } } diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/classes/aOredictDequantizationInfo.java b/src/main/java/com/github/technus/tectech/elementalMatter/classes/aOredictDequantizationInfo.java index bd9da066b2..0f71d1e017 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/classes/aOredictDequantizationInfo.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/classes/aOredictDequantizationInfo.java @@ -26,12 +26,18 @@ public class aOredictDequantizationInfo implements iExchangeInfo { amount = qty; } - public aOredictDequantizationInfo(iHasElementalDefinition emIn, OrePrefixes prefix, Materials material, int qty) { + public aOredictDequantizationInfo(iHasElementalDefinition emIn, OrePrefixes prefix, Materials material, int qty) { in = emIn; out = OreDictionary.getOreID(prefix.name() + material.mName); amount = qty; } + public aOredictDequantizationInfo(iHasElementalDefinition emIn, OrePrefixes prefix, String materialName, int qty) { + in = emIn; + out = OreDictionary.getOreID(prefix.name() + materialName); + amount = qty; + } + @Override public iHasElementalDefinition input() { return in.clone();//MEH! diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/classes/aOredictQuantizationInfo.java b/src/main/java/com/github/technus/tectech/elementalMatter/classes/aOredictQuantizationInfo.java index d285fddbdc..61c6a39064 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/classes/aOredictQuantizationInfo.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/classes/aOredictQuantizationInfo.java @@ -32,6 +32,12 @@ public class aOredictQuantizationInfo implements iExchangeInfo { out=emOut; } + public aOredictQuantizationInfo( OrePrefixes prefix, String materialName, int qty, iHasElementalDefinition emOut){ + in=OreDictionary.getOreID(prefix.name() + materialName); + amount=qty; + out=emOut; + } + @Override public Integer input() { return in; diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/classes/bTransformationInfo.java b/src/main/java/com/github/technus/tectech/elementalMatter/classes/bTransformationInfo.java index 9c9b4779ff..5434c65d8f 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/classes/bTransformationInfo.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/classes/bTransformationInfo.java @@ -75,8 +75,13 @@ public class bTransformationInfo { oredictDequantization.put(em.getDefinition(),new aOredictDequantizationInfo(em,name,qty)); } - public void addOredict(iHasElementalDefinition em, OrePrefixes prefix, Materials material, int qty){ + public void addOredict(iHasElementalDefinition em, OrePrefixes prefix, Materials material, int qty){ oredictQuantization.put(OreDictionary.getOreID(prefix.name() + material.mName),new aOredictQuantizationInfo(prefix,material,qty,em)); oredictDequantization.put(em.getDefinition(),new aOredictDequantizationInfo(em,prefix,material,qty)); } + + public void addOredict(iHasElementalDefinition em, OrePrefixes prefix, String materialName, int qty){ + oredictQuantization.put(OreDictionary.getOreID(prefix.name() + materialName),new aOredictQuantizationInfo(prefix,materialName,qty,em)); + oredictDequantization.put(em.getDefinition(),new aOredictDequantizationInfo(em,prefix,materialName,qty)); + } } diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/dAtomDefinition.java b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/dAtomDefinition.java index 81be90e62f..5108c409cd 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/dAtomDefinition.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/dAtomDefinition.java @@ -4,6 +4,8 @@ import com.github.technus.tectech.TecTech; import com.github.technus.tectech.auxiliary.TecTechConfig; import com.github.technus.tectech.elementalMatter.classes.*; import com.github.technus.tectech.elementalMatter.interfaces.iElementalDefinition; +import com.github.technus.tectech.gtppAddon.GtppAtomLoader; +import cpw.mods.fml.common.Loader; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.objects.XSTR; @@ -727,6 +729,8 @@ public final class dAtomDefinition extends cElementalDefinition { } catch (tElementalException e) { if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); } + + if(Loader.isModLoaded("miscutils")) new GtppAtomLoader().run(); } public static dAtomDefinition getFirstStableIsotope(int element) { diff --git a/src/main/java/com/github/technus/tectech/gtppAddon/GtppAtomLoader.java b/src/main/java/com/github/technus/tectech/gtppAddon/GtppAtomLoader.java new file mode 100644 index 0000000000..1cefb4c170 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/gtppAddon/GtppAtomLoader.java @@ -0,0 +1,45 @@ +package com.github.technus.tectech.gtppAddon; + +import com.github.technus.tectech.elementalMatter.classes.cElementalDefinitionStack; +import gregtech.api.enums.OrePrefixes; +import gtPlusPlus.core.material.ELEMENT; +import gtPlusPlus.core.material.MaterialGenerator; + +import static com.github.technus.tectech.elementalMatter.definitions.dAtomDefinition.getBestUnstableIsotope; +import static com.github.technus.tectech.elementalMatter.definitions.dAtomDefinition.getFirstStableIsotope; +import static com.github.technus.tectech.elementalMatter.definitions.dAtomDefinition.transformation; + +public class GtppAtomLoader implements Runnable{ + @Override + public void run() { + transformation.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(10), 144), ELEMENT.getInstance().NEON.getFluid(144)); + MaterialGenerator.generate(ELEMENT.getInstance().GERMANIUM); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(32), 144), OrePrefixes.dust, ELEMENT.getInstance().GERMANIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(34), 144), OrePrefixes.dust, ELEMENT.getInstance().SELENIUM.getUnlocalizedName(),1); + transformation.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(35), 144), ELEMENT.getInstance().BROMINE.getFluid(144)); + transformation.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(36), 144), ELEMENT.getInstance().KRYPTON.getFluid(144)); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(40), 144),OrePrefixes.dust, ELEMENT.getInstance().ZIRCONIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(43), 144),OrePrefixes.dust, ELEMENT.getInstance().TECHNETIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(44), 144),OrePrefixes.dust, ELEMENT.getInstance().RUTHENIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(45), 144),OrePrefixes.dust, ELEMENT.getInstance().RHODIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(53), 144),OrePrefixes.dust, ELEMENT.getInstance().IODINE.getUnlocalizedName(),1); + transformation.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(54), 144),ELEMENT.getInstance().XENON.getFluid(144)); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(72), 144),OrePrefixes.dust, ELEMENT.getInstance().HAFNIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(75), 144),OrePrefixes.dust, ELEMENT.getInstance().RHENIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(81), 144),OrePrefixes.dust, ELEMENT.getInstance().THALLIUM.getUnlocalizedName(),1); + + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(84),144),OrePrefixes.dust, ELEMENT.getInstance().POLONIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(85),144),OrePrefixes.dust, ELEMENT.getInstance().ASTATINE.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(87),144),OrePrefixes.dust, ELEMENT.getInstance().FRANCIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(88),144),OrePrefixes.dust, ELEMENT.getInstance().RADIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(89),144),OrePrefixes.dust, ELEMENT.getInstance().ACTINIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(91),144),OrePrefixes.dust, ELEMENT.getInstance().PROTACTINIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(93),144),OrePrefixes.dust, ELEMENT.getInstance().NEPTUNIUM.getUnlocalizedName(),1); + + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(96),144),OrePrefixes.dust, ELEMENT.getInstance().CURIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(97),144),OrePrefixes.dust, ELEMENT.getInstance().BERKELIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(98),144),OrePrefixes.dust, ELEMENT.getInstance().CALIFORNIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(99),144),OrePrefixes.dust, ELEMENT.getInstance().EINSTEINIUM.getUnlocalizedName(),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(100),144),OrePrefixes.dust, ELEMENT.getInstance().FERMIUM.getUnlocalizedName(),1); + } +} diff --git a/src/main/java/com/github/technus/tectech/loader/BloodyRecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/BloodyRecipeLoader.java new file mode 100644 index 0000000000..b07aeb9bd8 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/loader/BloodyRecipeLoader.java @@ -0,0 +1,11 @@ +package com.github.technus.tectech.loader; + +/** + * Created by Tec on 06.08.2017. + */ +public class BloodyRecipeLoader implements Runnable { + @Override + public void run() { + + } +} diff --git a/src/main/java/com/github/technus/tectech/loader/RecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/RecipeLoader.java index cfa6191a6f..3e99920c9e 100644 --- a/src/main/java/com/github/technus/tectech/loader/RecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/RecipeLoader.java @@ -1,11 +1,7 @@ package com.github.technus.tectech.loader; import com.github.technus.tectech.elementalMatter.definitions.dAtomDefinition; -import com.github.technus.tectech.recipe.TT_recipeAdder; import cpw.mods.fml.common.Loader; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; /** * Created by danie_000 on 16.11.2016. @@ -21,11 +17,6 @@ public class RecipeLoader implements Runnable { if (Loader.isModLoaded("dreamcraft")) new DreamCraftRecipeLoader().run();//TODO init recipes for GTNH version - else runBloodRun();//TODO init recipes for NON-GTNH version - } - - private void runBloodRun(){ - //Don't init things after UV!!! They don't conform to the standards. - TT_recipeAdder.addResearchableAssemblylineRecipe(new ItemStack(Blocks.stone),100,new ItemStack[]{new ItemStack(Blocks.cobblestone)},null,new ItemStack(Blocks.stone),30,30); + else new BloodyRecipeLoader().run();//TODO init recipes for NON-GTNH version } } diff --git a/src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java b/src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java index f33d486662..4b92fd0509 100644 --- a/src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java +++ b/src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java @@ -1,47 +1,58 @@ package com.github.technus.tectech.magicAddon.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.TecTech; import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStack; import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStackMap; import com.github.technus.tectech.magicAddon.definitions.ePrimalAspectDefinition; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.casing.TT_Container_Casings; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_MultiblockBase_EM; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; +import net.minecraft.block.material.Material; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.common.util.ForgeDirection; import static com.github.technus.tectech.Util.StructureBuilder; import static com.github.technus.tectech.magicAddon.EssentiaCompat.essentiaContainerCompat; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static gregtech.api.enums.GT_Values.E; -import static gregtech.api.enums.GT_Values.V; +import static com.github.technus.tectech.Util.V; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { private TileEntity container; //region Structure //use multi A energy inputs, use less power the longer it runs private static final String[][] shape = new String[][]{ - {"!!!","!.!","!!!",}, + {" "," . "," ",}, {"0A0",E,"0A0",}, {"121","232","121",}, {"\"\"\"","\"2\"","\"\"\"",}, - {"202","0 0","202",}, + {"202","0!0","202",}, }; private static final Block[] blockType = new Block[]{QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{0,0,4,10}; - private static final String[] addingMethods = new String[]{"addElementalInputToMachineList", "addClassicToMachineList", "addElementalMufflerToMachineList"}; - private static final short[] casingTextures = new short[]{textureOffset + 4, textureOffset, textureOffset + 4}; + private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalInputToMachineList", "addElementalMufflerToMachineList"}; + private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; - private static final byte[] blockMetaFallback = new byte[]{4, 0, 4}; + private static final byte[] blockMetaFallback = new byte[]{0, 4, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Input Hatch", + "3 - Elemental Overflow Hatches or Elemental Casing", + "General - Some sort of Essentia Storage", + }; //endregion public GT_MetaTileEntity_EM_essentiaDequantizer(int aID, String aName, String aNameRegional) { @@ -62,8 +73,31 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ } @Override - public void construct(int qty, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta,1, 1, 0, getBaseMetaTileEntity(),hintsOnly); + public void construct(int stackSize, boolean hintsOnly) { + IGregTechTileEntity iGregTechTileEntity=getBaseMetaTileEntity(); + int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX; + int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY; + int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ; + if(hintsOnly){ + TecTech.proxy.hint_particle(iGregTechTileEntity.getWorld(), + iGregTechTileEntity.getXCoord()+xDir, + iGregTechTileEntity.getYCoord()+yDir, + iGregTechTileEntity.getZCoord()+zDir, + TT_Container_Casings.sHintCasingsTT,12); + } else{ + if(iGregTechTileEntity.getBlockOffset(xDir,0,zDir).getMaterial() == Material.air) + iGregTechTileEntity.getWorld().setBlock( + iGregTechTileEntity.getXCoord()+xDir, + iGregTechTileEntity.getYCoord()+yDir, + iGregTechTileEntity.getZCoord()+zDir, + TT_Container_Casings.sHintCasingsTT,12,2); + } + StructureBuilder(shape, blockType, blockMeta,1, 1, 0, iGregTechTileEntity,hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; } @Override diff --git a/src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java b/src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java index 85da98508d..2d484c8815 100644 --- a/src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java +++ b/src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java @@ -1,47 +1,58 @@ package com.github.technus.tectech.magicAddon.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.TecTech; import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStack; import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStackMap; import com.github.technus.tectech.magicAddon.definitions.ePrimalAspectDefinition; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.casing.TT_Container_Casings; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_MultiblockBase_EM; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; +import net.minecraft.block.material.Material; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.common.util.ForgeDirection; import static com.github.technus.tectech.Util.StructureBuilder; import static com.github.technus.tectech.magicAddon.EssentiaCompat.essentiaContainerCompat; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static gregtech.api.enums.GT_Values.E; -import static gregtech.api.enums.GT_Values.V; +import static com.github.technus.tectech.Util.V; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { private TileEntity container; //region Structure //use multi A energy inputs, use less power the longer it runs private static final String[][] shape = new String[][]{ - {"!!!","!.!","!!!",}, + {" "," . "," ",}, {"0A0",E,"0A0",}, {"121","232","121",}, {"\"\"\"","\"1\"","\"\"\"",}, - {"010","1 1","010",}, + {"010","1!1","010",}, }; private static final Block[] blockType = new Block[]{QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{0,4,0,10}; - private static final String[] addingMethods = new String[]{"addElementalOutputToMachineList", "addClassicToMachineList", "addElementalMufflerToMachineList"}; - private static final short[] casingTextures = new short[]{textureOffset + 4, textureOffset, textureOffset + 4}; + private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalOutputToMachineList", "addElementalMufflerToMachineList"}; + private static final short[] casingTextures = new short[]{textureOffset, textureOffset+4, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; - private static final byte[] blockMetaFallback = new byte[]{4, 0, 4}; + private static final byte[] blockMetaFallback = new byte[]{0, 4, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Output Hatch", + "3 - Elemental Overflow Hatches or Elemental Casing", + "General - Some sort of Essentia Storage", + }; //endregion public GT_MetaTileEntity_EM_essentiaQuantizer(int aID, String aName, String aNameRegional) { @@ -62,8 +73,31 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu } @Override - public void construct(int qty, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta,1, 1, 0, getBaseMetaTileEntity(),hintsOnly); + public void construct(int stackSize, boolean hintsOnly) { + IGregTechTileEntity iGregTechTileEntity=getBaseMetaTileEntity(); + int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX; + int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY; + int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ; + if(hintsOnly){ + TecTech.proxy.hint_particle(iGregTechTileEntity.getWorld(), + iGregTechTileEntity.getXCoord()+xDir, + iGregTechTileEntity.getYCoord()+yDir, + iGregTechTileEntity.getZCoord()+zDir, + TT_Container_Casings.sHintCasingsTT,12); + } else{ + if(iGregTechTileEntity.getBlockOffset(xDir,0,zDir).getMaterial() == Material.air) + iGregTechTileEntity.getWorld().setBlock( + iGregTechTileEntity.getXCoord()+xDir, + iGregTechTileEntity.getYCoord()+yDir, + iGregTechTileEntity.getZCoord()+zDir, + TT_Container_Casings.sHintCasingsTT,12,2); + } + StructureBuilder(shape, blockType, blockMeta,1, 1, 0, iGregTechTileEntity,hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; } @Override diff --git a/src/main/java/com/github/technus/tectech/nei/NEI_TT_Config.java b/src/main/java/com/github/technus/tectech/nei/NEI_TT_Config.java new file mode 100644 index 0000000000..443a069d2e --- /dev/null +++ b/src/main/java/com/github/technus/tectech/nei/NEI_TT_Config.java @@ -0,0 +1,25 @@ +package com.github.technus.tectech.nei; + +import codechicken.nei.api.IConfigureNEI; +import com.github.technus.tectech.recipe.TT_recipe; +import cpw.mods.fml.common.FMLCommonHandler; + +public class NEI_TT_Config implements IConfigureNEI {//must be NEI*Config + public static boolean sIsAdded = true; + public static TT_NEI_ResearchHandler TT_RH; + + public void loadConfig() { + sIsAdded = false; + if(FMLCommonHandler.instance().getEffectiveSide().isClient()) + TT_RH =new TT_NEI_ResearchHandler(TT_recipe.TT_Recipe_Map.sResearchableFakeRecipes); + sIsAdded = true; + } + + public String getName() { + return "TecTech NEI Plugin"; + } + + public String getVersion() { + return "(1.0)"; + } +} diff --git a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java index cfcc0057b8..54035707ca 100644 --- a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java +++ b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java @@ -9,11 +9,10 @@ import codechicken.nei.recipe.GuiCraftingRecipe; import codechicken.nei.recipe.GuiRecipe; import codechicken.nei.recipe.GuiUsageRecipe; import codechicken.nei.recipe.TemplateRecipeHandler; +import com.github.technus.tectech.TecTech; import com.github.technus.tectech.auxiliary.Reference; import com.github.technus.tectech.recipe.TT_recipe; import cpw.mods.fml.common.event.FMLInterModComms; -import gregtech.GT_Mod; -import gregtech.api.enums.GT_Values; import gregtech.api.enums.OrePrefixes; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.objects.ItemData; @@ -22,8 +21,6 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.gui.GT_GUIContainer_FusionReactor; -import gregtech.nei.GT_NEI_DefaultHandler; -import gregtech.nei.NEI_GT_Config; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.init.Blocks; @@ -51,9 +48,9 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler { public TT_NEI_ResearchHandler(TT_recipe.TT_Recipe_Map aRecipeMap) { this.mRecipeMap = aRecipeMap; - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), getOverlayIdentifier(), new Object[0])); - if (!NEI_GT_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", Reference.MODID+"@" + getRecipeName() + "@" + getOverlayIdentifier()); + this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), getOverlayIdentifier())); + if (!NEI_TT_Config.sIsAdded) { + FMLInterModComms.sendRuntimeMessage(TecTech.instance, "NEIPlugins", "register-crafting-handler", Reference.MODID+"@" + getRecipeName() + "@" + getOverlayIdentifier()); GuiCraftingRecipe.craftinghandlers.add(this); GuiUsageRecipe.usagehandlers.add(this); } @@ -70,8 +67,8 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler { } public TemplateRecipeHandler newInstance() { - TT_NEI_config.TT_RH=new TT_NEI_ResearchHandler(mRecipeMap); - return TT_NEI_config.TT_RH; + NEI_TT_Config.TT_RH=new TT_NEI_ResearchHandler(mRecipeMap); + return NEI_TT_Config.TT_RH; } public void loadCraftingRecipes(String outputId, Object... results) { @@ -102,7 +99,7 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler { tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false)); for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { if (tData.fluid.isFluidEqual(tFluid)) { - tResults.add(GT_Utility.copy(new Object[]{tData.filledContainer})); + tResults.add(GT_Utility.copy(tData.filledContainer)); } } } @@ -136,7 +133,7 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler { tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false)); for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { if (tData.fluid.isFluidEqual(tFluid)) { - tInputs.add(GT_Utility.copy(new Object[]{tData.filledContainer})); + tInputs.add(GT_Utility.copy(tData.filledContainer)); } } } @@ -178,7 +175,7 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler { } public List handleItemTooltip(GuiRecipe gui, ItemStack aStack, List currenttip, int aRecipeIndex) { - TemplateRecipeHandler.CachedRecipe tObject = (TemplateRecipeHandler.CachedRecipe) this.arecipes.get(aRecipeIndex); + TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex); if ((tObject instanceof CachedDefaultRecipe)) { CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject; for (PositionedStack tStack : tRecipe.mOutputs) { @@ -206,35 +203,24 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler { public void drawExtras(int aRecipeIndex) { int tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; - int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; + int computation = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; String[] recipeDesc = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.getNeiDesc(); if (recipeDesc == null) { + int tSpecial = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue; + short ampere=(short) (tSpecial & 0xFFFF),minComputationPerSec=(short)(tSpecial>>>16); if (tEUt != 0) { - drawText(10, 73, trans("152","Total: ") + tDuration * tEUt + " EU", -16777216); - drawText(10, 83, trans("153","Usage: ") + tEUt + " EU/t", -16777216); + drawText(10, 73, trans("152","Max Total: ") + ((1+((computation-minComputationPerSec)/minComputationPerSec)) * (long)tEUt * ampere * 20) + " EU", -16777216); + drawText(10, 83, trans("153","Usage: ") + ((long)tEUt*ampere) + " EU/t", -16777216); if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText(10, 93, trans("154","Voltage: ") + tEUt / this.mRecipeMap.mAmperage + " EU", -16777216); - drawText(10, 103, trans("155","Amperage: ") + this.mRecipeMap.mAmperage, -16777216); + drawText(10, 93, trans("154","Voltage: ") + tEUt + " EU", -16777216); + drawText(10, 103, trans("155","Amperage: ") + ampere, -16777216); } else { drawText(10, 93, trans("156","Voltage: unspecified"), -16777216); drawText(10, 103, trans("157","Amperage: unspecified"), -16777216); } } - if (tDuration > 0) { - drawText(10, 113, "Computation: "+String.format("%.2f ", 0.05F * tDuration), -16777216); - } - int tSpecial = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue; - if (tSpecial == -100 && GT_Mod.gregtechproxy.mLowGravProcessing) { - drawText(10, 123, trans("159","Needs Low Gravity"), -16777216); - } else if (tSpecial == -200 && GT_Mod.gregtechproxy.mEnableCleanroom) { - drawText(10, 123, trans("160","Needs Cleanroom"), -16777216); - } else if (tSpecial == -300 && GT_Mod.gregtechproxy.mEnableCleanroom) { - drawText(10, 123, trans("160","Needs Cleanroom & LowGrav"), -16777216); - } else if (tSpecial == -400) { - drawText(10, 123, trans("161", "Circuit slot can be left empty"), -16777216); - } else if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { - drawText(10, 123, this.mRecipeMap.mNEISpecialValuePre + tSpecial * this.mRecipeMap.mNEISpecialValueMultiplier + this.mRecipeMap.mNEISpecialValuePost, -16777216); - } + drawText(10, 113, "Computation: "+computation, -16777216); + drawText(10, 123, "Min Computation: "+minComputationPerSec + " /s", -16777216); } else { int i = 0; for (String descLine : recipeDesc) { @@ -280,9 +266,9 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler { private boolean transferRect(GuiContainer gui, boolean usage) { if (gui instanceof GT_GUIContainer_BasicMachine) { - return (canHandle(gui)) && (new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0])); + return (canHandle(gui)) && (new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI)); } else if (gui instanceof GT_GUIContainer_FusionReactor) { - return (canHandle(gui)) && (new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0])); + return (canHandle(gui)) && (new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI)); } return false; } @@ -343,7 +329,7 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler { List permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem()); if (!permutations.isEmpty()) { ItemStack stack; - for (Iterator i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[]{stack}))) { + for (Iterator i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, stack))) { stack = (ItemStack) i$.next(); } } else { @@ -352,11 +338,11 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler { tDisplayStacks.add(base); } } else { - tDisplayStacks.add(GT_Utility.copy(new Object[]{tStack})); + tDisplayStacks.add(GT_Utility.copy(tStack)); } } } - this.items = ((ItemStack[]) tDisplayStacks.toArray(new ItemStack[0])); + this.items = tDisplayStacks.toArray(new ItemStack[0]); if (this.items.length == 0) { this.items = new ItemStack[]{new ItemStack(Blocks.fire)}; } @@ -374,448 +360,442 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler { public CachedDefaultRecipe(GT_Recipe aRecipe) { super(); this.mRecipe = aRecipe; - - if (aRecipe.getInputPositionedStacks() != null && aRecipe.getOutputPositionedStacks() != null) { - mInputs = aRecipe.getInputPositionedStacks(); - mOutputs = aRecipe.getOutputPositionedStacks(); - return; - } mOutputs = new ArrayList<>(); mInputs = new ArrayList<>(); int tStartIndex = 0; - switch (mRecipeMap.mUsualInputCount) { - case 0: - break; - case 1: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - } - tStartIndex++; - break; - case 2: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - } - tStartIndex++; - break; - case 3: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - } - tStartIndex++; - break; - case 4: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 5)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 5)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 23)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 23)); - } - tStartIndex++; - break; - case 5: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 5)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 5)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 5)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 23)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 23)); - } - tStartIndex++; - break; - case 6: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 5)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 5)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 5)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 23)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 23)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 23)); - } - tStartIndex++; - break; - case 7: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, -4)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, -4)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, -4)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 32)); - } - tStartIndex++; - break; - case 8: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, -4)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, -4)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, -4)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 32)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 32)); - } - tStartIndex++; - break; - default: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, -4)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, -4)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, -4)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 32)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 32)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 32)); - } - tStartIndex++; - } + //switch (mRecipeMap.mUsualInputCount) { + //case 0: + // break; + //case 1: + if (aRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14+9)); + } + //tStartIndex++; + //break; + //case 2: + // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { + // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); + // } + // tStartIndex++; + // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { + // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); + // } + // tStartIndex++; + // break; + //case 3: + // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { + // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); + // } + // tStartIndex++; + // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +