Zedicus Posted March 21, 2013 Share Posted March 21, 2013 Two questions, a) Why do I get the message 'Cannot send to channel: #minecraftforge' I'm fairly sure my account's registered on IRC, etc. And an actual modding question - b) How would you go about removing a vanilla recipe, not asking for all the code unless it's one line, just removes some of the fun if someone else writes your mod for you, haha, just curious If I'm required to write an event or if there's a more simple way. Thanks, Zed! Quote Link to comment Share on other sites More sharing options...
Zedicus Posted March 21, 2013 Author Share Posted March 21, 2013 Thank you kindly, will download hexchat. Quote Link to comment Share on other sites More sharing options...
Zedicus Posted March 22, 2013 Author Share Posted March 22, 2013 Rather than posting a new thread I thought to add it here - Main Class - PostInit: @PostInit public void PostInit(FMLPostInitializationEvent event) { RecipeRemover.RecipeRemoval(); } Actual method in RecipeRemover: public static void RecipeRemoval(){ List RecipeList = CraftingManager.getInstance().getRecipeList(); int ListSize = RecipeList.size(); for(int i = 0; i < ListSize; i++) { Object o = RecipeList.get(i); System.out.println("check"); if(o == (new ItemStack(Item.brewingStand))) { System.out.println("RECIPE REMOVED"); RecipeList.remove(i); } } } I'm sure I've made a stupid mistake somewhere along there, but my main issue is how to I tell which recipe's which, a.k.a. the: if(o == (new ItemStack(Item.brewingStand))) { Part. Thanks. (It should be noted that the method doesn't appear to be getting called at all, I did some tests with System.out's and it returned nothing on start up, other than the preinit posting a string, the init registered an item but wouldn't 'post' a string, leading to some confusion about when the methods 'fire', so to speak.) Quote Link to comment Share on other sites More sharing options...
RANKSHANK Posted March 22, 2013 Share Posted March 22, 2013 You're going to want to keep the crafting manager's list 'safe' since the code is run both on integrated and client threads, that is to say say to prevent dual thread access errors you'll need List<IRecipe> l = new ArrayList<IRecipe>(); l.addAll(CraftingManager.instance.getRecipeList()); then iterate the list l to find recipes which have outcomes matching Item.brewingStand Then use CraftingManager.instance.getRecipeList().remove(recipe/*the recipe you grabbed through itsra */); Quote I think its my java of the variables. Link to comment Share on other sites More sharing options...
Recommended Posts
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.