Browse Source

Added an NEI Fake Recipe List for Toolhead + Handle Crafting

Gregorius Techneticies 3 months ago
parent
commit
27805c27cd
Signed by: Gregorius Techneticies <gregoriustech@gmail.com> GPG Key ID: 1B693EA14F2FD70F

+ 2
- 1
src/main/java/gregapi/data/RM.java View File

@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (c) 2020 GregTech-6 Team
2
+ * Copyright (c) 2021 GregTech-6 Team
3 3
  *
4 4
  * This file is part of GregTech.
5 5
  *
@@ -65,6 +65,7 @@ public class RM {
65 65
 	, BumbleQueens              = new RecipeMap                     (null, "gt.recipe.bumblequeen"                  , "Bumblebee Queen"                 , null, 0, 1, RES_PATH_GUI+"machines/Default"                   ,/*IN-OUT-MIN-ITEM=*/ 2, 6, 0,/*IN-OUT-MIN-FLUID=*/ 0, 0, 0,/*MIN*/ 1,/*AMP=*/ 1, ""                    ,    1, ""      , F, T, F, T, F, T, T)
66 66
 	, Trees                     = new RecipeMap                     (null, "gt.recipe.trees"                        , "Family Tree"                     , null, 0, 1, RES_PATH_GUI+"machines/FamilyTree"                ,/*IN-OUT-MIN-ITEM=*/ 2,12, 0,/*IN-OUT-MIN-FLUID=*/ 0, 0, 0,/*MIN*/ 1,/*AMP=*/ 1, ""                    ,    1, ""      , F, T, F, F, F, T, T)
67 67
 	, Other                     = new RecipeMap                     (null, "gt.recipe.other"                        , "Other Relations"                 , null, 0, 1, RES_PATH_GUI+"machines/Default"                   ,/*IN-OUT-MIN-ITEM=*/ 6, 6, 0,/*IN-OUT-MIN-FLUID=*/ 3, 3, 0,/*MIN*/ 1,/*AMP=*/ 1, ""                    ,    1, ""      , F, T, F, F, F, F, F)
68
+	, ToolHeads                 = new RecipeMap                     (null, "gt.recipe.toolhead"                     , "Craft Toolhead onto Handle"      , null, 0, 1, RES_PATH_GUI+"machines/Crafting2By2"              ,/*IN-OUT-MIN-ITEM=*/ 4, 1, 0,/*IN-OUT-MIN-FLUID=*/ 0, 0, 0,/*MIN*/ 0,/*AMP=*/ 0, ""                    ,    1, ""      , F, T, F, F, F, F, F)
68 69
 	
69 70
 	, Generifier                = new RecipeMap                     (null, "gt.recipe.generifier"                   , "Generifier"                      , null, 0, 1, RES_PATH_GUI+"machines/Generifier"                ,/*IN-OUT-MIN-ITEM=*/ 1, 1, 0,/*IN-OUT-MIN-FLUID=*/ 1, 1, 0,/*MIN*/ 1,/*AMP=*/ 1, ""                    ,    1, ""      , T, T, T, T, F, F, F)
70 71
 	, Boxinator                 = new RecipeMap                     (null, "gt.recipe.boxinator"                    , "Boxinator"                       , null, 0, 1, RES_PATH_GUI+"machines/Boxinator"                 ,/*IN-OUT-MIN-ITEM=*/ 2, 1, 2,/*IN-OUT-MIN-FLUID=*/ 0, 0, 0,/*MIN*/ 0,/*AMP=*/ 1, ""                    ,    1, ""      , T, T, T, T, F, T, T)

+ 8
- 8
src/main/java/gregapi/load/LoaderItemData.java View File

@@ -812,19 +812,19 @@ public class LoaderItemData implements Runnable {
812 812
 		for (byte i = 0; i < 16; i++) OM.reg(OP.dyeMixable.mNameInternal + DYE_OREDICTS_POST[i], ST.make(Items.dye, 1, i));
813 813
 		
814 814
 		if (MD.PFAA.mLoaded) {
815
-			OM.reg(OD.blockClay             , ST.make(MD.PFAA, "weakClay"   , 1,  0));
816
-			OM.reg(OD.blockClay             , ST.make(MD.PFAA, "weakOreClay", 1,  1));
817
-			OM.reg(OD.blockClay             , ST.make(MD.PFAA, "weakOreClay", 1,  2));
818
-			OM.reg(OD.blockClay             , ST.make(MD.PFAA, "weakOreClay", 1,  3));
815
+			OM.reg(OD.blockClay, ST.make(MD.PFAA, "weakClay"   , 1,  0));
816
+			OM.reg(OD.blockClay, ST.make(MD.PFAA, "weakOreClay", 1,  1));
817
+			OM.reg(OD.blockClay, ST.make(MD.PFAA, "weakOreClay", 1,  2));
818
+			OM.reg(OD.blockClay, ST.make(MD.PFAA, "weakOreClay", 1,  3));
819 819
 			OM.data(MD.PFAA, "weakClay"   , 1,  0, MT.ClayBrown             , U*4);
820 820
 			OM.data(MD.PFAA, "weakOreClay", 1,  1, MT.Bentonite             , U*4);
821 821
 			OM.data(MD.PFAA, "weakOreClay", 1,  2, MT.Palygorskite          , U*4);
822 822
 			OM.data(MD.PFAA, "weakOreClay", 1,  3, MT.Kaolinite             , U*4);
823 823
 			
824
-			OM.reg(OD.itemClay              , ST.make(MD.PFAA, "earthyClump", 1, 45));
825
-			OM.reg(OD.itemClay              , ST.make(MD.PFAA, "earthyClump", 1, 47));
826
-			OM.reg(OD.itemClay              , ST.make(MD.PFAA, "earthyClump", 1, 48));
827
-			OM.reg(OD.itemClay              , ST.make(MD.PFAA, "earthyClump", 1, 49));
824
+			OM.reg(OD.itemClay , ST.make(MD.PFAA, "earthyClump", 1, 45));
825
+			OM.reg(OD.itemClay , ST.make(MD.PFAA, "earthyClump", 1, 47));
826
+			OM.reg(OD.itemClay , ST.make(MD.PFAA, "earthyClump", 1, 48));
827
+			OM.reg(OD.itemClay , ST.make(MD.PFAA, "earthyClump", 1, 49));
828 828
 			OM.data(MD.PFAA, "earthyClump", 1, 37, MT.OREMATS.YellowLimonite, U);
829 829
 			OM.data(MD.PFAA, "earthyClump", 1, 45, MT.ClayBrown             , U);
830 830
 			OM.data(MD.PFAA, "earthyClump", 1, 46, MT.OREMATS.Bauxite       , U);

+ 22
- 2
src/main/java/gregapi/recipes/AdvancedCraftingTool.java View File

@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (c) 2020 GregTech-6 Team
2
+ * Copyright (c) 2021 GregTech-6 Team
3 3
  *
4 4
  * This file is part of GregTech.
5 5
  *
@@ -25,10 +25,13 @@ import gregapi.code.ICondition;
25 25
 import gregapi.data.CS.ToolsGT;
26 26
 import gregapi.data.MT;
27 27
 import gregapi.data.OP;
28
+import gregapi.data.RM;
29
+import gregapi.data.TD;
28 30
 import gregapi.item.multiitem.MultiItemTool;
29 31
 import gregapi.oredict.OreDictItemData;
30 32
 import gregapi.oredict.OreDictMaterial;
31 33
 import gregapi.oredict.OreDictPrefix;
34
+import gregapi.oredict.event.IOreDictListenerEvent;
32 35
 import gregapi.util.OM;
33 36
 import gregapi.util.ST;
34 37
 import gregapi.util.UT;
@@ -41,7 +44,7 @@ import net.minecraftforge.oredict.ShapelessOreRecipe;
41 44
  * @author Gregorius Techneticies
42 45
  */
43 46
 @SuppressWarnings({"unchecked", "rawtypes"})
44
-public class AdvancedCraftingTool extends ShapelessOreRecipe implements ICraftingRecipeGT {
47
+public class AdvancedCraftingTool extends ShapelessOreRecipe implements ICraftingRecipeGT, IOreDictListenerEvent {
45 48
 	public final ICondition mCondition;
46 49
 	public final OreDictPrefix mToolHead;
47 50
 	public final short mToolID;
@@ -60,6 +63,23 @@ public class AdvancedCraftingTool extends ShapelessOreRecipe implements ICraftin
60 63
 		mCondition = aCondition;
61 64
 		mToolHead = aToolHead;
62 65
 		mToolID = UT.Code.bind15(aToolID);
66
+		
67
+		aToolHead.addListener(this);
68
+	}
69
+	
70
+	@Override
71
+	public void onOreRegistration(OreDictRegistrationContainer aEvent) {
72
+		if (mCondition.isTrue(aEvent.mMaterial)) {
73
+			if (!aEvent.mMaterial.mHandleMaterial.contains(TD.Properties.INVALID_MATERIAL)) {
74
+				ItemStack tHandle = OP.stick.mat(aEvent.mMaterial.mHandleMaterial, 1);
75
+				if (ST.valid(tHandle)) RM.ToolHeads.addRecipeX(F,F,T,F,F, 0, 0, ST.array(aEvent.mStack, NI, tHandle), mTool.getToolWithStats(mToolID, aEvent.mMaterial, aEvent.mMaterial.mHandleMaterial));
76
+			}
77
+			for (OreDictMaterial tHandleMaterial : aEvent.mMaterial.mHandleMaterial.mToThis)
78
+			if (!tHandleMaterial                 .contains(TD.Properties.INVALID_MATERIAL)) {
79
+				ItemStack tHandle = OP.stick.mat(tHandleMaterial                 , 1);
80
+				if (ST.valid(tHandle)) RM.ToolHeads.addRecipeX(F,F,T,F,F, 0, 0, ST.array(aEvent.mStack, NI, tHandle), mTool.getToolWithStats(mToolID, aEvent.mMaterial, tHandleMaterial));
81
+			}
82
+		}
63 83
 	}
64 84
 	
65 85
 	@Override

+ 1
- 1
src/main/java/gregapi/worldgen/dungeon/DungeonChunkRoomPortalEnd.java View File

@@ -47,7 +47,7 @@ public class DungeonChunkRoomPortalEnd extends DungeonChunkRoomVault {
47 47
 		
48 48
 		if (ST.valid(tPurpurBlock) && ST.valid(tPurpurPillar)) {
49 49
 			for (int tX = 1; tX < 15; tX++) for (int tZ = 1; tZ < 15; tZ++) {
50
-				if ((tX == 1 || tX == 2 || tX == 13 || tX == 14) && (tZ == 1 || tZ == 1 || tZ == 13 || tZ == 14)) {
50
+				if ((tX == 1 || tX == 2 || tX == 13 || tX == 14) && (tZ == 1 || tZ == 2 || tZ == 13 || tZ == 14)) {
51 51
 					aData.set  (tX, 0, tZ, tPurpurPillar, 0);
52 52
 					aData.set  (tX, 1, tZ, tPurpurPillar, 0);
53 53
 					aData.set  (tX, 2, tZ, tPurpurPillar, 0);

+ 2
- 2
src/main/java/gregapi/worldgen/dungeon/DungeonData.java View File

@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (c) 2020 GregTech-6 Team
2
+ * Copyright (c) 2021 GregTech-6 Team
3 3
  *
4 4
  * This file is part of GregTech.
5 5
  *
@@ -231,7 +231,7 @@ public class DungeonData extends WorldAndCoords {
231 231
 	}
232 232
 	
233 233
 	public boolean obsidian(int aX, int aY, int aZ, boolean aGravity) {
234
-		return set(aX, aY, aZ, Blocks.obsidian, 0, IL.NeLi_Obsidian.exists() ? IL.NeLi_Obsidian.block() : IL.NePl_Obsidian.block(), 0, IL.EtFu_Obsidian.block(), 0, aGravity ? IL.RC_Crushed_Obsidian.block() : Blocks.obsidian, aGravity ? 4 : 0);
234
+		return set(aX, aY, aZ, Blocks.obsidian, 0, IL.NeLi_Obsidian.exists() ? IL.NeLi_Obsidian.block() : IL.NePl_Obsidian.block(), 0, IL.EtFu_Obsidian.block(), 0, aGravity && IL.RC_Crushed_Obsidian.exists() ? IL.RC_Crushed_Obsidian.block() : Blocks.obsidian, aGravity && IL.RC_Crushed_Obsidian.exists() ? 4 : 0);
235 235
 	}
236 236
 	
237 237
 	public boolean flower(int aX, int aY, int aZ) {

+ 1
- 1
src/main/java/gregtech/loaders/a/Loader_Tools.java View File

@@ -334,7 +334,7 @@ public class Loader_Tools implements Runnable {
334 334
 		
335 335
 		GameRegistry.addRecipe(new AdvancedCraftingTool(MAGNIFYING_GLASS , lens                       , typemin(1), MT.Glass));
336 336
 		GameRegistry.addRecipe(new AdvancedCraftingTool(HARDHAMMER       , toolHeadHammer             , new Nor(WOOD, BOUNCY, STRETCHY)));
337
-		GameRegistry.addRecipe(new AdvancedCraftingTool(SOFTHAMMER       , toolHeadHammer             , new Or (WOOD, BOUNCY, STRETCHY), ANY.Wood));
337
+		GameRegistry.addRecipe(new AdvancedCraftingTool(SOFTHAMMER       , toolHeadHammer             , new Or (WOOD, BOUNCY, STRETCHY), MT.Rubber));
338 338
 		GameRegistry.addRecipe(new AdvancedCraftingTool(SWORD            , toolHeadSword              ));
339 339
 		GameRegistry.addRecipe(new AdvancedCraftingTool(BUILDERWAND      , toolHeadBuilderwand        , MT.YellowSapphire)); // Suggests using Gems for those Wands since you usually only have one workable Gem per Type.
340 340
 		GameRegistry.addRecipe(new AdvancedCraftingTool(CONSTRUCTION_PICK, toolHeadConstructionPickaxe));

BIN
src/main/resources/assets/gregtech/textures/gui/machines/Crafting2By2.png View File


Loading…
Cancel
Save