diff options
57 files changed, 1466 insertions, 846 deletions
diff --git a/.gitignore b/.gitignore index 9d0e3b5ecd..4442a696a9 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ SetupDevWorkspaces.bat *.iml *.ipr *.iws +*.bat diff --git a/build.gradle b/build.gradle index d8aac059a3..414af8c300 100644 --- a/build.gradle +++ b/build.gradle @@ -66,6 +66,10 @@ repositories { name 'CoFHCore' artifactPattern "http://addons-origin.cursecdn.com/files/${config.cofhcore.cf}/[module]-[revision].[ext]" } + maven { + name = "chickenbones" + url = "http://chickenbones.net/maven/" + } } dependencies { @@ -73,6 +77,9 @@ dependencies { compile "net.industrial-craft:industrialcraft-2:${config.ic2.version}:dev" provided name: 'CoFHLib', version: config.cofhlib.version, ext: 'jar' provided name: 'CoFHCore', version: config.cofhcore.version, ext: 'jar' + compile "codechicken:CodeChickenLib:${config.minecraft.version}-${config.codechickenlib.version}:dev" + compile "codechicken:CodeChickenCore:${config.minecraft.version}-${config.codechickencore.version}:dev" + compile "codechicken:NotEnoughItems:${config.minecraft.version}-${config.nei.version}:dev" } task getGregTech(type: Download) { diff --git a/build.properties b/build.properties index 5bcb388e16..09573af24f 100644 --- a/build.properties +++ b/build.properties @@ -3,12 +3,14 @@ forge.version=10.13.4.1614-1.7.10 tectech.version=3.4.5 ic2.version=2.2.790-experimental -nei.version=1.0.3.74 -gregtech.jenkinsbuild=718 -gregtech.version=5.09.31.22 +codechickenlib.version=1.1.3.140 +codechickencore.version=1.0.7.47 +nei.version=1.0.5.120 +gregtech.jenkinsbuild=749 +gregtech.version=5.09.31.25 cofhcore.cf=2246/920 cofhcore.version=[1.7.10]3.0.3-303-dev cofhlib.cf=2246/918 cofhlib.version=[1.7.10]1.0.3-175-dev -yamcore.version=0.5.74
\ No newline at end of file +yamcore.version=0.5.76
\ No newline at end of file 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/TT_NEI_config.java b/src/main/java/com/github/technus/tectech/nei/NEI_TT_Config.java index a6b729f407..443a069d2e 100644 --- a/src/main/java/com/github/technus/tectech/nei/TT_NEI_config.java +++ b/src/main/java/com/github/technus/tectech/nei/NEI_TT_Config.java @@ -4,7 +4,7 @@ import codechicken.nei.api.IConfigureNEI; import com.github.technus.tectech.recipe.TT_recipe; import cpw.mods.fml.common.FMLCommonHandler; -public class TT_NEI_config implements IConfigureNEI { +public class NEI_TT_Config implements IConfigureNEI {//must be NEI*Config public static boolean sIsAdded = true; public static TT_NEI_ResearchHandler TT_RH; @@ -16,10 +16,10 @@ public class TT_NEI_config implements IConfigureNEI { } public String getName() { - return "GregTech NEI Plugin"; + return "TecTech NEI Plugin"; } public String getVersion() { - return "(5.03a)"; + 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<String> handleItemTooltip(GuiRecipe gui, ItemStack aStack, List<String> 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<ItemStack> 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) { + // 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++; + //} if (aRecipe.mSpecialItems != null) { this.mInputs.add(new FixedPositionedStack(aRecipe.mSpecialItems, 120, 52)); } - tStartIndex = 0; - switch (mRecipeMap.mUsualOutputCount) { - case 0: - break; - case 1: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - break; - case 2: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - break; - case 3: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - break; - case 4: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - break; - case 5: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 5, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - break; - case 6: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 5, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 23, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - break; - case 7: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - break; - case 8: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 32, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - break; - default: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 32, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 32, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - } - if ((aRecipe.mFluidInputs.length > 0) && (aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 48, 52)); - if ((aRecipe.mFluidInputs.length > 1) && (aRecipe.mFluidInputs[1] != null) && (aRecipe.mFluidInputs[1].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[1], true), 30, 52)); - } - } - if (aRecipe.mFluidOutputs.length > 1) { - if (aRecipe.mFluidOutputs[0] != null && (aRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 120, 5)); - } - if (aRecipe.mFluidOutputs[1] != null && (aRecipe.mFluidOutputs[1].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[1], true), 138, 5)); - } - if (aRecipe.mFluidOutputs.length > 2 && aRecipe.mFluidOutputs[2] != null && (aRecipe.mFluidOutputs[2].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[2], true), 102, 23)); - } - if (aRecipe.mFluidOutputs.length > 3 && aRecipe.mFluidOutputs[3] != null && (aRecipe.mFluidOutputs[3].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[3], true), 120, 23)); - } - if (aRecipe.mFluidOutputs.length > 4 && aRecipe.mFluidOutputs[4] != null && (aRecipe.mFluidOutputs[4].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[4], true), 138, 23)); - } - } else if ((aRecipe.mFluidOutputs.length > 0) && (aRecipe.mFluidOutputs[0] != null) && (aRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 102, 52)); - } + //tStartIndex = 0; + //switch (mRecipeMap.mUsualOutputCount) { + //case 0: + // break; + //case 1: + if (aRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14+9, aRecipe.getOutputChance(tStartIndex))); + } + //tStartIndex++; + //break; + //case 2: + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // break; + //case 3: + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // break; + //case 4: + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // break; + //case 5: + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 5, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // break; + //case 6: + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 5, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 23, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // break; + //case 7: + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // break; + //case 8: + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 32, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // break; + //default: + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 32, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + // if (aRecipe.getOutput(tStartIndex) != null) { + // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 32, aRecipe.getOutputChance(tStartIndex))); + // } + // tStartIndex++; + //} + //if ((aRecipe.mFluidInputs.length > 0) && (aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) { + // this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 48, 52)); + // if ((aRecipe.mFluidInputs.length > 1) && (aRecipe.mFluidInputs[1] != null) && (aRecipe.mFluidInputs[1].getFluid() != null)) { + // this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[1], true), 30, 52)); + // } + //} + //if (aRecipe.mFluidOutputs.length > 1) { + // if (aRecipe.mFluidOutputs[0] != null && (aRecipe.mFluidOutputs[0].getFluid() != null)) { + // this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 120, 5)); + // } + // if (aRecipe.mFluidOutputs[1] != null && (aRecipe.mFluidOutputs[1].getFluid() != null)) { + // this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[1], true), 138, 5)); + // } + // if (aRecipe.mFluidOutputs.length > 2 && aRecipe.mFluidOutputs[2] != null && (aRecipe.mFluidOutputs[2].getFluid() != null)) { + // this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[2], true), 102, 23)); + // } + // if (aRecipe.mFluidOutputs.length > 3 && aRecipe.mFluidOutputs[3] != null && (aRecipe.mFluidOutputs[3].getFluid() != null)) { + // this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[3], true), 120, 23)); + // } + // if (aRecipe.mFluidOutputs.length > 4 && aRecipe.mFluidOutputs[4] != null && (aRecipe.mFluidOutputs[4].getFluid() != null)) { + // this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[4], true), 138, 23)); + // } + //} else if ((aRecipe.mFluidOutputs.length > 0) && (aRecipe.mFluidOutputs[0] != null) && (aRecipe.mFluidOutputs[0].getFluid() != null)) { + // this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 102, 52)); + //} } public List<PositionedStack> getIngredients() { diff --git a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java index 3fc49def16..ab1307cb3e 100644 --- a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java @@ -13,10 +13,12 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiNewChat; import net.minecraft.client.particle.EntityExplodeFX; import net.minecraft.client.particle.EntityFX; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; +import net.minecraft.util.ChatComponentText; import net.minecraft.world.World; import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.common.util.ForgeDirection; @@ -110,4 +112,12 @@ public class ClientProxy extends CommonProxy { } else fontRenderer.drawSplitString(str, x, y, maxWidth, color); } + + @Override + public void printInchat(String... strings) { + GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI(); + for (String s : strings) { + chat.printChatMessage(new ChatComponentText(s)); + } + } } diff --git a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java index efba0f1fda..6bc3fb026e 100644 --- a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java @@ -40,4 +40,6 @@ public class CommonProxy implements IGuiHandler { public void broadcast(String str) { MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText(str)); } + + public void printInchat(String... strings){} } diff --git a/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java b/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java index c223446813..f131dde200 100644 --- a/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java +++ b/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java @@ -1,18 +1,13 @@ package com.github.technus.tectech.recipe; -import gregtech.api.GregTech_API; -import gregtech.api.enums.ItemList; import gregtech.api.util.GT_Recipe; -import gregtech.common.GT_RecipeAdder; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; import java.util.Collection; import java.util.HashSet; public class TT_recipe /*extends GT_Recipe*/ { public static class TT_Recipe_Map extends GT_Recipe.GT_Recipe_Map { - public static TT_Recipe_Map sResearchableFakeRecipes =new TT_Recipe_Map(new HashSet(300), "gt.recipe.researchStation", "Research station", (String)null, "gregtech:textures/gui/basicmachines/Scanner", 1, 1, 1, 0, 1, "", 1, "", true, true); + public static TT_Recipe_Map sResearchableFakeRecipes =new TT_Recipe_Map(new HashSet(30), "gt.recipe.researchStation", "Research station", (String)null, "gregtech:textures/gui/multimachines/ResearchFake", 1, 1, 1, 0, 1, "", 1, "", true, false);//nei to false - using custom handler public TT_Recipe_Map (Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); diff --git a/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java b/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java index 688a01175b..460a9aa056 100644 --- a/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java +++ b/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java @@ -8,11 +8,13 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; public class TT_recipeAdder extends GT_RecipeAdder { - public static boolean addResearchableAssemblylineRecipe(ItemStack aResearchItem, int computationRequired, ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt) { - if ((aResearchItem==null)||(computationRequired<=0)||(aInputs == null) || (aOutput == null) || aInputs.length>15 || aInputs.length<4) { + public static boolean addResearchableAssemblylineRecipe(ItemStack aResearchItem, int totalComputationRequired, int computationRequiredPerSec, int researchEUt, int researchAmperage, ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput, int assDuration, int assEUt) { + if(aInputs==null)aInputs=new ItemStack[0]; + if(aFluidInputs==null)aFluidInputs=new FluidStack[0]; + if ((aResearchItem==null)||(totalComputationRequired<=0)||(aOutput == null) || aInputs.length>15) { return false; } - if ((aDuration = GregTech_API.sRecipeFile.get("assemblingline", aOutput, aDuration)) <= 0) { + if ((assDuration = GregTech_API.sRecipeFile.get("assemblingline", aOutput, assDuration)) <= 0) { return false; } for(ItemStack tItem : aInputs){ @@ -20,9 +22,13 @@ public class TT_recipeAdder extends GT_RecipeAdder { System.out.println("addAssemblingLineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); } } - TT_recipe.TT_Recipe_Map.sResearchableFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Writes Research result")}, null, null, computationRequired, 30, 0); - GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe(false, aInputs, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Reads Research result")}, aFluidInputs, null, aDuration, aEUt, 0,true); - GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe.GT_Recipe_AssemblyLine( aResearchItem, 0/*ignored*/, aInputs, aFluidInputs, aOutput, aDuration, aEUt)); + if(researchAmperage<=0) researchAmperage=1; + else if(researchAmperage > Short.MAX_VALUE) researchAmperage=Short.MAX_VALUE; + if(computationRequiredPerSec<=0) computationRequiredPerSec=1; + else if(computationRequiredPerSec > Short.MAX_VALUE) computationRequiredPerSec=Short.MAX_VALUE; + TT_recipe.TT_Recipe_Map.sResearchableFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Writes Research result")}, null, null, totalComputationRequired, researchEUt, researchAmperage|(computationRequiredPerSec<<16)); + GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe(false, aInputs, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Reads Research result")}, aFluidInputs, null, assDuration, assEUt, 0,true); + GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe.GT_Recipe_AssemblyLine( aResearchItem, 0/*ignored*/, aInputs, aFluidInputs, aOutput, assDuration, assEUt)); return true; } diff --git a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java index 9bd92d53e3..f96a104ce9 100644 --- a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java +++ b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java @@ -36,7 +36,7 @@ public enum CustomItemList implements IItemContainer { Machine_Multi_Transformer, Machine_Multi_Computer, Machine_Multi_Microwave, Machine_Multi_Infuser, Machine_Multi_Switch, Machine_Multi_BHG, Machine_Multi_Annihilation, Machine_Multi_Decay, Machine_Multi_EMmachine, Machine_Multi_Stabilizer, Machine_Multi_Collider, Machine_Multi_Wormhole, Machine_Multi_EMCrafter, Machine_Multi_Scanner, Machine_Multi_Research, - hint_0,hint_1,hint_2,hint_3,hint_4,hint_5,hint_6,hint_7,hint_8,hint_9,hint_10,hint_11,hint_default,hint_air,hint_noAir,hint_error; + hint_0,hint_1,hint_2,hint_3,hint_4,hint_5,hint_6,hint_7,hint_8,hint_9,hint_10,hint_11, hint_general,hint_air,hint_noAir,hint_error; private ItemStack mStack = null; diff --git a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_HintTT.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_HintTT.java index 796c37a0ee..4e4d6ba3b3 100644 --- a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_HintTT.java +++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_HintTT.java @@ -23,7 +23,7 @@ public class GT_Block_HintTT extends GT_Block_Casings_Abstract { private static IIcon hint[] = new IIcon[16]; public GT_Block_HintTT() { - super(GT_Item_CasingsTT.class, "gt.blockhintTT", GT_Material_Casings.INSTANCE); + super(GT_Item_HintTT.class, "gt.blockhintTT", GT_Material_Casings.INSTANCE); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Hint 1 dot");//id is -1 GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Hint 2 dots"); @@ -37,7 +37,7 @@ public class GT_Block_HintTT extends GT_Block_Casings_Abstract { GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "Hint 10 dots"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Hint 11 dots"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Hint 12 dots"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Hint default"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Hint general"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Hint air"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Hint no air"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Hint error"); @@ -55,7 +55,7 @@ public class GT_Block_HintTT extends GT_Block_Casings_Abstract { CustomItemList.hint_9.set(new ItemStack(this, 1, 9)); CustomItemList.hint_10.set(new ItemStack(this, 1, 10)); CustomItemList.hint_11.set(new ItemStack(this, 1, 11)); - CustomItemList.hint_default.set(new ItemStack(this, 1, 12)); + CustomItemList.hint_general.set(new ItemStack(this, 1, 12)); CustomItemList.hint_air.set(new ItemStack(this, 1, 13)); CustomItemList.hint_noAir.set(new ItemStack(this, 1, 14)); CustomItemList.hint_error.set(new ItemStack(this, 1, 15)); diff --git a/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_HintTT.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_HintTT.java index 84f41f0ed7..94e7c23be9 100644 --- a/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_HintTT.java +++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_HintTT.java @@ -23,22 +23,11 @@ public class GT_Item_HintTT extends GT_Item_Casings_Abstract { aList.add(tecMark); aList.add("Helps while building"); switch (aStack.getItemDamage()) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: + case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Placeholder for a certain group."); break; case 12: - aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Default placeholder in case of overflow."); + aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "General placeholder."); break; case 13: aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Make sure it contains Air material."); diff --git a/src/main/java/com/github/technus/tectech/thing/item/ConstructibleTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/ConstructibleTriggerItem.java index edc6f6017b..ceeeadbf5a 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ConstructibleTriggerItem.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ConstructibleTriggerItem.java @@ -1,10 +1,16 @@ package com.github.technus.tectech.thing.item; import com.github.technus.tectech.CommonValues; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace; +import net.minecraft.block.Block; +import net.minecraft.client.entity.EntityClientPlayerMP; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; @@ -12,10 +18,15 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; +import net.minecraftforge.common.util.FakePlayer; +import java.util.HashMap; import java.util.List; +import static com.github.technus.tectech.Util.StructureBuilder; import static com.github.technus.tectech.auxiliary.Reference.MODID; +import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sHintCasingsTT; +import static gregtech.api.GregTech_API.sBlockCasings1; /** * Created by Tec on 15.03.2017. @@ -23,9 +34,10 @@ import static com.github.technus.tectech.auxiliary.Reference.MODID; public class ConstructibleTriggerItem extends Item { public static ConstructibleTriggerItem INSTANCE; + public static HashMap<String,MultiblockInfoContainer> multiblockMap= new HashMap<>(); + private ConstructibleTriggerItem() { super(); - //setMaxStackSize(1); setUnlocalizedName("em.debugBuilder"); setTextureName(MODID + ":itemDebugBuilder"); } @@ -33,46 +45,114 @@ public class ConstructibleTriggerItem extends Item { @Override public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if(tTileEntity==null) return aPlayer instanceof EntityPlayerMP; + if(tTileEntity==null || aPlayer instanceof FakePlayer) return aPlayer instanceof EntityPlayerMP; if (aPlayer instanceof EntityPlayerMP) { + //struct gen if (aPlayer.isSneaking() && aPlayer.capabilities.isCreativeMode) { - if(tTileEntity instanceof IGregTechTileEntity) { + if (tTileEntity instanceof IGregTechTileEntity) { IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); - if (metaTE != null && metaTE instanceof iConstructible) { - ((iConstructible) metaTE).construct(aStack.stackSize, false); - return true; + if (metaTE instanceof IConstructable) { + ((IConstructable) metaTE).construct(aStack.stackSize, false); + } else if (multiblockMap.containsKey(metaTE.getClass().getCanonicalName())) { + multiblockMap.get(metaTE.getClass().getCanonicalName()).construct(aStack.stackSize, false, tTileEntity, ((IGregTechTileEntity) tTileEntity).getFrontFacing()); } - }else if(tTileEntity instanceof iConstructible){ - ((iConstructible) tTileEntity).construct(aStack.stackSize, false); - return true; + } else if (tTileEntity instanceof IConstructable) { + ((IConstructable) tTileEntity).construct(aStack.stackSize, false); + } else if (multiblockMap.containsKey(tTileEntity.getClass().getCanonicalName())) { + multiblockMap.get(tTileEntity.getClass().getCanonicalName()).construct(aStack.stackSize, false, tTileEntity, aSide); } } - } - if(aWorld.isRemote){ + return true; + }else if (aPlayer instanceof EntityClientPlayerMP){//particles and text client side if ((!aPlayer.isSneaking() || !aPlayer.capabilities.isCreativeMode)) { if(tTileEntity instanceof IGregTechTileEntity) { IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); - if (metaTE != null && metaTE instanceof iConstructible) { - ((iConstructible) metaTE).construct(aStack.stackSize, true); - return true; + if (metaTE instanceof IConstructable) { + ((IConstructable) metaTE).construct(aStack.stackSize, true); + TecTech.proxy.printInchat(((IConstructable) metaTE).getStructureDescription(aStack.stackSize)); + return false; + } else if(multiblockMap.containsKey(metaTE.getClass().getCanonicalName())){ + multiblockMap.get(metaTE.getClass().getCanonicalName()).construct(aStack.stackSize,true,tTileEntity,((IGregTechTileEntity) tTileEntity).getFrontFacing()); + TecTech.proxy.printInchat(multiblockMap.get(metaTE.getClass().getCanonicalName()).getDescription(aStack.stackSize)); + return false; + } + } else if(tTileEntity instanceof IConstructable){ + ((IConstructable) tTileEntity).construct(aStack.stackSize,true); + TecTech.proxy.printInchat(((IConstructable) tTileEntity).getStructureDescription(aStack.stackSize)); + return false; + } else if(multiblockMap.containsKey(tTileEntity.getClass().getCanonicalName())){ + multiblockMap.get(tTileEntity.getClass().getCanonicalName()).construct(aStack.stackSize,true,tTileEntity, aSide); + TecTech.proxy.printInchat(multiblockMap.get(tTileEntity.getClass().getCanonicalName()).getDescription(aStack.stackSize)); + return false; + } + } else { + if(tTileEntity instanceof IGregTechTileEntity) { + IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); + if (metaTE instanceof IConstructable) { + TecTech.proxy.printInchat(((IConstructable) metaTE).getStructureDescription(aStack.stackSize)); + return false; + } else if(multiblockMap.containsKey(metaTE.getClass().getCanonicalName())){ + TecTech.proxy.printInchat(multiblockMap.get(metaTE.getClass().getCanonicalName()).getDescription(aStack.stackSize)); + return false; } - } else if(tTileEntity instanceof iConstructible){ - ((iConstructible) tTileEntity).construct(aStack.stackSize,true); + } else if(tTileEntity instanceof IConstructable){ + TecTech.proxy.printInchat(((IConstructable) tTileEntity).getStructureDescription(aStack.stackSize)); + return false; + } else if(multiblockMap.containsKey(tTileEntity.getClass().getCanonicalName())){ + TecTech.proxy.printInchat(multiblockMap.get(tTileEntity.getClass().getCanonicalName()).getDescription(aStack.stackSize)); + return false; } } } - return aPlayer instanceof EntityPlayerMP; + return false; } @Override public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) { aList.add(CommonValues.tecMark); - aList.add("Triggers Constructible Interface"); - aList.add(EnumChatFormatting.BLUE + "Quantity affects construction details"); + aList.add("Triggers Constructable Interface"); + aList.add(EnumChatFormatting.BLUE + "Shows multiblock construction details,"); + aList.add(EnumChatFormatting.BLUE + "just Use on a multiblock controller."); + aList.add(EnumChatFormatting.BLUE + "(Sneak Use in creative to build)"); + aList.add(EnumChatFormatting.BLUE + "Quantity affects tier/mode/type"); } public static void run() { INSTANCE = new ConstructibleTriggerItem(); GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName()); + + multiblockMap.put(GT_MetaTileEntity_ElectricBlastFurnace.class.getCanonicalName(), new MultiblockInfoContainer() { + //region Structure + private final String[][] shape = new String[][]{ + {"000","111","111"," . ",}, + {"0!0","1A1","1A1"," ",}, + {"000","111","111"," ",}, + }; + private final Block[] blockType = new Block[]{sBlockCasings1, sHintCasingsTT}; + private final byte[] blockMeta = new byte[]{11, 12}; + private final String[] desc=new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or Heat Proof Casing", + "2 - Muffler Hatch", + "General - Coil blocks" + }; + //endregion + + @Override + public void construct(int stackSize, boolean hintsOnly, TileEntity tileEntity, int aSide) { + StructureBuilder(shape, blockType, blockMeta, 1, 3, 0, tileEntity, aSide, hintsOnly); + } + + @Override + public String[] getDescription(int stackSize) { + return desc; + } + }); + } + + public abstract static class MultiblockInfoContainer { + public abstract void construct(int stackSize, boolean hintsOnly, TileEntity tileEntity, int aSide); + @SideOnly(Side.CLIENT) + public abstract String[] getDescription(int stackSize); } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/IConstructable.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/IConstructable.java new file mode 100644 index 0000000000..096eab8f58 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/IConstructable.java @@ -0,0 +1,15 @@ +package com.github.technus.tectech.thing.metaTileEntity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * Created by Tec on 24.03.2017. + */ +public interface IConstructable { + void construct(int stackSize, boolean hintsOnly); + + @SideOnly(Side.CLIENT) + String[] getStructureDescription(int stackSize); +} + diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DataConnector.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DataConnector.java index aeb7abb7e6..1d069cb77d 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DataConnector.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DataConnector.java @@ -90,8 +90,7 @@ public abstract class GT_MetaTileEntity_Hatch_DataConnector extends GT_MetaTileE } } - public void moveAround(IGregTechTileEntity aBaseMetaTileEntity) { - } + public abstract void moveAround(IGregTechTileEntity aBaseMetaTileEntity); @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java index a498033264..14a9057c51 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java @@ -6,35 +6,53 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import static gregtech.api.enums.GT_Values.V; +import static com.github.technus.tectech.Util.V; /** * Created by danie_000 on 16.12.2016. */ public class GT_MetaTileEntity_Hatch_DynamoMulti extends GT_MetaTileEntity_Hatch { public final int Amperes; + public final int eTier; + public static ITexture[] overlay; + static{ + try { + overlay=(ITexture[]) GT_Utility.getField(Textures.BlockIcons.class,"OVERLAYS_ENERGY_OUT_POWER").get(null); + }catch (IllegalAccessException | NullPointerException e){ + overlay = Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI; + } + } public GT_MetaTileEntity_Hatch_DynamoMulti(int aID, String aName, String aNameRegional, int aTier, int aAmp) { super(aID, aName, aNameRegional, aTier, 0, "Multiple Ampere Energy Extractor for Multiblocks"); Amperes = aAmp; + eTier=aTier; } - public GT_MetaTileEntity_Hatch_DynamoMulti(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { + //public GT_MetaTileEntity_Hatch_DynamoMulti(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { + // super(aName, aTier, 0, aDescription, aTextures); + // Amperes = aAmp; + // eTier=aTier; + //} + + public GT_MetaTileEntity_Hatch_DynamoMulti(String aName, int aTier, int eTier, int aAmp, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); Amperes = aAmp; + this.eTier=eTier; } @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_OUT_POWER[mTier]}; + return new ITexture[]{aBaseTexture, overlay[mTier]}; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_OUT_POWER[mTier]}; + return new ITexture[]{aBaseTexture, overlay[mTier]}; } @Override @@ -69,17 +87,17 @@ public class GT_MetaTileEntity_Hatch_DynamoMulti extends GT_MetaTileEntity_Hatch @Override public long getMinimumStoredEU() { - return 512 * Amperes; + return 128 * Amperes; } @Override public long maxEUOutput() { - return V[mTier]; + return V[eTier]; } @Override public long maxEUStore() { - return 512L + V[mTier] * 4L * Amperes; + return 512L + V[eTier] * 4L * Amperes; } @Override @@ -89,7 +107,7 @@ public class GT_MetaTileEntity_Hatch_DynamoMulti extends GT_MetaTileEntity_Hatch @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_DynamoMulti(mName, mTier, Amperes, mDescription, mTextures); + return new GT_MetaTileEntity_Hatch_DynamoMulti(mName, mTier, eTier, Amperes, mDescription, mTextures); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java index de33eed0d7..2822a78c23 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java @@ -24,7 +24,7 @@ import net.minecraftforge.fluids.FluidStack; import static com.github.technus.tectech.CommonValues.*; import static gregtech.api.enums.Dyes.MACHINE_METAL; -import static gregtech.api.enums.GT_Values.V; +import static com.github.technus.tectech.Util.V; import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity; /** @@ -41,13 +41,21 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta public float overflowMatter = 0f; public short id = -1; private byte deathDelay = 2; + public final int eTier; public GT_MetaTileEntity_Hatch_ElementalContainer(int aID, String aName, String aNameRegional, int aTier, String descr) { super(aID, aName, aNameRegional, aTier, 0, descr); + eTier=aTier; } - public GT_MetaTileEntity_Hatch_ElementalContainer(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + //public GT_MetaTileEntity_Hatch_ElementalContainer(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + // super(aName, aTier, 0, aDescription, aTextures); + // eTier=aTier; + //} + + public GT_MetaTileEntity_Hatch_ElementalContainer(String aName, int aTier, int eTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); + this.eTier=eTier; } @Override @@ -185,11 +193,11 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta } public int getMaxStacksCount() { - return mTier * 2; + return eTier * 2; } public int getMaxStackSize() { - return mTier * (mTier - 7) * 1000; + return eTier * (eTier - 7) * 1000; } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java index ad65b514d4..734d0ca158 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java @@ -6,36 +6,54 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import static gregtech.api.enums.GT_Values.V; +import static com.github.technus.tectech.Util.V; /** * Created by danie_000 on 16.12.2016. */ public class GT_MetaTileEntity_Hatch_EnergyMulti extends GT_MetaTileEntity_Hatch { public final int Amperes; + public final int eTier; + public static ITexture[] overlay; + static{ + try { + overlay=(ITexture[]) GT_Utility.getField(Textures.BlockIcons.class,"OVERLAYS_ENERGY_IN_POWER").get(null); + }catch (IllegalAccessException | NullPointerException e){ + overlay = Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI; + } + } public GT_MetaTileEntity_Hatch_EnergyMulti(int aID, String aName, String aNameRegional, int aTier, int aAmp) { super(aID, aName, aNameRegional, aTier, 0, "Multiple Ampere Energy Injector for Multiblocks"); Amperes = aAmp; + eTier=aTier; } - public GT_MetaTileEntity_Hatch_EnergyMulti(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { + //public GT_MetaTileEntity_Hatch_EnergyMulti(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { + // super(aName, aTier, 0, aDescription, aTextures); + // Amperes = aAmp; + // eTier=aTier; + //} + + public GT_MetaTileEntity_Hatch_EnergyMulti(String aName, int aTier, int eTier, int aAmp, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); Amperes = aAmp; + this.eTier=eTier; } @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_IN_POWER[mTier]}; + return new ITexture[]{aBaseTexture, overlay[mTier]}; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_IN_POWER[mTier]}; + return new ITexture[]{aBaseTexture, overlay[mTier]}; } @Override @@ -70,17 +88,17 @@ public class GT_MetaTileEntity_Hatch_EnergyMulti extends GT_MetaTileEntity_Hatch @Override public long getMinimumStoredEU() { - return 512L * Amperes; + return 128L * Amperes; } @Override public long maxEUInput() { - return V[mTier]; + return V[eTier]; } @Override public long maxEUStore() { - return 512L + V[mTier] * 4L * Amperes; + return 512L + V[eTier] * 4L * Amperes; } @Override @@ -90,7 +108,7 @@ public class GT_MetaTileEntity_Hatch_EnergyMulti extends GT_MetaTileEntity_Hatch @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_EnergyMulti(mName, mTier, Amperes, mDescription, mTextures); + return new GT_MetaTileEntity_Hatch_EnergyMulti(mName, mTier, eTier, Amperes, mDescription, mTextures); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java index c2b3cd7f3f..4bd0c53a36 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java @@ -112,13 +112,6 @@ public class GT_MetaTileEntity_Hatch_Holder extends GT_MetaTileEntity_Hatch { return 1; } - //@Override - //public void onRemoval() { - // if(mInventory!=null && (heat>0 || (getBaseMetaTileEntity()!=null && getBaseMetaTileEntity().isActive()))) - // for(int i=0;i<mInventory.length;i++) - // mInventory[i]=null; - //} - @Override public String[] getDescription() { return new String[]{ diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java index c0b825d12b..35def63310 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java @@ -12,13 +12,17 @@ public class GT_MetaTileEntity_Hatch_InputElemental extends GT_MetaTileEntity_Ha super(aID, aName, aNameRegional, aTier, "Elemental Input for Multiblocks (" + 1000 * aTier * (aTier - 7) + "U, " + aTier * 2 + " stacks)"); } - public GT_MetaTileEntity_Hatch_InputElemental(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { - super(aName, aTier, aDescription, aTextures); + //public GT_MetaTileEntity_Hatch_InputElemental(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + // super(aName, aTier, aDescription, aTextures); + //} + + public GT_MetaTileEntity_Hatch_InputElemental(String aName, int aTier, int eTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, eTier,aDescription, aTextures); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_InputElemental(mName, mTier, mDescription, mTextures); + return new GT_MetaTileEntity_Hatch_InputElemental(mName, mTier, eTier, mDescription, mTextures); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_MufflerElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_MufflerElemental.java index b934ec90e3..e7c1694bd9 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_MufflerElemental.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_MufflerElemental.java @@ -26,7 +26,7 @@ import net.minecraftforge.common.util.ForgeDirection; import static com.github.technus.tectech.CommonValues.disperseAt; import static com.github.technus.tectech.loader.MainLoader.elementalPollution; import static gregtech.api.enums.Dyes.MACHINE_METAL; -import static gregtech.api.enums.GT_Values.V; +import static com.github.technus.tectech.Util.V; import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity; /** @@ -40,19 +40,30 @@ public class GT_MetaTileEntity_Hatch_MufflerElemental extends GT_MetaTileEntity_ private float overflowMatter = 0f; public final float overflowMax; private final float overflowDisperse; + private final int eTier; public GT_MetaTileEntity_Hatch_MufflerElemental(int aID, String aName, String aNameRegional, int aTier, float max) { super(aID, aName, aNameRegional, aTier, 0, "Disposes excess elemental Matter"); overflowMatter = max / 2; overflowMax = max; overflowDisperse = overflowMax / (float) (30 - aTier); + eTier=aTier; } - public GT_MetaTileEntity_Hatch_MufflerElemental(String aName, int aTier, float max, String aDescription, ITexture[][][] aTextures) { + //public GT_MetaTileEntity_Hatch_MufflerElemental(String aName, int aTier, float max, String aDescription, ITexture[][][] aTextures) { + // super(aName, aTier, 0, aDescription, aTextures); + // overflowMatter = max / 2; + // overflowMax = max; + // overflowDisperse = overflowMax / (float) (30 - aTier); + // eTier=aTier; + //} + + public GT_MetaTileEntity_Hatch_MufflerElemental(String aName, int aTier, int eTier, float max, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); overflowMatter = max / 2; overflowMax = max; overflowDisperse = overflowMax / (float) (30 - aTier); + this.eTier=eTier; } @Override @@ -108,7 +119,7 @@ public class GT_MetaTileEntity_Hatch_MufflerElemental extends GT_MetaTileEntity_ @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_MufflerElemental(mName, mTier, overflowMax, mDescription, mTextures); + return new GT_MetaTileEntity_Hatch_MufflerElemental(mName, mTier, eTier, overflowMax, mDescription, mTextures); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java index 0746fb35c7..b334befcce 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java @@ -15,13 +15,17 @@ public class GT_MetaTileEntity_Hatch_OutputElemental extends GT_MetaTileEntity_H super(aID, aName, aNameRegional, aTier, "Elemental Output for Multiblocks (" + 1000 * aTier * (aTier - 7) + "U, " + aTier * 2 + " stacks)"); } - public GT_MetaTileEntity_Hatch_OutputElemental(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { - super(aName, aTier, aDescription, aTextures); + //public GT_MetaTileEntity_Hatch_OutputElemental(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + // super(aName, aTier, aDescription, aTextures); + //} + + public GT_MetaTileEntity_Hatch_OutputElemental(String aName, int aTier, int eTier,String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, eTier, aDescription, aTextures); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_OutputElemental(mName, mTier, mDescription, mTextures); + return new GT_MetaTileEntity_Hatch_OutputElemental(mName, mTier, eTier, mDescription, mTextures); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/iConstructible.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/iConstructible.java deleted file mode 100644 index 63055a83a1..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/iConstructible.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity; - -/** - * Created by Tec on 24.03.2017. - */ -public interface iConstructible { - void construct(int qty, boolean hintsOnly); -} - diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java index ef2bb0480a..71f17d8fe0 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java @@ -2,7 +2,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; @@ -16,7 +16,7 @@ import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBloc /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region structure private static final String[][] shape = new String[][]{ {"\u0002","D000","C0 0","C0 . 0","C0 0","D000"}, @@ -37,6 +37,11 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Hatches or Molecular Casing", + }; //endregion public GT_MetaTileEntity_EM_annihilation(int aID, String aName, String aNameRegional) { @@ -57,11 +62,16 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl } @Override - public void construct(int qty, boolean hintsOnly) { + public void construct(int stackSize, boolean hintsOnly) { StructureBuilder(shape, blockType, blockMeta, 5, 5, 0,getBaseMetaTileEntity(),hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override public String[] getDescription() { return new String[]{ CommonValues.tecMark, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java index e0ace3f6b5..7c1fa2f0b5 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java @@ -2,7 +2,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -24,7 +24,7 @@ import static gregtech.api.enums.GT_Values.E; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { private static Textures.BlockIcons.CustomIcon ScreenOFF; private static Textures.BlockIcons.CustomIcon ScreenON; @@ -76,6 +76,11 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Hatches or Molecular Casing", + }; //endregion //region Structure dank - glass sphere for the looks @@ -132,25 +137,30 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E @Override public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - //TODO enable later when you implement 3d models - //if(EM_StructureCheckAdvanced(shape2, blockType2, blockMeta2, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 16, 16, 0)){ - // glassDome=true; - // return true; - //} + if(EM_StructureCheckAdvanced(shape2, blockType2, blockMeta2, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 16, 16, 0)){ + glassDome=true; + return true; + } if(EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 16, 16, 0)){ glassDome=false; return true; } + //todo check tiers of hatches!!!! return false; } @Override - public void construct(int qty, boolean hintsOnly) { - if((qty&1)==1) StructureBuilder(shape, blockType, blockMeta,16, 16, 0, getBaseMetaTileEntity(),hintsOnly); + public void construct(int stackSize, boolean hintsOnly) { + if((stackSize &1)==1) StructureBuilder(shape, blockType, blockMeta,16, 16, 0, getBaseMetaTileEntity(),hintsOnly); else StructureBuilder(shape2, blockType2, blockMeta2,16, 16, 0, getBaseMetaTileEntity(),hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aBlockIconRegister) { ScreenOFF = new Textures.BlockIcons.CustomIcon("iconsets/EM_BHG"); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java index a6c6ff4183..115cbc6381 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java @@ -4,7 +4,7 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.casing.TT_Container_Casings; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -28,7 +28,7 @@ import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBloc /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { private static Textures.BlockIcons.CustomIcon ScreenOFF; private static Textures.BlockIcons.CustomIcon ScreenON; private byte eTier = 0; @@ -72,6 +72,14 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4, 4, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Input Hatches or Molecular Casing", + "3 - Elemental Output Hatches or Molecular Casing", + "4 - Elemental Overflow Hatches or Molecular Casing", + "General - Another Controller facing opposite direction", + }; //endregion public GT_MetaTileEntity_EM_collider(int aID, String aName, String aNameRegional) { @@ -155,7 +163,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB } @Override - public void construct(int qty, boolean hintsOnly) { + public void construct(int stackSize, boolean hintsOnly) { IGregTechTileEntity iGregTechTileEntity=getBaseMetaTileEntity(); int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX*4; int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ*4; @@ -173,13 +181,18 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB iGregTechTileEntity.getZCoord()+zDir, TT_Container_Casings.sHintCasingsTT,12,2); } - if ((qty & 1) == 1) + if ((stackSize & 1) == 1) StructureBuilder(shape, blockType, blockMeta1, 11, 1, 18, iGregTechTileEntity,hintsOnly); else StructureBuilder(shape, blockType, blockMeta2, 11, 1, 18, iGregTechTileEntity,hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override public String[] getDescription() { return new String[]{ CommonValues.tecMark, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java index df717c8b90..bb39b661e9 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java @@ -3,13 +3,13 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.Util; +import com.github.technus.tectech.Vec3pos; import com.github.technus.tectech.auxiliary.TecTechConfig; import com.github.technus.tectech.dataFramework.QuantumDataPacket; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputData; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputData; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Rack; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; -import com.github.technus.tectech.Vec3pos; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -27,12 +27,12 @@ import static com.github.technus.tectech.Util.StructureBuilder; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; -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_computer extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { private final ArrayList<GT_MetaTileEntity_Hatch_Rack> eRacks = new ArrayList<>(); private int maxTemp = 0; @@ -47,6 +47,11 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB private static final short[] casingTextures = new short[]{textureOffset + 1, textureOffset + 3}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{1, 3}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic/Data Hatches or Computer casing", + "2 - Rack Hatches or Advanced computer casing", + }; //endregion public GT_MetaTileEntity_EM_computer(int aID, String aName, String aNameRegional) { @@ -105,7 +110,8 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB } mMaxProgresstime = 0; mEfficiencyIncrease = 0; - EM_stopMachine();//to stop all hatches + for (GT_MetaTileEntity_Hatch_Rack r : eRacks) + r.getBaseMetaTileEntity().setActive(false); return false; } @@ -176,7 +182,8 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB } @Override - protected void EM_stopMachine() { + public void stopMachine() { + super.stopMachine(); for (GT_MetaTileEntity_Hatch_Rack r : eRacks) r.getBaseMetaTileEntity().setActive(false); } @@ -211,13 +218,13 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB } @Override - public void construct(int qty, boolean hintsOnly) { + public void construct(int stackSize, boolean hintsOnly) { IGregTechTileEntity igt=getBaseMetaTileEntity(); StructureBuilder(front, blockType, blockMeta, 1, 2, 0, igt,hintsOnly); StructureBuilder(cap, blockType, blockMeta, 1, 2, -1, igt,hintsOnly); byte offset=-2; - for (int rackSlices = qty>12?12:qty; rackSlices>0 ; rackSlices--) { + for (int rackSlices = stackSize >12?12: stackSize; rackSlices>0 ; rackSlices--) { StructureBuilder(slice, blockType, blockMeta, 1, 2, offset--, igt,hintsOnly); } @@ -226,6 +233,11 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override protected void EM_extraExplosions() { for (MetaTileEntity tTileEntity : eRacks) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafter.java index d4ecd5e378..1fa36038b2 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafter.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafter.java @@ -2,7 +2,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; @@ -16,7 +16,7 @@ import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBloc /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_crafter extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_crafter extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region structure private static final String[][] shape = new String[][]{ {"A000","0 0","0 . 0","0 0","A000",}, @@ -37,6 +37,11 @@ public class GT_MetaTileEntity_EM_crafter extends GT_MetaTileEntity_MultiblockBa private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Hatches or Molecular Casing", + }; //endregion public GT_MetaTileEntity_EM_crafter(int aID, String aName, String aNameRegional) { @@ -57,11 +62,16 @@ public class GT_MetaTileEntity_EM_crafter extends GT_MetaTileEntity_MultiblockBa } @Override - public void construct(int qty, boolean hintsOnly) { + public void construct(int stackSize, boolean hintsOnly) { StructureBuilder(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override public String[] getDescription() { return new String[]{ CommonValues.tecMark, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java index 99f48c25ff..c4eca167fe 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java @@ -4,7 +4,7 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStack; import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStackMap; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; @@ -13,15 +13,15 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.Util.VN; import static com.github.technus.tectech.elementalMatter.interfaces.iElementalDefinition.stableRawLifeTime; 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.VN; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region structure private static final String[][] shape = new String[][]{ {"0C0","A ","A . ","A ","0C0",}, @@ -40,6 +40,11 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Hatches or Molecular Casing", + }; //endregion public GT_MetaTileEntity_EM_decay(int aID, String aName, String aNameRegional) { @@ -60,11 +65,16 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase } @Override - public void construct(int qty, boolean hintsOnly) { + public void construct(int stackSize, boolean hintsOnly) { StructureBuilder(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override public String[] getDescription() { return new String[]{ CommonValues.tecMark, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java index e7b6acc5ee..e5dba9c82d 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java @@ -8,7 +8,7 @@ import com.github.technus.tectech.elementalMatter.interfaces.iExchangeInfo; import com.github.technus.tectech.elementalMatter.interfaces.iHasElementalDefinition; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; @@ -24,27 +24,33 @@ import static com.github.technus.tectech.elementalMatter.definitions.dAtomDefini import static com.github.technus.tectech.elementalMatter.definitions.dAtomDefinition.refUnstableMass; 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.V; +import static com.github.technus.tectech.Util.V; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region Structure //use multi A energy inputs, use less power the longer it runs private static final String[][] shape = new String[][]{ - {"!!!", "!.!", "!!!",}, + {" ", " . ", " ",}, {"010", "111", "010",}, {"\"\"\"", "\"1\"", "\"\"\"",}, - {"121", "2 2", "121",}, + {"121", "2!2", "121",}, }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, QuantumGlassBlock.INSTANCE}; private static final byte[] blockMeta = new byte[]{0, 4, 0}; - 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 Molecular Casing", + }; //endregion public GT_MetaTileEntity_EM_dequantizer(int aID, String aName, String aNameRegional) { @@ -65,8 +71,13 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo } @Override - public void construct(int qty, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(),hintsOnly); + public void construct(int stackSize, boolean hintsOnly) { + StructureBuilder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java index 12948f1ecb..48d32a47df 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java @@ -4,7 +4,7 @@ import cofh.api.energy.IEnergyContainerItem; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.auxiliary.TecTechConfig; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import ic2.api.item.ElectricItem; @@ -22,7 +22,7 @@ import static gregtech.api.GregTech_API.mEUtoRF; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region Structure private static final String[][] shape = new String[][]{ {" ", "000", "1.1", "000", " ",}, @@ -35,6 +35,10 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa private static final short[] casingTextures = new short[]{textureOffset}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + }; //endregion public GT_MetaTileEntity_EM_infuser(int aID, String aName, String aNameRegional) { @@ -62,11 +66,16 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa } @Override - public void construct(int qty, boolean hintsOnly) { + public void construct(int stackSize, boolean hintsOnly) { StructureBuilder(shape, blockType, blockMeta,1, 2, 0, getBaseMetaTileEntity(),hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override public boolean EM_checkRecipe(ItemStack itemStack) { if (itemStack != null && itemStack.stackSize == 1) { Item ofThis = itemStack.getItem(); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java index e659116a28..f1cb870ad6 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java @@ -3,7 +3,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputElemental; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; @@ -13,12 +13,12 @@ import net.minecraft.util.EnumChatFormatting; import static com.github.technus.tectech.Util.StructureBuilder; 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.V; +import static com.github.technus.tectech.Util.V; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region Structure //use multi A energy inputs, use less power the longer it runs private static final String[][] shape = new String[][]{ @@ -33,6 +33,11 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Hatches or Molecular Casing", + }; //endregion public GT_MetaTileEntity_EM_junction(int aID, String aName, String aNameRegional) { @@ -53,11 +58,16 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB } @Override - public void construct(int qty, boolean hintsOnly) { + public void construct(int stackSize, boolean hintsOnly) { StructureBuilder(shape, blockType, blockMeta,1, 1, 0, getBaseMetaTileEntity(),hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override public String[] getDescription() { return new String[]{ CommonValues.tecMark, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java index cc79a9fc12..87a706f132 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java @@ -6,7 +6,7 @@ import com.github.technus.tectech.auxiliary.TecTechConfig; import com.github.technus.tectech.elementalMatter.classes.*; import com.github.technus.tectech.elementalMatter.interfaces.iHasElementalDefinition; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -22,26 +22,32 @@ import static com.github.technus.tectech.elementalMatter.definitions.dAtomDefini import static com.github.technus.tectech.elementalMatter.definitions.dAtomDefinition.refUnstableMass; 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.V; +import static com.github.technus.tectech.Util.V; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region Structure //use multi A energy inputs, use less power the longer it runs private static final String[][] shape = new String[][]{ - {"!!!", "!.!", "!!!",}, + {" ", " . ", " ",}, {"010", "101", "010",}, {"\"\"\"", "\"0\"", "\"\"\"",}, - {"202", "0 0", "202",}, + {"202", "0!0", "202",}, }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, QuantumGlassBlock.INSTANCE}; private static final byte[] blockMeta = new byte[]{4, 0, 0}; - 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 Molecular Casing", + }; //endregion public GT_MetaTileEntity_EM_quantizer(int aID, String aName, String aNameRegional) { @@ -62,11 +68,16 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock } @Override - public void construct(int qty, boolean hintsOnly) { + public void construct(int stackSize, boolean hintsOnly) { StructureBuilder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(),hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override public String[] getDescription() { return new String[]{ CommonValues.tecMark, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java index 94ad820361..83d55187c3 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java @@ -2,34 +2,45 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.auxiliary.TecTechConfig; +import com.github.technus.tectech.recipe.TT_recipe; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Holder; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagString; import net.minecraft.util.EnumChatFormatting; import java.util.ArrayList; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.Util.*; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; 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; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { private final ArrayList<GT_MetaTileEntity_Hatch_Holder> eHolders = new ArrayList<>(); + private GT_Recipe.GT_Recipe_AssemblyLine tRecipe; + private long computationRemaining,computationRequired; //region structure private static final String[][] shape = new String[][]{ @@ -44,9 +55,14 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{1, 3, 2}; private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addHolderToMachineList"}; - private static final short[] casingTextures = new short[]{textureOffset + 3, textureOffset + 3}; + private static final short[] casingTextures = new short[]{textureOffset + 1, textureOffset + 3}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, Blocks.air}; - private static final byte[] blockMetaFallback = new byte[]{3, 0}; + private static final byte[] blockMetaFallback = new byte[]{1, 0}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic/Data Hatches or Computer casing", + "2 - Holder Hatch", + }; //endregion public GT_MetaTileEntity_EM_research(int aID, String aName, String aNameRegional) { @@ -78,24 +94,135 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } @Override - public void construct(int qty, boolean hintsOnly) { + public void construct(int stackSize, boolean hintsOnly) { StructureBuilder(shape, blockType, blockMeta,1, 3, 4, getBaseMetaTileEntity(),hintsOnly); } @Override - public boolean EM_checkRecipe(ItemStack itemStack) { - //for (GT_MetaTileEntity_Hatch_Holder r : eHolders) { - // r.getBaseMetaTileEntity().setActive(true); - //}//Look in Computer code + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setLong("eComputationRemaining",computationRemaining); + aNBT.setLong("eComputationRequired",computationRequired); + } - //check for item in controller and holder - //find research - //DO IT + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + computationRemaining=aNBT.getLong("eComputationRemaining"); + computationRequired=aNBT.getLong("eComputationRequired"); + } + @Override + protected void EM_onFirstTick() { + if(computationRemaining>0) { + tRecipe = null; + if (!eHolders.isEmpty() && eHolders.get(0).mInventory[0] != null && + ItemList.Tool_DataStick.isStackEqual(mInventory[1], false, true)) { + ItemStack researchItem = eHolders.get(0).mInventory[0]; + for (GT_Recipe.GT_Recipe_AssemblyLine tRecipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes) { + if (GT_Utility.areStacksEqual(tRecipe.mResearchItem, researchItem, true)) { + this.tRecipe = tRecipe; + } + } + } + if (tRecipe == null) { + mMaxProgresstime = 0; + mEfficiencyIncrease = 0; + for (GT_MetaTileEntity_Hatch_Holder r : eHolders) + r.getBaseMetaTileEntity().setActive(false); + } + } + } + + @Override + public boolean EM_checkRecipe(ItemStack itemStack) { + if(!eHolders.isEmpty() && eHolders.get(0).mInventory[0]!=null && + ItemList.Tool_DataStick.isStackEqual(itemStack, false, true)){ + ItemStack researchItem=eHolders.get(0).mInventory[0]; + for(GT_Recipe.GT_Recipe_AssemblyLine tRecipe:GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes){ + if(GT_Utility.areStacksEqual(tRecipe.mResearchItem, researchItem, true)){ + this.tRecipe=tRecipe; + //if found + for(GT_Recipe ttRecipe: TT_recipe.TT_Recipe_Map.sResearchableFakeRecipes.mRecipeList){ + if(GT_Utility.areStacksEqual(ttRecipe.mInputs[0], researchItem, true)){ + computationRequired=computationRemaining=ttRecipe.mDuration*20L; + mMaxProgresstime=20; + mEfficiencyIncrease=10000; + eRequiredData=(short)(ttRecipe.mSpecialValue>>>16); + eAmpereFlow=(short)(ttRecipe.mSpecialValue&0xFFFF); + mEUt=ttRecipe.mEUt; + eHolders.get(0).getBaseMetaTileEntity().setActive(true); + return true; + } + } + + } + } + } + computationRequired=computationRemaining=0; + mMaxProgresstime=0; + mEfficiencyIncrease = 0; + for (GT_MetaTileEntity_Hatch_Holder r : eHolders) + r.getBaseMetaTileEntity().setActive(false); return false; } @Override + public boolean onRunningTick(ItemStack aStack) { + if(computationRemaining<=0) { + computationRemaining=0; + mProgresstime=mMaxProgresstime; + return true; + }else{ + computationRemaining-=eAvailableData; + mProgresstime=1; + return super.onRunningTick(aStack); + } + } + + @Override + public void EM_outputFunction() { + if(tRecipe!=null && !eHolders.isEmpty() && ItemList.Tool_DataStick.isStackEqual(mInventory[1], false, true)){ + eHolders.get(0).getBaseMetaTileEntity().setActive(false); + eHolders.get(0).mInventory[0]=null; + + mInventory[1].setStackDisplayName(GT_LanguageManager.getTranslation(tRecipe.mOutput.getDisplayName())+" Construction Data"); + NBTTagCompound tNBT = mInventory[1].getTagCompound();//code above makes it not null + + tNBT.setTag("output", tRecipe.mOutput.writeToNBT(new NBTTagCompound())); + tNBT.setInteger("time", tRecipe.mDuration); + tNBT.setInteger("eu", tRecipe.mEUt); + for(int i = 0 ; i < tRecipe.mInputs.length ; i++){ + tNBT.setTag(""+i, tRecipe.mInputs[i].writeToNBT(new NBTTagCompound())); + } + for(int i = 0 ; i < tRecipe.mFluidInputs.length ; i++){ + tNBT.setTag("f"+i, tRecipe.mFluidInputs[i].writeToNBT(new NBTTagCompound())); + } + tNBT.setString("author", EnumChatFormatting.BLUE + "Tec" + EnumChatFormatting.DARK_BLUE + "Tech" + EnumChatFormatting.WHITE +" Assembling Line Recipe Generator"); + NBTTagList tNBTList = new NBTTagList(); + tNBTList.appendTag(new NBTTagString("Construction plan for "+tRecipe.mOutput.stackSize+" "+GT_LanguageManager.getTranslation(tRecipe.mOutput.getDisplayName())+". Needed EU/t: "+tRecipe.mEUt+" Production time: "+(tRecipe.mDuration/20))); + for(int i=0;i<tRecipe.mInputs.length;i++){ + if(tRecipe.mInputs[i]!=null){ + tNBTList.appendTag(new NBTTagString("Input Bus "+(i+1)+": "+tRecipe.mInputs[i].stackSize+" "+GT_LanguageManager.getTranslation(tRecipe.mInputs[i].getDisplayName()))); + } + } + for(int i=0;i<tRecipe.mFluidInputs.length;i++){ + if(tRecipe.mFluidInputs[i]!=null){ + tNBTList.appendTag(new NBTTagString("Input Hatch "+(i+1)+": "+tRecipe.mFluidInputs[i].amount+"L "+GT_LanguageManager.getTranslation(tRecipe.mFluidInputs[i].getLocalizedName()))); + } + } + tNBT.setTag("pages", tNBTList); + } + computationRequired=computationRemaining=0; + tRecipe=null; + } + + @Override protected void EM_extraExplosions() { for (MetaTileEntity tTileEntity : eHolders) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); } @@ -131,7 +258,8 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } @Override - protected void EM_stopMachine() { + public void stopMachine() { + super.stopMachine(); for (GT_MetaTileEntity_Hatch_Holder r : eHolders) r.getBaseMetaTileEntity().setActive(false); } @@ -155,4 +283,45 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); } } + + @Override + public int getInventoryStackLimit() { + return 1; + } + + public String[] getInfoData() { + long storedEnergy = 0; + long maxEnergy = 0; + for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { + if (isValidMetaTileEntity(tHatch)) { + storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); + } + } + for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : eEnergyMulti) { + if (isValidMetaTileEntity(tHatch)) { + storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); + } + } + + return new String[]{ + "Energy Hatches:", + EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET + " EU / " + + EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET + " EU", + (mEUt <= 0 ? "Probably uses: " : "Probably makes: ") + + EnumChatFormatting.RED + Integer.toString(Math.abs(mEUt)) + EnumChatFormatting.RESET + " EU/t at " + + EnumChatFormatting.RED + eAmpereFlow + EnumChatFormatting.RESET + " A", + "Tier Rating: " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier()] + EnumChatFormatting.RESET + + " Amp Rating: " + EnumChatFormatting.GREEN + eMaxAmpereFlow + EnumChatFormatting.RESET + " A", + "Problems: " + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + + " Efficiency: " + EnumChatFormatting.YELLOW + Float.toString(mEfficiency / 100.0F) + EnumChatFormatting.RESET + " %", + "PowerPass: " + EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET + + " SafeVoid: " + EnumChatFormatting.BLUE + eSafeVoid, + "Computation Available: " + EnumChatFormatting.GREEN + eAvailableData + EnumChatFormatting.RESET, + "Computation Remaining:", + EnumChatFormatting.GREEN + Long.toString(computationRemaining / 20L) + EnumChatFormatting.RESET + " / " + + EnumChatFormatting.YELLOW + Long.toString(computationRequired / 20L) + }; + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java index c69167f5b0..18a22ae125 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java @@ -2,7 +2,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; @@ -16,7 +16,7 @@ import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBloc /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region structure private static final String[][] shape = new String[][]{ @@ -27,18 +27,25 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa {"01110", "1C1", "1C1", "1C1", "01110",}, {"01110", "1C1", "1C1", "1C1", "01110",}, {"00100", "01110", "11\"11", "01110", "00100",}, - {"!!!!!", "!000!", "!0#0!", "!000!", "!!!!!",}, + {"#####", "#000#", "#0!0#", "#000#", "#####",}, }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{4, 0, 0}; private static final String[] addingMethods = new String[]{ "addClassicToMachineList", - "addElementalMufflerToMachineList", + "addElementalInputToMachineList", "addElementalOutputToMachineList", - "addElementalInputToMachineList"}; + "addElementalMufflerToMachineList"}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4, 4, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Input Hatches or Molecular Casing", + "3 - Elemental Output Hatches or Molecular Casing", + "4 - Elemental Overflow Hatches or Molecular Casing", + }; //endregion public GT_MetaTileEntity_EM_scanner(int aID, String aName, String aNameRegional) { @@ -61,11 +68,16 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa } @Override - public void construct(int qty, boolean hintsOnly) { + public void construct(int stackSize, boolean hintsOnly) { StructureBuilder(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override public String[] getDescription() { return new String[]{ CommonValues.tecMark, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java index 2ae8da7587..dd2b8b3ec5 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java @@ -2,7 +2,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; @@ -16,7 +16,7 @@ import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBloc /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region structure private static final String[][] shape = new String[][]{ {"A010","0 0","1 . 1","0 0","A010",}, @@ -31,6 +31,11 @@ public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_Multibloc private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Hatches or Molecular Casing", + }; //endregion public GT_MetaTileEntity_EM_stabilizer(int aID, String aName, String aNameRegional) { @@ -51,11 +56,16 @@ public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_Multibloc } @Override - public void construct(int qty, boolean hintsOnly) { + public void construct(int stackSize, boolean hintsOnly) { StructureBuilder(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override public String[] getDescription() { return new String[]{ CommonValues.tecMark, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java index b87cc72d26..95bc272172 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java @@ -1,28 +1,48 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.Vec3pos; import com.github.technus.tectech.dataFramework.QuantumDataPacket; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputData; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputData; -import com.github.technus.tectech.Vec3pos; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_RenderedTexture; +import net.minecraft.block.Block; import net.minecraft.item.ItemStack; 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.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; -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_switch extends GT_MetaTileEntity_MultiblockBase_EM { +public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable{ + //region Structure + private static final String[][] shape = new String[][]{ + {" "," . "," ",}, + {" "," 0 "," ",}, + {" "," "," ",}, + }; + private static final Block[] blockType = new Block[]{sBlockCasingsTT}; + private static final byte[] blockMeta = new byte[]{3}; + private static final String[] addingMethods = new String[]{"addClassicToMachineList"}; + private static final short[] casingTextures = new short[]{textureOffset}; + private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT}; + private static final byte[] blockMetaFallback = new byte[]{1}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic/Data Hatches or Computer casing", + }; + //endregion + public GT_MetaTileEntity_EM_switch(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -45,29 +65,17 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas @Override public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX; - int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY; - int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ; - if (iGregTechTileEntity.getBlockOffset(xDir, yDir, zDir) != sBlockCasingsTT || iGregTechTileEntity.getMetaIDOffset(xDir, yDir, zDir) != 3) - return false; - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - for (int h = -1; h < 2; h++) { - if ((i != 0 || j != 0 || h != 0)/*exclude center*/ && (xDir + i != 0 || yDir + h != 0 || zDir + j != 0)/*exclude this*/) { - IGregTechTileEntity tTileEntity = iGregTechTileEntity.getIGregTechTileEntityOffset(xDir + i, yDir + h, zDir + j); - if (!addEnergyIOToMachineList(tTileEntity, textureOffset + 1) && - (!addDataConnectorToMachineList(tTileEntity, textureOffset + 1)) && - (!addMaintenanceToMachineList(tTileEntity, textureOffset + 1))) { - if (iGregTechTileEntity.getBlockOffset(xDir + i, yDir + h, zDir + j) != sBlockCasingsTT || - iGregTechTileEntity.getMetaIDOffset(xDir + i, yDir + h, zDir + j) != 1) { - return false; - } - } - } - } - } - } - return true; + return EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0); + } + + @Override + public void construct(int stackSize, boolean hintsOnly) { + StructureBuilder(shape, blockType, blockMeta,1, 1, 0, getBaseMetaTileEntity(),hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java index c08765e4fe..b8a65b3328 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java @@ -1,15 +1,17 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_RenderedTexture; +import net.minecraft.block.Block; import net.minecraft.item.ItemStack; 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.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -18,7 +20,25 @@ import static gregtech.api.GregTech_API.sBlockCasings1; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_MultiblockBase_EM { +public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable{ + //region Structure + private static final String[][] shape = new String[][]{ + {" "," . "," ",}, + {" "," 0 "," ",}, + {" "," "," ",}, + }; + private static final Block[] blockType = new Block[]{sBlockCasings1}; + private static final byte[] blockMeta = new byte[]{15}; + private static final String[] addingMethods = new String[]{"addEnergyIOToMachineList"}; + private static final short[] casingTextures = new short[]{textureOffset}; + private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT}; + private static final byte[] blockMetaFallback = new byte[]{0}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Energy IO Hatches or High Power Casing", + }; + //endregion + public GT_MetaTileEntity_EM_transformer(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); mWrench = true; @@ -45,27 +65,17 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo @Override public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX; - int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY; - int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ; - if (iGregTechTileEntity.getBlockOffset(xDir, yDir, zDir) != sBlockCasings1 || iGregTechTileEntity.getMetaIDOffset(xDir, yDir, zDir) != 15) - return false;//Not superconducting coil in middle - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - for (int h = -1; h < 2; h++) { - if ((i != 0 || j != 0 || h != 0)/*exclude center*/ && (xDir + i != 0 || yDir + h != 0 || zDir + j != 0)/*exclude this*/) { - IGregTechTileEntity tTileEntity = iGregTechTileEntity.getIGregTechTileEntityOffset(xDir + i, yDir + h, zDir + j); - if (!addEnergyIOToMachineList(tTileEntity, textureOffset)) { - if (iGregTechTileEntity.getBlockOffset(xDir + i, yDir + h, zDir + j) != sBlockCasingsTT || - iGregTechTileEntity.getMetaIDOffset(xDir + i, yDir + h, zDir + j) != 0) { - return false; - } - } - } - } - } - } - return true; + return EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0); + } + + @Override + public void construct(int stackSize, boolean hintsOnly) { + StructureBuilder(shape, blockType, blockMeta,1, 1, 0, getBaseMetaTileEntity(),hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { @@ -101,6 +111,11 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo } @Override + public boolean onRunningTick(ItemStack aStack) { + return true; + } + + @Override public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if ((aTick & 31) == 31) { ePowerPass = aBaseMetaTileEntity.isAllowedToWork(); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java index 1a22640b19..cc236828d5 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java @@ -2,7 +2,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -24,7 +24,7 @@ import static gregtech.api.enums.GT_Values.E; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible {//TODO MAKE COMPATIBLE WITH STARGATES XD +public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable {//TODO MAKE COMPATIBLE WITH STARGATES XD private static Textures.BlockIcons.CustomIcon ScreenOFF; private static Textures.BlockIcons.CustomIcon ScreenON; @@ -48,6 +48,11 @@ public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockB private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Hatches or Molecular Casing", + }; //endregion public GT_MetaTileEntity_EM_wormhole(int aID, String aName, String aNameRegional) { @@ -84,11 +89,16 @@ public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockB } @Override - public void construct(int qty, boolean hintsOnly) { + public void construct(int stackSize, boolean hintsOnly) { StructureBuilder(shape, blockType, blockMeta,4, 4, 0, getBaseMetaTileEntity(),hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override public String[] getDescription() { return new String[]{ CommonValues.tecMark, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java index d4cd958204..c5ca46923e 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java @@ -2,6 +2,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.Util; import com.github.technus.tectech.auxiliary.TecTechConfig; import com.github.technus.tectech.elementalMatter.classes.cElementalDefinitionStack; import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStack; @@ -39,11 +40,8 @@ import java.util.HashMap; import java.util.Map; import static com.github.technus.tectech.CommonValues.*; -import static com.github.technus.tectech.Util.StructureChecker; -import static com.github.technus.tectech.Util.StructureCheckerAdvanced; +import static com.github.technus.tectech.Util.*; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.GT_Values.VN; /** * Created by danie_000 on 27.10.2016. @@ -123,9 +121,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt protected void EM_extraExplosions() { }//For that extra hatches explosions, and maybe some MOORE EXPLOSIONS - protected void EM_stopMachine() { - }//On machine stop - now called when softhammered to offline state! - it does not cause a full stop like power failure - @Deprecated protected void EM_workJustGotEnabled(){}//usually check recipe is more useful, therefore this one is deprecated protected void EM_workJustGotDisabled(){} @@ -155,6 +150,36 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt protected void EM_onFirstTick(){} // callback on first tick + //Override but call supermethod at start! + @Override + public void stopMachine() { + mOutputItems = null; + mOutputFluids = null; + mEfficiency = 0; + mProgresstime = 0; + mMaxProgresstime = 0; + mEfficiencyIncrease = 0; + getBaseMetaTileEntity().disableWorking(); + + for (GT_MetaTileEntity_Hatch_OutputData data : eOutputData) { + data.q = null; + } + + float mass = 0; + if (outputEM == null) return; + for (cElementalInstanceStackMap tree : outputEM) + mass += tree.getMass(); + if (mass > 0) { + if (eMufflerHatches.size() < 1) explodeMultiblock(); + mass /= eMufflerHatches.size(); + for (GT_MetaTileEntity_Hatch_MufflerElemental dump : eMufflerHatches) { + if (dump.addOverflowMatter(mass)) explodeMultiblock(); + } + } + outputEM = null; + + hatchesStatusUpdate(); + }//On machine stop - now called when softhammered to offline state! - it does not cause a full stop like power failure //RATHER LEAVE ALONE Section @@ -385,10 +410,10 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (aBaseMetaTileEntity.isServerSide()) { if (mEfficiency < 0) mEfficiency = 0; - if(getBaseMetaTileEntity().hasWorkJustBeenEnabled()) EM_workJustGotEnabled(); - if(previousTickValueForWorkEnabled && !getBaseMetaTileEntity().isAllowedToWork()) + if (getBaseMetaTileEntity().hasWorkJustBeenEnabled()) EM_workJustGotEnabled(); + if (previousTickValueForWorkEnabled && !getBaseMetaTileEntity().isAllowedToWork()) EM_workJustGotDisabled(); - previousTickValueForWorkEnabled=getBaseMetaTileEntity().isAllowedToWork();//Assign new value + previousTickValueForWorkEnabled = getBaseMetaTileEntity().isAllowedToWork();//Assign new value if (--mUpdate == 0 || --mStartUpCheck == 0 || cyclicUpdate() || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) { mInputHatches.clear(); @@ -513,7 +538,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt mCrowbar = true; } else { if (tHatch.mAuto && !(mWrench && mScrewdriver && mSoftHammer && mHardHammer && mSolderingTool && mCrowbar)) - tHatch.isRecipeInputEqual(true); + tHatch.autoMaintainance(); if (tHatch.mWrench) mWrench = true; if (tHatch.mScrewdriver) mScrewdriver = true; if (tHatch.mSoftHammer) mSoftHammer = true; @@ -539,7 +564,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt int qty = (int) Math.floor(remaining / instance.definition.getMass()); if (qty > 0) { qty = Math.min(qty, instance.amount); - if(voider.addOverflowMatter(instance.definition.getMass() * qty)) + if (voider.addOverflowMatter(instance.definition.getMass() * qty)) voider.setOverflowMatter(voider.overflowMax); in.getContainerHandler().removeAmount(false, new cElementalDefinitionStack(instance.definition, qty)); } @@ -550,7 +575,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt int qty = (int) Math.floor(remaining / instance.definition.getMass()); if (qty > 0) { qty = Math.min(qty, instance.amount); - if(voider.addOverflowMatter(instance.definition.getMass() * qty)) + if (voider.addOverflowMatter(instance.definition.getMass() * qty)) voider.setOverflowMatter(voider.overflowMax); out.getContainerHandler().removeAmount(false, new cElementalDefinitionStack(instance.definition, qty)); } @@ -565,8 +590,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (mMaxProgresstime > 0 && doRandomMaintenanceDamage()) {//Start if (onRunningTick(mInventory[1])) {//Compute EU - if (!polluteEnvironment(getPollutionPerTick(mInventory[1]))) - stopMachine(); + if (!polluteEnvironment(getPollutionPerTick(mInventory[1]))) stopMachine();//todo add em pollution if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime && recipeAt == Tick) {//progress increase and done hatchesStatusUpdate(); @@ -578,7 +602,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (tStack != null) addOutput(tStack); mOutputItems = null; - if(mOutputFluids!=null) { + if (mOutputFluids != null) { if (mOutputFluids.length == 1) { for (FluidStack tStack : mOutputFluids) if (tStack != null) addOutput(tStack); @@ -595,18 +619,22 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt mEfficiency = Math.max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000))); } updateSlots(); - } else stopMachine(); + }// else {//not allowed to work + // stopMachine(); + //} } - } - } else { - if (recipeAt == Tick || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) { - if (aBaseMetaTileEntity.isAllowedToWork()) { - if (checkRecipe(mInventory[1])) { - mEfficiency = Math.max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000))); - } - updateSlots(); - } else stopMachine(); - } + }// else {//failed to consume power/resources - inside on running tick + // stopMachine(); + //} + } else if (recipeAt == Tick || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) { + if (aBaseMetaTileEntity.isAllowedToWork()) { + if (checkRecipe(mInventory[1])) { + mEfficiency = Math.max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000))); + } + updateSlots(); + }// else {//not allowed to work + // stopMachine(); + //} } {//DO ONCE @@ -692,12 +720,15 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Override public boolean onRunningTick(ItemStack aStack) { - if (eRequiredData > 0 && eRequiredData > eAvailableData) return false; + if (eRequiredData > 0 && eRequiredData > eAvailableData) { + stopMachine(); + return false; + } if (this.mEUt > 0) { this.EMaddEnergyOutput((long) mEUt * (long) mEfficiency / getMaxEfficiency(aStack), eAmpereFlow); return true; } else if (this.mEUt < 0 && !this.EMdrainEnergyInput((long) (-this.mEUt) * getMaxEfficiency(aStack) / (long) Math.max(1000, this.mEfficiency), eAmpereFlow)) { - this.stopMachine(); + stopMachine(); return false; } else return true; } @@ -822,12 +853,12 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //new Method public final int getMaxEnergyInputTier() { - return GT_Utility.getTier(maxEUinputMax); + return Util.getTier(maxEUinputMax); } //new Method public final int getMinEnergyInputTier() { - return GT_Utility.getTier(maxEUinputMin); + return Util.getTier(maxEUinputMin); } //new Method @@ -849,39 +880,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } @Override - public final void stopMachine() { - mOutputItems = null; - mOutputFluids = null; - //mEUt = 0; - mEfficiency = 0; - mProgresstime = 0; - mMaxProgresstime = 0; - mEfficiencyIncrease = 0; - getBaseMetaTileEntity().disableWorking(); - - for (GT_MetaTileEntity_Hatch_OutputData data : eOutputData) { - data.q = null; - } - - float mass = 0; - if (outputEM == null) return; - for (cElementalInstanceStackMap tree : outputEM) - mass += tree.getMass(); - if (mass > 0) { - if (eMufflerHatches.size() < 1) explodeMultiblock(); - mass /= eMufflerHatches.size(); - for (GT_MetaTileEntity_Hatch_MufflerElemental dump : eMufflerHatches) { - if (dump.addOverflowMatter(mass)) explodeMultiblock(); - } - } - outputEM = null; - - hatchesStatusUpdate(); - - EM_stopMachine(); - } - - @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { return null; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java index b371cb25de..f9fbebf7f3 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java @@ -2,7 +2,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.auxiliary.Reference; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -31,7 +31,7 @@ import static gregtech.api.GregTech_API.sBlockCasings4; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { private int powerSetting = 1000; private int timerSetting = 0; private int timerValue = 0; @@ -61,6 +61,11 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock private static final short[] casingTextures = new short[]{49}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasings4}; private static final byte[] blockMetaFallback = new byte[]{1}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "Also acts like a hopper so give it an Output Bus", + }; //endregion public GT_MetaTileEntity_TM_microwave(int aID, String aName, String aNameRegional) { @@ -115,12 +120,17 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock } @Override - public void construct(int qty, boolean hintsOnly) { - if((qty&0x1)==1) StructureBuilder(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),hintsOnly); + public void construct(int stackSize, boolean hintsOnly) { + if((stackSize &0x1)==1) StructureBuilder(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),hintsOnly); else StructureBuilder(shapeFlipped, blockType, blockMeta,2, 1, 0, getBaseMetaTileEntity(),hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override public String[] getDescription() { return new String[]{ CommonValues.bassMark, @@ -239,7 +249,8 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock } @Override - protected void EM_stopMachine() { + public void stopMachine() { + super.stopMachine(); timerValue=0; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java index 0d22b4861d..5b3c43d3bf 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java @@ -1,6 +1,8 @@ package com.github.technus.tectech.thing.metaTileEntity.single; import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_Container_DebugPowerGenerator; import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_GUIContainer_DebugPowerGenerator; import cpw.mods.fml.relauncher.Side; @@ -48,7 +50,7 @@ public class GT_MetaTileEntity_DebugPowerGenerator extends GT_MetaTileEntity_Tie @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], (aSide != this.getBaseMetaTileEntity().getFrontFacing()) ? (aActive?Textures.BlockIcons.OVERLAYS_ENERGY_OUT_POWER[mTier]:Textures.BlockIcons.OVERLAYS_ENERGY_IN_POWER[mTier]) : new GT_RenderedTexture(GENNY)}; + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], (aSide != this.getBaseMetaTileEntity().getFrontFacing()) ? (aActive? GT_MetaTileEntity_Hatch_DynamoMulti.overlay[mTier]: GT_MetaTileEntity_Hatch_EnergyMulti.overlay[mTier]) : new GT_RenderedTexture(GENNY)}; } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java index eec32029cb..50774c53ca 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java @@ -53,7 +53,7 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], (aSide != this.getBaseMetaTileEntity().getFrontFacing()) ? new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER_SIDES) : new GT_RenderedTexture(MARK)}; + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], (aSide != this.getBaseMetaTileEntity().getFrontFacing()) ? new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE) : new GT_RenderedTexture(MARK)}; } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugPowerGenerator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugPowerGenerator.java index 98901f150b..6946e2320e 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugPowerGenerator.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugPowerGenerator.java @@ -1,12 +1,12 @@ package com.github.technus.tectech.thing.metaTileEntity.single.gui; +import com.github.technus.tectech.Util; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; +import static com.github.technus.tectech.Util.VN; import static gregtech.api.enums.GT_Values.RES_PATH_GUI; -import static gregtech.api.enums.GT_Values.VN; public class GT_GUIContainer_DebugPowerGenerator extends GT_GUIContainerMetaTile_Machine { public GT_GUIContainer_DebugPowerGenerator(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { @@ -18,7 +18,7 @@ public class GT_GUIContainer_DebugPowerGenerator extends GT_GUIContainerMetaTile if (this.mContainer != null) { GT_Container_DebugPowerGenerator dpg = (GT_Container_DebugPowerGenerator) mContainer; this.fontRendererObj.drawString("EUT: " + dpg.EUT, 46, 24, 16448255); - this.fontRendererObj.drawString("TIER: " + VN[GT_Utility.getTier(dpg.EUT<0?-dpg.EUT:dpg.EUT)], 46, 32, 16448255); + this.fontRendererObj.drawString("TIER: " + VN[Util.getTier(dpg.EUT<0?-dpg.EUT:dpg.EUT)], 46, 32, 16448255); this.fontRendererObj.drawString("AMP: " + dpg.AMP, 46, 40, 16448255); this.fontRendererObj.drawString("SUM: " + (long)dpg.AMP*dpg.EUT, 46, 48, 16448255); } diff --git a/src/main/java/openmodularturrets/entity/projectiles/projectileRenderEM.java b/src/main/java/openmodularturrets/entity/projectiles/projectileRenderEM.java index 4ce942958b..0fb915e035 100644 --- a/src/main/java/openmodularturrets/entity/projectiles/projectileRenderEM.java +++ b/src/main/java/openmodularturrets/entity/projectiles/projectileRenderEM.java @@ -34,7 +34,7 @@ public class projectileRenderEM extends Render { float f4 = (float)(b0 * 10) / 32.0F; float f5 = (float)(5 + b0 * 10) / 32.0F; float f10 = 0.05625F; - GL11.glEnable('耺'); + GL11.glEnable('\u803a'); float f11 = - par9; if(f11 > 0.0F) { float i = -MathHelper.sin(f11 * 3.0F) * f11; @@ -60,7 +60,7 @@ public class projectileRenderEM extends Render { } GL11.glEnable(2896); - GL11.glDisable('耺'); + GL11.glDisable('\u803a'); GL11.glPopMatrix(); } diff --git a/src/main/resources/assets/gregtech/textures/gui/multimachines/ResearchFake.png b/src/main/resources/assets/gregtech/textures/gui/multimachines/ResearchFake.png Binary files differnew file mode 100644 index 0000000000..b80e150877 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/gui/multimachines/ResearchFake.png |