From b638bc34c3249a5cf2d869178bf004537d71b3b3 Mon Sep 17 00:00:00 2001 From: Technus Date: Tue, 22 Nov 2016 12:51:04 +0100 Subject: initial --- src/main/java/gregtech/common/GT_RecipeAdder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/GT_RecipeAdder.java b/src/main/java/gregtech/common/GT_RecipeAdder.java index d87f6bcc72..d9558bcec6 100644 --- a/src/main/java/gregtech/common/GT_RecipeAdder.java +++ b/src/main/java/gregtech/common/GT_RecipeAdder.java @@ -836,7 +836,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if(tItem==null)System.out.println("addAssemblylineRecipe"+aResearchItem.getDisplayName()); } GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Research result", new Object[0])}, null, null, aResearchTime, 30, 0); - + GT_Recipe.GT_Recipe_Map.sAssemblylineFakeRecipes.addFakeRecipe(false, aInputs, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Research result", new Object[0])}, aFluidInputs, null, aDuration, aEUt, 0); GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe_AssemblyLine( aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt)); return true; } -- cgit From 2de6e3eadb6ab57736c51ed72d1617cff11d05f1 Mon Sep 17 00:00:00 2001 From: Technus Date: Tue, 22 Nov 2016 19:05:12 +0100 Subject: Stuff --- src/main/java/gregtech/api/util/GT_Recipe.java | 16 +++++++++-- src/main/java/gregtech/api/util/GT_Utility.java | 2 ++ src/main/java/gregtech/common/GT_Client.java | 3 ++ src/main/java/gregtech/common/GT_RecipeAdder.java | 2 +- .../java/gregtech/nei/GT_NEI_AssLineHandler.java | 33 +++++++++++++--------- src/main/java/gregtech/nei/NEI_GT_Config.java | 3 +- 6 files changed, 40 insertions(+), 19 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java index 51307813e4..6367cd0750 100644 --- a/src/main/java/gregtech/api/util/GT_Recipe.java +++ b/src/main/java/gregtech/api/util/GT_Recipe.java @@ -466,9 +466,8 @@ public class GT_Recipe { public static final GT_Recipe_Map sRockBreakerFakeRecipes = new GT_Recipe_Map(new HashSet(3), "gt.recipe.rockbreaker", "Rock Breaker", null, RES_PATH_GUI + "basicmachines/RockBreaker", 1, 1, 0, 0, 1, E, 1, E, true, true); public static final GT_Recipe_Map sByProductList = new GT_Recipe_Map(new HashSet(1000), "gt.recipe.byproductlist", "Ore Byproduct List", null, RES_PATH_GUI + "basicmachines/Default", 1, 6, 1, 0, 1, E, 1, E, true, true); public static final GT_Recipe_Map sRepicatorFakeRecipes = new GT_Recipe_Map(new HashSet(100), "gt.recipe.replicator", "Replicator", null, RES_PATH_GUI + "basicmachines/Replicator", 0, 1, 0, 1, 1, E, 1, E, true, true); - public static final GT_Recipe_Map sAssemblylineFakeRecipes = new GT_Recipe_Map(new HashSet(30), "gt.recipe.fakeAssemblylineProcess", "Assemblyline Process", null, RES_PATH_GUI + "FakeAssemblyline", 1, 1, 1, 0, 1, E, 1, E, true, false);//Just a common list - public static final GT_Recipe_Map sAssemblylineUnlockedRecipes = new GT_Recipe_Map(new HashSet(30), "gt.recipe.unlockedAssemblylineProcess", "Assemblyline Process", null, RES_PATH_GUI + "FakeAssemblyline", 1, 1, 1, 0, 1, E, 1, E, true, true);//will content add in achievements - + public static final GT_Recipe_Map sAssemblylineFakeRecipes = new GT_Recipe_Map(new HashSet(30), "gt.recipe.fakeAssemblylineProcess", "Assemblyline Process", null, RES_PATH_GUI + "FakeAssemblyline", 1, 1, 1, 0, 1, E, 1, E, true, true); + public static final GT_Recipe_Map sPlasmaArcFurnaceRecipes = new GT_Recipe_Map(new HashSet(10000), "gt.recipe.plasmaarcfurnace", "Plasma Arc Furnace", null, RES_PATH_GUI + "basicmachines/PlasmaArcFurnace", 1, 4, 1, 1, 1, E, 1, E, true, true); public static final GT_Recipe_Map sArcFurnaceRecipes = new GT_Recipe_Map(new HashSet(10000), "gt.recipe.arcfurnace", "Arc Furnace", null, RES_PATH_GUI + "basicmachines/ArcFurnace", 1, 4, 1, 1, 3, E, 1, E, true, true); public static final GT_Recipe_Map sPrinterRecipes = new GT_Recipe_Map_Printer(new HashSet(100), "gt.recipe.printer", "Printer", null, RES_PATH_GUI + "basicmachines/Printer", 1, 1, 1, 1, 1, E, 1, E, true, true); @@ -625,6 +624,9 @@ public class GT_Recipe { public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { return addFakeRecipe(aCheckForCollisions, new GT_Recipe(false, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)); } + public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue,boolean hidden) { + return addFakeRecipe(aCheckForCollisions, new GT_Recipe(false, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue),hidden); + } /** * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes @@ -632,6 +634,9 @@ public class GT_Recipe { public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, GT_Recipe aRecipe) { return addRecipe(aRecipe, aCheckForCollisions, true, false); } + public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, GT_Recipe aRecipe,boolean hidden) { + return addRecipe(aRecipe, aCheckForCollisions, true, hidden); + } public GT_Recipe add(GT_Recipe aRecipe) { mRecipeList.add(aRecipe); @@ -816,6 +821,11 @@ public class GT_Recipe { return null; } + @Override + public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue,boolean hidden) { + return null; + } + @Override public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, GT_Recipe aRecipe) { return null; diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index 5b065a4bc7..575f5bebab 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -21,6 +21,8 @@ import gregtech.api.objects.ItemData; import gregtech.api.objects.XSTR; import gregtech.api.threads.GT_Runnable_Sound; import gregtech.common.GT_Proxy; +import gregtech.nei.GT_NEI_AssLineHandler; +import gregtech.nei.NEI_GT_Config; import ic2.api.recipe.IRecipeInput; import ic2.api.recipe.RecipeInputItemStack; import ic2.api.recipe.RecipeInputOreDict; diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java index 33222c03bb..fe2d3c71d7 100644 --- a/src/main/java/gregtech/common/GT_Client.java +++ b/src/main/java/gregtech/common/GT_Client.java @@ -7,6 +7,7 @@ package gregtech.common; import codechicken.lib.vec.Rotation; import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import gregtech.GT_Mod; @@ -20,10 +21,12 @@ import gregtech.api.metatileentity.BaseMetaPipeEntity; import gregtech.api.objects.GT_FluidStack; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_PlayedSound; +import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.entities.GT_Entity_Arrow; import gregtech.common.entities.GT_Entity_Arrow_Potion; import gregtech.common.render.*; +import gregtech.nei.NEI_GT_Config; import ic2.api.tile.IWrenchable; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; diff --git a/src/main/java/gregtech/common/GT_RecipeAdder.java b/src/main/java/gregtech/common/GT_RecipeAdder.java index d9558bcec6..e8dfc4615a 100644 --- a/src/main/java/gregtech/common/GT_RecipeAdder.java +++ b/src/main/java/gregtech/common/GT_RecipeAdder.java @@ -836,7 +836,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if(tItem==null)System.out.println("addAssemblylineRecipe"+aResearchItem.getDisplayName()); } GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Research result", new Object[0])}, null, null, aResearchTime, 30, 0); - GT_Recipe.GT_Recipe_Map.sAssemblylineFakeRecipes.addFakeRecipe(false, aInputs, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Research result", new Object[0])}, aFluidInputs, null, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sAssemblylineFakeRecipes.addFakeRecipe(false, aInputs, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Research result", new Object[0])}, aFluidInputs, null, aDuration, aEUt, 0,true); GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe_AssemblyLine( aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt)); return true; } diff --git a/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java b/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java index 6edda76f23..227ce05d85 100644 --- a/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java +++ b/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java @@ -58,7 +58,8 @@ public class GT_NEI_AssLineHandler } public TemplateRecipeHandler newInstance() { - return new GT_NEI_AssLineHandler(this.mRecipeMap); + NEI_GT_Config.ALH=new GT_NEI_AssLineHandler(this.mRecipeMap); + return NEI_GT_Config.ALH; } public void loadCraftingRecipes(String outputId, Object... results) { @@ -73,6 +74,10 @@ public class GT_NEI_AssLineHandler } } + public void clearRecipes(){ + this.arecipes.clear(); + } + public void loadCraftingRecipes(ItemStack aResult) { ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult); @@ -215,14 +220,14 @@ public class GT_NEI_AssLineHandler public static class GT_RectHandler implements IContainerInputHandler, IContainerTooltipHandler { public boolean mouseClicked(GuiContainer gui, int mousex, int mousey, int button) { - if (canHandle(gui)) { - if (button == 0) { - return transferRect(gui, false); - } - if (button == 1) { - return transferRect(gui, true); - } - } + //if (canHandle(gui)) { + // if (button == 0) { + // return transferRect(gui, false); + // } + // if (button == 1) { + // return transferRect(gui, true); + // } + //} return false; } @@ -236,11 +241,11 @@ public class GT_NEI_AssLineHandler } public List handleTooltip(GuiContainer gui, int mousex, int mousey, List currenttip) { - if ((canHandle(gui)) && (currenttip.isEmpty())) { - if (new Rectangle(138, 18, 18, 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]))) { - currenttip.add("Recipes"); - } - } + //if ((canHandle(gui)) && (currenttip.isEmpty())) { + // if (new Rectangle(138, 18, 18, 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]))) { + // currenttip.add("Recipes"); + // } + //} return currenttip; } diff --git a/src/main/java/gregtech/nei/NEI_GT_Config.java b/src/main/java/gregtech/nei/NEI_GT_Config.java index ac496b4d4f..4f72d40608 100644 --- a/src/main/java/gregtech/nei/NEI_GT_Config.java +++ b/src/main/java/gregtech/nei/NEI_GT_Config.java @@ -8,6 +8,7 @@ import gregtech.api.util.GT_Utility; public class NEI_GT_Config implements IConfigureNEI { public static boolean sIsAdded = true; + public static GT_NEI_AssLineHandler ALH; public void loadConfig() { sIsAdded = false; @@ -17,7 +18,7 @@ public class NEI_GT_Config } } if(FMLCommonHandler.instance().getEffectiveSide().isClient()) - new GT_NEI_AssLineHandler(GT_Recipe.GT_Recipe_Map.sAssemblylineFakeRecipes); + ALH=new GT_NEI_AssLineHandler(GT_Recipe.GT_Recipe_Map.sAssemblylineFakeRecipes); sIsAdded = true; } -- cgit From 317d6062d298b1157f698f100fea43fe53df00d0 Mon Sep 17 00:00:00 2001 From: Technus Date: Tue, 22 Nov 2016 19:44:57 +0100 Subject: WIP --- src/main/java/gregtech/api/util/GT_Recipe.java | 2 +- src/main/java/gregtech/common/GT_RecipeAdder.java | 2 +- src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java index 6367cd0750..06b70df0ae 100644 --- a/src/main/java/gregtech/api/util/GT_Recipe.java +++ b/src/main/java/gregtech/api/util/GT_Recipe.java @@ -466,7 +466,7 @@ public class GT_Recipe { public static final GT_Recipe_Map sRockBreakerFakeRecipes = new GT_Recipe_Map(new HashSet(3), "gt.recipe.rockbreaker", "Rock Breaker", null, RES_PATH_GUI + "basicmachines/RockBreaker", 1, 1, 0, 0, 1, E, 1, E, true, true); public static final GT_Recipe_Map sByProductList = new GT_Recipe_Map(new HashSet(1000), "gt.recipe.byproductlist", "Ore Byproduct List", null, RES_PATH_GUI + "basicmachines/Default", 1, 6, 1, 0, 1, E, 1, E, true, true); public static final GT_Recipe_Map sRepicatorFakeRecipes = new GT_Recipe_Map(new HashSet(100), "gt.recipe.replicator", "Replicator", null, RES_PATH_GUI + "basicmachines/Replicator", 0, 1, 0, 1, 1, E, 1, E, true, true); - public static final GT_Recipe_Map sAssemblylineFakeRecipes = new GT_Recipe_Map(new HashSet(30), "gt.recipe.fakeAssemblylineProcess", "Assemblyline Process", null, RES_PATH_GUI + "FakeAssemblyline", 1, 1, 1, 0, 1, E, 1, E, true, true); + public static final GT_Recipe_Map sAssemblylineFakeRecipes = new GT_Recipe_Map(new HashSet(30), "gt.recipe.fakeAssemblylineProcess", "Assemblyline Process", null, RES_PATH_GUI + "FakeAssemblyline", 1, 1, 1, 0, 1, E, 1, E, true, false); public static final GT_Recipe_Map sPlasmaArcFurnaceRecipes = new GT_Recipe_Map(new HashSet(10000), "gt.recipe.plasmaarcfurnace", "Plasma Arc Furnace", null, RES_PATH_GUI + "basicmachines/PlasmaArcFurnace", 1, 4, 1, 1, 1, E, 1, E, true, true); public static final GT_Recipe_Map sArcFurnaceRecipes = new GT_Recipe_Map(new HashSet(10000), "gt.recipe.arcfurnace", "Arc Furnace", null, RES_PATH_GUI + "basicmachines/ArcFurnace", 1, 4, 1, 1, 3, E, 1, E, true, true); diff --git a/src/main/java/gregtech/common/GT_RecipeAdder.java b/src/main/java/gregtech/common/GT_RecipeAdder.java index e8dfc4615a..9f993d25d0 100644 --- a/src/main/java/gregtech/common/GT_RecipeAdder.java +++ b/src/main/java/gregtech/common/GT_RecipeAdder.java @@ -836,7 +836,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if(tItem==null)System.out.println("addAssemblylineRecipe"+aResearchItem.getDisplayName()); } GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Research result", new Object[0])}, null, null, aResearchTime, 30, 0); - GT_Recipe.GT_Recipe_Map.sAssemblylineFakeRecipes.addFakeRecipe(false, aInputs, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Research result", new Object[0])}, aFluidInputs, null, aDuration, aEUt, 0,true); + GT_Recipe.GT_Recipe_Map.sAssemblylineFakeRecipes.addFakeRecipe(true, aInputs, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Research result", new Object[0])}, aFluidInputs, null, aDuration, aEUt, 0,true); GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe_AssemblyLine( aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt)); return true; } diff --git a/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java b/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java index 227ce05d85..c1f0b90ad9 100644 --- a/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java +++ b/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java @@ -74,10 +74,6 @@ public class GT_NEI_AssLineHandler } } - public void clearRecipes(){ - this.arecipes.clear(); - } - public void loadCraftingRecipes(ItemStack aResult) { ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult); -- cgit From 18be8533663687315d6be7a301699bc25e8e364c Mon Sep 17 00:00:00 2001 From: Technus Date: Tue, 22 Nov 2016 20:36:56 +0100 Subject: Add more tooltips. --- .../machines/basic/GT_MetaTileEntity_SeismicProspector.java | 2 +- .../common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java index 0a8ab25936..cfef1ba345 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java @@ -31,7 +31,7 @@ public class GT_MetaTileEntity_SeismicProspector extends GT_MetaTileEntity_Basic boolean ready = false; public GT_MetaTileEntity_SeismicProspector(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "Place, activate with explosives(8 Dynamite, 1 Glyceryl, 4 TNT or 2 ITNT), use Data Stick", 1, 1, "Default.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER)}); + super(aID, aName, aNameRegional, aTier, 1, "Place, activate with explosives(8 Dynamite, 1 Glyceryl, 4 TNT or 2 ITNT), use Data Stick then Print.", 1, 1, "Default.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER)}); } public GT_MetaTileEntity_SeismicProspector(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java index efcafeddb1..213f061ea7 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java @@ -43,7 +43,8 @@ public class GT_MetaTileEntity_OilDrill extends GT_MetaTileEntity_MultiBlockBase "1x3x1 Steel Frame Boxes (Each Steel pillar side and on top)", "1x Output Hatch (One of base casings)", "1x Maintenance Hatch (One of base casings)", - "1x Energy Hatch (One of base casings)"}; + "1x Energy Hatch (One of base casings)", + "Also check the seismic prospector..."}; } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { -- cgit From 2b854dbe1d84fe1c93711d6189c235131343ec8e Mon Sep 17 00:00:00 2001 From: Technus Date: Tue, 22 Nov 2016 21:53:48 +0100 Subject: no message --- src/main/java/gregtech/common/GT_RecipeAdder.java | 2 +- src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/GT_RecipeAdder.java b/src/main/java/gregtech/common/GT_RecipeAdder.java index 9f993d25d0..e8dfc4615a 100644 --- a/src/main/java/gregtech/common/GT_RecipeAdder.java +++ b/src/main/java/gregtech/common/GT_RecipeAdder.java @@ -836,7 +836,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if(tItem==null)System.out.println("addAssemblylineRecipe"+aResearchItem.getDisplayName()); } GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Research result", new Object[0])}, null, null, aResearchTime, 30, 0); - GT_Recipe.GT_Recipe_Map.sAssemblylineFakeRecipes.addFakeRecipe(true, aInputs, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Research result", new Object[0])}, aFluidInputs, null, aDuration, aEUt, 0,true); + GT_Recipe.GT_Recipe_Map.sAssemblylineFakeRecipes.addFakeRecipe(false, aInputs, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Research result", new Object[0])}, aFluidInputs, null, aDuration, aEUt, 0,true); GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe_AssemblyLine( aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt)); return true; } diff --git a/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java b/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java index c1f0b90ad9..c917bb9e71 100644 --- a/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java +++ b/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java @@ -67,6 +67,8 @@ public class GT_NEI_AssLineHandler for (GT_Recipe tRecipe : this.mRecipeMap.mRecipeList) { if (!tRecipe.mHidden) { this.arecipes.add(new CachedDefaultRecipe(tRecipe)); + }else{ + this.arecipes.remove(new CachedDefaultRecipe(tRecipe)); } } } else { @@ -103,6 +105,14 @@ public class GT_NEI_AssLineHandler break; } } + }else{ + CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); + for (ItemStack tStack : tResults) { + if (tNEIRecipe.contains(tNEIRecipe.mOutputs, tStack)) { + this.arecipes.remove(tNEIRecipe); + break; + } + } } } CachedDefaultRecipe tNEIRecipe; @@ -137,6 +147,14 @@ public class GT_NEI_AssLineHandler break; } } + }else{ + CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); + for (ItemStack tStack : tInputs) { + if (tNEIRecipe.contains(tNEIRecipe.mInputs, tStack)) { + this.arecipes.remove(tNEIRecipe); + break; + } + } } } CachedDefaultRecipe tNEIRecipe; -- cgit From a650dc425c7294d1a1963a41302611e2dd07f08d Mon Sep 17 00:00:00 2001 From: Technus Date: Tue, 22 Nov 2016 21:57:55 +0100 Subject: Documentation on how to toggle recipe visibility --- src/main/java/gregtech/common/GT_Client.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java index fe2d3c71d7..9db8786767 100644 --- a/src/main/java/gregtech/common/GT_Client.java +++ b/src/main/java/gregtech/common/GT_Client.java @@ -76,6 +76,8 @@ public class GT_Client extends GT_Proxy private final List mMoltenNegB; private final List mMoltenNegA = Arrays.asList(new Object[0]); private long mAnimationTick; + /**This is the place to def the value used below**/ + //private long afterSomeTime; private boolean mAnimationDirection; private boolean isFirstClientPlayerTick; private String mMessage; @@ -360,6 +362,17 @@ public class GT_Client extends GT_Proxy public void onClientTickEvent(cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent aEvent) { if (aEvent.phase == cpw.mods.fml.common.gameevent.TickEvent.Phase.END) { mAnimationTick++; + /**Something on the lines of this works for recipe visibility toggling**/ + /**yes just change the mHidden thing, rest is done by custom NEI configurer GT_NEI_AssLineHandler**/ + //if(!isFirstClientPlayerTick)afterSomeTime++; + //if(afterSomeTime>=600L){ + // afterSomeTime=0; + // try { + // for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sAssemblylineFakeRecipes.mRecipeList) { + // recipe.mHidden ^= true; + // } + // }catch (Exception e){} + //} if (mAnimationTick % 50L == 0L) {mAnimationDirection = !mAnimationDirection;} int tDirection = mAnimationDirection ? 1 : -1; -- cgit From 0cedc2195a0ef2cff6009743d16ef318fa1a324a Mon Sep 17 00:00:00 2001 From: Technus Date: Thu, 24 Nov 2016 12:24:55 +0100 Subject: Achievement based unlocking done. --- src/main/java/gregtech/common/GT_Client.java | 28 ++++++++++++---------- .../gregtech/loaders/misc/GT_Achievements.java | 27 ++++++++++++++++++--- 2 files changed, 40 insertions(+), 15 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java index 9db8786767..7463893366 100644 --- a/src/main/java/gregtech/common/GT_Client.java +++ b/src/main/java/gregtech/common/GT_Client.java @@ -26,6 +26,7 @@ import gregtech.api.util.GT_Utility; import gregtech.common.entities.GT_Entity_Arrow; import gregtech.common.entities.GT_Entity_Arrow_Potion; import gregtech.common.render.*; +import gregtech.loaders.misc.GT_Achievements; import gregtech.nei.NEI_GT_Config; import ic2.api.tile.IWrenchable; import net.minecraft.block.Block; @@ -33,6 +34,8 @@ import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.stats.Achievement; +import net.minecraft.stats.StatFileWriter; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChatComponentText; import net.minecraft.world.World; @@ -77,7 +80,7 @@ public class GT_Client extends GT_Proxy private final List mMoltenNegA = Arrays.asList(new Object[0]); private long mAnimationTick; /**This is the place to def the value used below**/ - //private long afterSomeTime; + private long afterSomeTime; private boolean mAnimationDirection; private boolean isFirstClientPlayerTick; private String mMessage; @@ -287,6 +290,18 @@ public class GT_Client extends GT_Proxy @SubscribeEvent public void onPlayerTickEventClient(TickEvent.PlayerTickEvent aEvent) { if ((aEvent.side.isClient()) && (aEvent.phase == TickEvent.Phase.END) && (!aEvent.player.isDead)) { + /**Something on the lines of this works for recipe visibility toggling**/ + /**yes just change the mHidden thing, rest is done by custom NEI configurer GT_NEI_AssLineHandler**/ + afterSomeTime++; + if(afterSomeTime>=100L){ + afterSomeTime=0; + StatFileWriter sfw= Minecraft.getMinecraft().thePlayer.getStatFileWriter(); + try { + for(GT_Recipe recipe:GT_Recipe.GT_Recipe_Map.sAssemblylineFakeRecipes.mRecipeList){ + recipe.mHidden=!sfw.hasAchievementUnlocked(GT_Mod.achievements.getAchievement(recipe.getOutput(0).getUnlocalizedName())); + } + }catch (Exception e){} + } ArrayList tList = new ArrayList(); for (Map.Entry tEntry : GT_Utility.sPlayedSoundMap.entrySet()) { if (tEntry.getValue().intValue() < 0) {//Integer -> Integer -> int? >_<, fix @@ -362,17 +377,6 @@ public class GT_Client extends GT_Proxy public void onClientTickEvent(cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent aEvent) { if (aEvent.phase == cpw.mods.fml.common.gameevent.TickEvent.Phase.END) { mAnimationTick++; - /**Something on the lines of this works for recipe visibility toggling**/ - /**yes just change the mHidden thing, rest is done by custom NEI configurer GT_NEI_AssLineHandler**/ - //if(!isFirstClientPlayerTick)afterSomeTime++; - //if(afterSomeTime>=600L){ - // afterSomeTime=0; - // try { - // for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sAssemblylineFakeRecipes.mRecipeList) { - // recipe.mHidden ^= true; - // } - // }catch (Exception e){} - //} if (mAnimationTick % 50L == 0L) {mAnimationDirection = !mAnimationDirection;} int tDirection = mAnimationDirection ? 1 : -1; diff --git a/src/main/java/gregtech/loaders/misc/GT_Achievements.java b/src/main/java/gregtech/loaders/misc/GT_Achievements.java index a4ff8f774d..83a6971d44 100644 --- a/src/main/java/gregtech/loaders/misc/GT_Achievements.java +++ b/src/main/java/gregtech/loaders/misc/GT_Achievements.java @@ -15,6 +15,7 @@ import gregtech.api.objects.ItemData; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; import gregtech.common.items.GT_MetaGenerated_Tool_01; import ic2.core.Ic2Items; import net.minecraft.entity.player.EntityPlayer; @@ -38,6 +39,7 @@ public class GT_Achievements { public static List oreList = new ArrayList(); public static List oreStats = new ArrayList(); public static int oreReg = -1; + public static int assReg=-1; public ConcurrentHashMap achievementList; public ConcurrentHashMap issuedAchievements; public int adjX = 5; @@ -71,6 +73,10 @@ public class GT_Achievements { } registerOreAchievement(oreList.get(i)); } + + for(GT_Recipe recipe: GT_Recipe.GT_Recipe_Map.sAssemblylineFakeRecipes.mRecipeList) + registerAssAchievement(recipe); + registerAchievement("flintpick", 0, 0, GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(2, 1, Materials.Flint, Materials.Wood, null), "", false); registerAchievement("crops", -4, 0, GT_ModHandler.getIC2Item("crop", 1L), "flintpick", false); registerAchievement("havestlead", -4, 2, ItemList.Crop_Drop_Plumbilia.get(1, new Object[]{}), "crops", false); @@ -215,7 +221,6 @@ public class GT_Achievements { if (!GT_Mod.gregtechproxy.mAchievements) { return null; } - ; Achievement achievement = new Achievement(textId, textId, this.adjX + x, this.adjY + y, icon, requirement); if (special) { achievement.setSpecial(); @@ -256,6 +261,15 @@ public class GT_Achievements { return null; } + public Achievement registerAssAchievement(GT_Recipe recipe) { + if (this.achievementList.get(recipe.getOutput(0).getUnlocalizedName()) == null) { + assReg++; + return registerAchievement(recipe.getOutput(0).getUnlocalizedName(), -(11 + assReg % 5), ((assReg) / 5) - 8, recipe.getOutput(0) + , AchievementList.openInventory, false); + } + return null; + } + public void issueAchievement(EntityPlayer entityplayer, String textId) { if (entityplayer == null || !GT_Mod.gregtechproxy.mAchievements) { return; @@ -561,8 +575,15 @@ public class GT_Achievements { } } else if (stack.getUnlocalizedName().equals("gt.Thoriumcell")) { issueAchievement(player, "newfuel"); - }else if ((stack.getItem() == Ic2Items.quantumBodyarmor.getItem()) || (stack.getItem() == Ic2Items.quantumBoots.getItem()) || + } else if ((stack.getItem() == Ic2Items.quantumBodyarmor.getItem()) || (stack.getItem() == Ic2Items.quantumBoots.getItem()) || (stack.getItem() == Ic2Items.quantumHelmet.getItem()) || (stack.getItem() == Ic2Items.quantumLeggings.getItem())) { - issueAchievement(player, "buildQArmor");} + issueAchievement(player, "buildQArmor"); + } + for(GT_Recipe recipe: GT_Recipe.GT_Recipe_Map.sAssemblylineFakeRecipes.mRecipeList){ + if(recipe.getOutput(0).getUnlocalizedName().equals(stack.getUnlocalizedName())) { + issueAchievement(player, recipe.getOutput(0).getUnlocalizedName()); + recipe.mHidden=false; + } + } } } \ No newline at end of file -- cgit From 8cd95d65827830ff110c2b358d28d206e2ec9962 Mon Sep 17 00:00:00 2001 From: Technus Date: Thu, 24 Nov 2016 13:01:53 +0100 Subject: Failsafe --- .../generators/GT_MetaTileEntity_DieselGenerator.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java index 7d48752076..af6487a08f 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java @@ -1,5 +1,6 @@ package gregtech.common.tileentities.generators; +import com.dreammaster.main.MainRegistry; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; @@ -63,6 +64,15 @@ public class GT_MetaTileEntity_DieselGenerator return rValue; } + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if(aTick%100==0 && mFluid!=null && mFluid.amount>this.getCapacity()){ + MainRegistry.Logger.error("Dupe Abuse: "+aBaseMetaTileEntity.getOwnerName()+" Coords: "+aBaseMetaTileEntity.getXCoord()+" "+aBaseMetaTileEntity.getYCoord()+" "+aBaseMetaTileEntity.getZCoord(),aBaseMetaTileEntity); + aBaseMetaTileEntity.setToFire(); + } + super.onPostTick(aBaseMetaTileEntity, aTick); + } + public ITexture[] getFront(byte aColor) { return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; } -- cgit