Jump to content

Crafting with armours


jordsta95
 Share

Recommended Posts

Hey there, I am having an issue with crafting... yeah, very nooblike.

I have always avoided crafting with armours/tools, because they have always been awkward (when I have tried to do them), but I don't see why this doesn't work:

 

    if(Loader.isModLoaded("Thaumcraft")){

        Item goggles = (Item) Item.itemRegistry.getObject("Thaumcraft:ItemGoggles");

        GameRegistry.addShapelessRecipe(new ItemStack(itemRegist.visViewerS),

        new ItemStack(itemRegist.superHelmet), new ItemStack(goggles)

        );

        }

       

 

To be honest, I don't know what the thaumcraft thing actually does, I am not going to lie, I copied it from a different mod which does the exact same crafting recipe I am trying to do, and it works there.

However, when I try to combine the Goggles of Revealing (Thaumcraft:ItemGoggles) and superHelmet it doesn't allow me to craft the visViewerS

 

 

 

The code I copied:

 

 

Item goggles = (Item) Item.itemRegistry.getObject("Thaumcraft:ItemGoggles");

GameRegistry.addShapelessRecipe(new ItemStack(ModItems.manasteelHelmRevealing), new ItemStack(ModItems.manasteelHelm), new ItemStack(goggles));

 

 

Why bother?

Link to comment
Share on other sites

Just a quick quick Question have you registered the recipes and all the BS?

@EventHandler
   public void preInit(FMLInitializationEvent event){
	log.info("Mod Load pre run started");
                //name of you recipes class  . whatever your Init funtion for recipes is called ();
    	        Recipes.initShaplessRecipes();
}

Link to comment
Share on other sites

Just a quick quick Question have you registered the recipes and all the BS?

@EventHandler
   public void preInit(FMLInitializationEvent event){
	log.info("Mod Load pre run started");
                //name of you recipes class  . whatever your Init funtion for recipes is called ();
    	        Recipes.initShaplessRecipes();
}

Here's the full class file, where everything but that one recipe works:

http://pastebin.com/mupfHBNk

The Thaumcraft recipe starts at line 122

 

Sorry for the code being very ugly

Why bother?

Link to comment
Share on other sites

Does your mod get loaded after the Thaumcraft mod loaded?

You should make your mod loaded after Thaumcraft if you want to add the recipe on the preInit.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

Does your mod get loaded after the Thaumcraft mod loaded?

You should make your mod loaded after Thaumcraft if you want to add the recipe on the preInit.

How would I do that, other than calling the jar zName or change thaumcraft to aThaumcraft?

Why bother?

Link to comment
Share on other sites

Add the recipies in

FMLInitializationEvent

, that way all the Items (including Thaumcraft's) are loaded, so you can use them in recipies.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I have a custom recipe that uses JSON to work properly. And everything works right except I cant seem to figure out how to find the stack count for each ingredient of my recipe.   Recipe class: public class AlloyKilnRecipe implements Recipe<SimpleContainer> { private final ResourceLocation id; private final ItemStack output; private final NonNullList<Ingredient> ingredients; public AlloyKilnRecipe(ResourceLocation id, ItemStack output, NonNullList<Ingredient> ingredients) { this.id = id; this.output = output; this.ingredients = ingredients; } @Override public boolean matches(SimpleContainer pContainer, Level pLevel) { if (pLevel.isClientSide()) return false; return (ingredients.get(0).test(pContainer.getItem(0)) && ingredients.get(1).test(pContainer.getItem(1))) || (ingredients.get(0).test(pContainer.getItem(1)) && ingredients.get(1).test(pContainer.getItem(0))); } public int getIngAmnt(int index) { ItemStack[] stacks = ingredients.get(index).getItems(); for (ItemStack stack : stacks) { return stack.getCount(); } return 0; } @Override public NonNullList<Ingredient> getIngredients() { return ingredients; } @Override public ItemStack assemble(SimpleContainer pContainer) { return output; } @Override public boolean canCraftInDimensions(int pWidth, int pHeight) { return true; } @Override public ItemStack getResultItem() { return output.copy(); } @Override public ResourceLocation getId() { return id; } @Override public RecipeSerializer<?> getSerializer() { return Serializer.INSTANCE; } @Override public RecipeType<?> getType() { return Type.INSTANCE; } public static class Type implements RecipeType<AlloyKilnRecipe> { private Type() {} public static final Type INSTANCE = new Type(); public static final String ID = "alloy_kiln_recipe"; } public static class Serializer implements RecipeSerializer<AlloyKilnRecipe> { public static final Serializer INSTANCE = new Serializer(); public static final ResourceLocation ID = new ResourceLocation(FF.MOD_ID, "alloy_kiln_recipe"); @Override public AlloyKilnRecipe fromJson(ResourceLocation pRecipeId, JsonObject pSerializedRecipe) { ItemStack output = ShapedRecipe.itemStackFromJson(GsonHelper.getAsJsonObject(pSerializedRecipe, "output")); JsonArray ingredients = GsonHelper.getAsJsonArray(pSerializedRecipe, "ingredients"); NonNullList<Ingredient> inputs = NonNullList.withSize(2, Ingredient.EMPTY); for (int i = 0; i < ingredients.size(); i++) { inputs.set(i, Ingredient.fromJson(ingredients.get(i))); } return new AlloyKilnRecipe(pRecipeId, output, inputs); } @Override public @Nullable AlloyKilnRecipe fromNetwork(ResourceLocation pRecipeId, FriendlyByteBuf pBuffer) { NonNullList<Ingredient> inputs = NonNullList.withSize(pBuffer.readInt(), Ingredient.EMPTY); for (int i = 0; i < inputs.size(); i++) { inputs.set(i, Ingredient.fromNetwork(pBuffer)); } ItemStack output = pBuffer.readItem(); return new AlloyKilnRecipe(pRecipeId, output, inputs); } @Override public void toNetwork(FriendlyByteBuf pBuffer, AlloyKilnRecipe pRecipe) { pBuffer.writeInt(pRecipe.getIngredients().size()); for (Ingredient ing : pRecipe.getIngredients()) { ing.toNetwork(pBuffer); } pBuffer.writeItemStack(pRecipe.getResultItem(), false); } } } And here is my recipe.json { "type": "forgedfactory:alloy_kiln_recipe", "ingredients": [ { "item": "minecraft:iron_ingot", "count": 3 }, { "item": "minecraft:gold_ingot" } ], "output": { "item": "minecraft:diamond", "count": 3 } } Could someone tell me what I would have to do? The getIngAmount method just returns 1 even though I have a count defined for the iron ingots.
    • forge installer version 43.1.7 for 1.19.2 won't download the jar file, only the json 
    • Stop bumping your post. This sounds like a issue with your install. Try deleting your .minecraft folder and re-installing the launcher. Beyond that it's not something we control. As we don't control the launcher.
    • Can someone help me with this
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.