Herpahermaderp Posted April 22, 2013 Posted April 22, 2013 Alright, so, I need to 'remove' the wood tools, the wood pick, shovel, ax, etc., but I don't know how to go about doing it. I've tried extending and overriding Item, but it tells me that I can't. I really don't want to have to go about editing the main files, since that will ruin compatibility : P. Quote
Herpahermaderp Posted April 22, 2013 Author Posted April 22, 2013 Alright, so, I need to 'remove' the wood tools, the wood pick, shovel, ax, etc., but I don't know how to go about doing it. I've tried extending and overriding Item, but it tells me that I can't. I really don't want to have to go about editing the main files, since that will ruin compatibility : P. Quote
Flenix Posted April 23, 2013 Posted April 23, 2013 Someone may well correct me on this, but I'm not sure if you can. It's something I've considered before (I wanted to remove all swords and armor for my futuristic server) but I couldn't find any way of doing it without modifying the base classes. There might be some sort of clever way of disabling them from being crafted or put into creative mode, but I don't know about entirely removing them. Quote http://s13.postimg.org/z9mlly2av/siglogo.png[/img] My mods (Links coming soon) Cities | Roads | Remula | SilvaniaMod | MoreStats
Flenix Posted April 23, 2013 Posted April 23, 2013 Someone may well correct me on this, but I'm not sure if you can. It's something I've considered before (I wanted to remove all swords and armor for my futuristic server) but I couldn't find any way of doing it without modifying the base classes. There might be some sort of clever way of disabling them from being crafted or put into creative mode, but I don't know about entirely removing them. Quote http://s13.postimg.org/z9mlly2av/siglogo.png[/img] My mods (Links coming soon) Cities | Roads | Remula | SilvaniaMod | MoreStats
Moritz Posted April 23, 2013 Posted April 23, 2013 why don't you delete the recipes of the wooden tools? Would that help? If yes do not say i do not know how that works. Search for terrafirmacraft at github. They have a function that called RemoveRecipe in their Class: TerraFirmaCraft and if you copy this function into your mod it have to look like this when you use it: RemoveRecipe(new ItemStack(Block.brick, 1)); Quote
Moritz Posted April 23, 2013 Posted April 23, 2013 why don't you delete the recipes of the wooden tools? Would that help? If yes do not say i do not know how that works. Search for terrafirmacraft at github. They have a function that called RemoveRecipe in their Class: TerraFirmaCraft and if you copy this function into your mod it have to look like this when you use it: RemoveRecipe(new ItemStack(Block.brick, 1)); Quote
saxon564 Posted April 23, 2013 Posted April 23, 2013 id just like to say that what Moritz said does work, i needed the same thing and just did it. thank you so much! Quote
saxon564 Posted April 23, 2013 Posted April 23, 2013 id just like to say that what Moritz said does work, i needed the same thing and just did it. thank you so much! Quote
Herpahermaderp Posted April 23, 2013 Author Posted April 23, 2013 why don't you delete the recipes of the wooden tools? Would that help? If yes do not say i do not know how that works. Search for terrafirmacraft at github. They have a function that called RemoveRecipe in their Class: TerraFirmaCraft and if you copy this function into your mod it have to look like this when you use it: RemoveRecipe(new ItemStack(Block.brick, 1)); Yeah, I knew about this, I just wanted to know if there was an alternative. Quote
Herpahermaderp Posted April 23, 2013 Author Posted April 23, 2013 why don't you delete the recipes of the wooden tools? Would that help? If yes do not say i do not know how that works. Search for terrafirmacraft at github. They have a function that called RemoveRecipe in their Class: TerraFirmaCraft and if you copy this function into your mod it have to look like this when you use it: RemoveRecipe(new ItemStack(Block.brick, 1)); Yeah, I knew about this, I just wanted to know if there was an alternative. Quote
BLourenco Posted April 23, 2013 Posted April 23, 2013 I've been doing the same thing, trying to remove the recipe for the Golden Sword. The method seems to work for ShapelessRecipes (I tried (Item.book) and (Item.planks, 4)), but doesn't work for ShapedRecipes ((Item.stick, 4), (Item.jukebox), (Item.swordGold)). I'm thinking something's changed since the code was posted. My method call: removeRecipe(new ItemStack(Item.swordGold)); The Method: private static void removeRecipe(ItemStack resultItem) //Code by yope_fried inspired by pigalot { ItemStack recipeResult = null; ArrayList recipes = (ArrayList) CraftingManager.getInstance().getRecipeList(); for (int scan = 0; scan < recipes.size(); scan++) { IRecipe tmpRecipe = (IRecipe) recipes.get(scan); if (tmpRecipe instanceof ShapedRecipes) { ShapedRecipes recipe = (ShapedRecipes)tmpRecipe; recipeResult = recipe.getRecipeOutput(); } else if (tmpRecipe instanceof ShapelessRecipes) { ShapelessRecipes recipe = (ShapelessRecipes)tmpRecipe; recipeResult = recipe.getRecipeOutput(); } if (ItemStack.areItemStacksEqual(resultItem, recipeResult)) { System.out.println("Removed Recipe: " + recipes.get(scan) + " -> " + recipeResult); recipes.remove(scan); } } } EDIT: I got it to work, though I'm not sure if it is safe or not. I simply don't check what the recipe is an instance of anymore: private static void removeRecipe(ItemStack resultItem) //Code by yope_fried inspired by pigalot { ItemStack recipeResult = null; ArrayList recipes = (ArrayList) CraftingManager.getInstance().getRecipeList(); for (int scan = 0; scan < recipes.size(); scan++) { IRecipe tmpRecipe = (IRecipe) recipes.get(scan); recipeResult = tmpRecipe.getRecipeOutput(); if (ItemStack.areItemStacksEqual(resultItem, recipeResult)) { System.out.println("Removed Recipe: " + recipes.get(scan) + " -> " + recipeResult); recipes.remove(scan); } } } Quote
BLourenco Posted April 23, 2013 Posted April 23, 2013 I've been doing the same thing, trying to remove the recipe for the Golden Sword. The method seems to work for ShapelessRecipes (I tried (Item.book) and (Item.planks, 4)), but doesn't work for ShapedRecipes ((Item.stick, 4), (Item.jukebox), (Item.swordGold)). I'm thinking something's changed since the code was posted. My method call: removeRecipe(new ItemStack(Item.swordGold)); The Method: private static void removeRecipe(ItemStack resultItem) //Code by yope_fried inspired by pigalot { ItemStack recipeResult = null; ArrayList recipes = (ArrayList) CraftingManager.getInstance().getRecipeList(); for (int scan = 0; scan < recipes.size(); scan++) { IRecipe tmpRecipe = (IRecipe) recipes.get(scan); if (tmpRecipe instanceof ShapedRecipes) { ShapedRecipes recipe = (ShapedRecipes)tmpRecipe; recipeResult = recipe.getRecipeOutput(); } else if (tmpRecipe instanceof ShapelessRecipes) { ShapelessRecipes recipe = (ShapelessRecipes)tmpRecipe; recipeResult = recipe.getRecipeOutput(); } if (ItemStack.areItemStacksEqual(resultItem, recipeResult)) { System.out.println("Removed Recipe: " + recipes.get(scan) + " -> " + recipeResult); recipes.remove(scan); } } } EDIT: I got it to work, though I'm not sure if it is safe or not. I simply don't check what the recipe is an instance of anymore: private static void removeRecipe(ItemStack resultItem) //Code by yope_fried inspired by pigalot { ItemStack recipeResult = null; ArrayList recipes = (ArrayList) CraftingManager.getInstance().getRecipeList(); for (int scan = 0; scan < recipes.size(); scan++) { IRecipe tmpRecipe = (IRecipe) recipes.get(scan); recipeResult = tmpRecipe.getRecipeOutput(); if (ItemStack.areItemStacksEqual(resultItem, recipeResult)) { System.out.println("Removed Recipe: " + recipes.get(scan) + " -> " + recipeResult); recipes.remove(scan); } } } Quote
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.