Jump to content

Crashing when getting ItemStack from OreDictionary


Raizunne

Recommended Posts

So I'm trying to get the Vibrant Alloy from EnderIO to an ItemStack to use it in the recipe for a machine. I've tryed getting it from the GameRegistry, no luck just fire. Now I'm trying to get it from the OreDictionary, still no luck. Here's my code:

 

ItemStack ingotPhasedGold = OreDictionary.getOres("ingotPhasedGold").get(0);

 

If I try that and add the ingotPhasedGold to a recipe or to the machine recipe, I crash. It says that there's no index with "0" but when I try outputing it to the console I get a "1xitem.itemAlloy@2" with I guess it means that the index DOES exist. So I just get a crash when using the OreDictionary with a recipe or when adding it to a machine recipe. What am I doing wrong?

Link to comment
Share on other sites

Here's what I'm trying to do.

ItemStack ingotPhasedGold = OreDictionary.getOres("ingotPhasedGold").get(0);
//Arguments - name, energy, slot1, slot2, slot3, output
EIOHelper.addAlloySmelterRecipe("Potatotato", 16000, ingotPhasedGold, ingotPhasedGold, ingotPhasedGold, Util.toStack(Items.potato));

 

Link to comment
Share on other sites

So your game crash on this line?

 

ItemStack ingotPhasedGold = OreDictionary.getOres("ingotPhasedGold").get(0);

Then how did you try outputing it to the console?

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

Located in my RedstonicRecipes.java in my init function. Here's what's there:

 

public staitic void init(){
        if(Loader.isModLoaded("EnderIO")){
              ItemStack ingotPhasedGold = OreDictionary.getOres("ingotPhasedGold").get(0);
              EIOHelper.addAlloySmelterRecipe("Vibrantium", 16000, ingotPhasedGold, ingotPhasedGold, ingotPhasedGold, Util.toStack(Items.potato));
        }
}

 

Then I call the RedstonicRecipes.init() in my preInit.

Link to comment
Share on other sites

ingotPhasedGold is a alloy from EnderIO, here's the class for the alloy. Here's the base class for the alloys.

https://github.com/CrazyPants/EnderIO/blob/master/src/main/java/crazypants/enderio/material/Alloy.java

 

On another class it adds the ore to the dictionary by using the oredictIngotName from that class. In this case the oredictIngotName is PhasedGold, so it ends up being ingotPhasedgold.

Link to comment
Share on other sites

Well that works, but now that I have my dependencies as

dependencies = "after:ThermalExpansion;after:EnderIO"

Thermal Expansion crashes with something that has nothing to do with my mod.

http://pastebin.com/WiSGBW1u

 

Is it because Im not using a deobf version of EnderIO?

 

Removed Thermal Expansion and everything works great.

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

Announcements



×
×
  • Create New...

Important Information

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