Immersive Engineering

Immersive Engineering

134M Downloads

[1.12.2] Metal Press API Usage?

SanjivanM opened this issue ยท 6 comments

commented

How do I use the metal press API? I'm trying to create a utility mod that will allow the creation of JAOPCA coins in the metal press (using a custom mold), and I can't seem to find out how to use the Metal Press API. I've looked at IE's usage, but replicating the syntax doesn't seem to do much. Here's the code from my recipes class, the init method is called in PostInit

public class IECoinRecipes
{
	public static void initRecipes()
	{
		ComparableItemStack coin_mold = ApiUtils.createComparableItemStack(new ItemStack(ModItems.MOLD_COIN), true); //ApiUtils.createComparableItemStack(new ItemStack(ModItems.MOLD_COIN));
		MetalPressRecipe metal_test = new MetalPressRecipe(new ItemStack(Items.DIAMOND), new ItemStack(Items.WHEAT_SEEDS), coin_mold, 2000);
	}

}

I can't seem to attach the mold to the metal press (no mold was already attached), and the mold is created as a normal Minecraft Item.

Modlist:
Forge: 14.23.5.2831
Bibliocraft 2.4.5
Inspirations 0.2.9
JEI 4.15.0.293
Mantle 1.3.3.55
WrapUp 1.1.3
IE 0.12.92
JAOPCA 2.2.8.103

commented

Tried the same code in pre/init/post init, nothing worked, maybe I'm forgetting to tell IE that my mold item should be considered as such? Although I can't seem to see anything different between my code and IE's code

commented

How are you detecting this to not work?
Are you basing it solely off of JEI, or have you tried putting the mold in?
Have you used breakpoints to debug the calls? Have you tried printing the recipe list?
Heck are you even adding this recipe to the list? We even have an addRecipe method in that class. Why are you not using it?

Frankly, I'm not quite sure how to help you here. You're a developer. Visual inspection of your code tells me fairly little, and this tracker isn't designed for coding assistance.

commented

Have you considered not calling it in postInit? =p

commented

Well, I check and make sure IE and JAOPCA are present before I call it, and I do that in postInit

commented

OK, so I finally got it to work. I was being glitchy and didn't call the addRecipes Method... oops!

Now for the Workbench mold-making/ blueprint recipe... Hopefully, it's as easy as 1... 2... 3...

commented

I've been attempting to insert my mold into the metal press to see if my recipes registered.
I've not used the breakpoints yet, I'll have to go back into the API and do some more debugging; I must've overlooked the addRecipe() method...
I guess this is what happens if you come back to modding after 3ish months