Posted April 18, 201411 yr is it all possible to add conditions to recipes being avaliable an example of what im trying to do (but failed in doing so) is if(StorageMiningLevel.get(player).GetLevel() > 5){ TestRecipes.instance().AddRecipe(new ItemStack(Items.stick), new ItemStack(Items.diamond)); } or if(StorageMiningLevel.get(player).GetLevel() > 5){ GameRegistry.addShapedRecipe(new ItemStack(ModBlocks.BlackQuartz), new Object[]{"QQ", "QQ", 'Q', ModItems.BlackNetherQuartz}); } long story short im trying to make crafting recipes only available on the condition that the player is the required level but every attempt im making is making the game crash..... is it all possible or is there another way around it?
April 18, 201411 yr Author are you asking for my main cause you assume thats where i register my recipes? if so i actually have them in a separate file if that what your wanting, though if you need my main for another purpose i can provide that crash report is as follows A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at com.MCR.MinecraftReloaded.LevelingLib.StorageMiningLevel.get(StorageMiningLevel.java:47) at com.MCR.MinecraftReloaded.Lib.Crafting.RegisterRecipes(Crafting.java:82) at com.MCR.MinecraftReloaded.Main.MinecraftReloaded.preInit(MinecraftReloaded.java:163) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:209) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:188) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119) at cpw.mods.fml.common.Loader.loadMods(Loader.java:495) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:201) at net.minecraft.client.Minecraft.startGame(Minecraft.java:522) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:892) at net.minecraft.client.main.Main.main(Main.java:112) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
April 18, 201411 yr Author hmm reading that, im not sure it will really work (im new so i may not be understanding it properly) but it seems those check and things are for crafting results in general you cant define item specifics in there, i need quite a lot of items to be crafted on the condition that the level requirement is met...... is there by any chance an on crafting event? through use of packet handlers and setting and changing nbt data that holds a value (level) ive crated a leveling system, its set up that i can retrieve that value through StorageLevel.get(player).GetLevel() ive used it for a lot of events before what i want to do it have set values that items are able to be crafted,eg if level 1 then allow item1 to be crafted if level two allow item2 to be crafted and so on the thing you linked me to as far as i could interpret it was adding extra conditions to items being crafted but it seems like it couldnt be used to achieve what im trying to achieve so would it be possible to use some oncrafted event if it exists?
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.