Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

EM3R50N

Members
  • Posts

    22
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Personal Text
    Long-time tree puncher

EM3R50N's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Thanks. Yeah - guess that makes sense now that you say it like that. I just never know how to find out if it's worth me trying to update my mods for a newer build of Minecraft without dusting off Eclipse, having my annual rage fight with gradle, etc ... only to find out Forge isn't really ready yet for that version. Guess I'll just keep trying every once in a while.
  2. Is there a sticky thread, GitHub repo or some other location where the "completion" progress of each version of Forge is posted? I try to wait until a specific version of Forge is mostly stable with the current version of MC before I updated my mods but at the moment the only way I know how to check this is to grab the latest forge/gradle files, setup a new project and look under the hood myself. How do other folks figure out how stable/"finished" each version of Forge is? Apologies if the thread/info is right under my nose here and I'm just missing it.
  3. Just realized a version of the recipe I was trying to remove was ALREADY IN VANILLA MINECRAFT... and that was what I was interpreting as a sign my recipes weren't removed yet. /headdesk x 100 God help me. @Draco18s @Cadiboo Thanks for trying to help/replying guys. Sorry for distraction
  4. Yeah deleting the commented out lines didn't change anything (again I'm desperate - realize that's crazy person logic). I guess I'm paying for my sins of not moving to JSON recipe format back when it first came out. If anyone know more about the IForgeRegistry and how that is handled and/or if it can be cleaned out/reset somehow please chime in? I obviously know very little about it right now but am assuming that's where my recipes are stuck because all my addShapeless() calls have been going through this public static void addRecipe(RegistryEvent.Register<IRecipe> event, String name, IRecipe rec) { final IForgeRegistry<IRecipe> registry = event.getRegistry(); if(rec.getRegistryName() == null) registry.register(rec.setRegistryName(new ResourceLocation(MODID, name))); else registry.register(rec); }
  5. I've had them all commented out the whole time I've been trying to get them out of my mod. All of them look like this right now // CraftingHelper.addShapeless(event, new ItemStack(Items.APPLE,0),new Object[]{Items.COAL}); // CraftingHelper.addShapeless(event, new ItemStack(Items.IRON_INGOT,0),new Object[]{Items.COAL}); // CraftingHelper.addShapeless(event, new ItemStack(Items.BONE_MEAL,0),new Object[]{Items.COAL}); Not sure if you're joking but I'm so desperate I'll try delete the commented out lines too!... but assuming that won't change anything.
  6. I know custom recipes went to JSON format quite a while ago but when I tried to start moving to that today I found out my recipes seem stuck in the mod/game and I can't clear them? All of them were added w/one of the addShapeless() methods from the CraftingHelper class below. I've tried cleaning my project, moving to updated version of forge and few other things but even though my addShapeless() recipes are commented out they're still in the game when I debug. Anyone know how to remove these recipes? It is driving me INSANE... Example of one my recipes CraftingHelper.addShapeless(event, new ItemStack(Items.APPLE,0),new Object[]{Items.COAL}); CraftingHelper class w/the addShapeless method(s): package com.me.mymod.util; import java.util.List; import com.me.mymod.Reference; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.Ingredient; import net.minecraft.item.crafting.ShapedRecipes; import net.minecraft.item.crafting.ShapelessRecipes; import net.minecraft.stats.RecipeBook; import net.minecraft.util.NonNullList; import net.minecraft.util.ResourceLocation; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.OreIngredient; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; import net.minecraftforge.registries.IForgeRegistry; public class CraftingHelper { private static int j = 0; private static final String MODID = Reference.MOD_ID;// Mod.MODID; private static final String MODNAME = Reference.MOD_NAME; // Mod.MODNAME; public static void addRecipe(RegistryEvent.Register<IRecipe> event, int j, IRecipe rec) { final IForgeRegistry<IRecipe> registry = event.getRegistry(); if(rec.getRegistryName() == null) registry.register(rec.setRegistryName(new ResourceLocation(MODID, "recipes" + j))); else registry.register(rec); } /* * This adds the recipe to the list of crafting recipes. Cares about names. */ public static void addRecipe(RegistryEvent.Register<IRecipe> event, String name, IRecipe rec) { final IForgeRegistry<IRecipe> registry = event.getRegistry(); if(rec.getRegistryName() == null) registry.register(rec.setRegistryName(new ResourceLocation(MODID, name))); else registry.register(rec); } /* * This adds a shaped recipe to the list of crafting recipes, using the forge format. */ public static void addOldShaped(RegistryEvent.Register<IRecipe> event, ItemStack output, Object... input) { addRecipe(event, j++, new ShapedOreRecipe(new ResourceLocation(MODID, "recipes" + j), output, input)); } /* * This adds a shaped recipe to the list of crafting recipes, using the forge format, with a custom group. */ public static void addOldShaped(RegistryEvent.Register<IRecipe> event, String group, ItemStack output, Object... input) { addRecipe(event, j++, new ShapedOreRecipe(new ResourceLocation(MODID, group), output, input)); } /* * This adds a shaped recipe to the list of crafting recipes, using the forge format, with a custom group. */ public static void addOldShaped(RegistryEvent.Register<IRecipe> event, String name, String group, ItemStack output, Object... input) { addRecipe(event, j++, new ShapedOreRecipe(new ResourceLocation(MODID, group), output, input).setRegistryName(MODID, name)); } /* * This adds a shapeless recipe to the list of crafting recipes, using the forge format. */ public static void addOldShapeless(RegistryEvent.Register<IRecipe> event, ItemStack output, Object... input) { addRecipe(event, j++, new ShapelessOreRecipe(new ResourceLocation(MODID, "recipes" + j), output, input)); } /* * This adds a shapeless recipe to the list of crafting recipes, using the forge format, with a custom group. */ public static void addOldShapeless(RegistryEvent.Register<IRecipe> event, String group, ItemStack output, Object... input) { addRecipe(event, j++, new ShapelessOreRecipe(new ResourceLocation(MODID, group), output, input)); } /* * Adds a shapeless recipe with X output using an array of inputs. Use Strings for OreDictionary support. This array is not ordered. */ public static void addShapeless(RegistryEvent.Register<IRecipe> event, ItemStack output, Object... inputs) { addRecipe(event, j++, new ShapelessRecipes(MODID + ":" + j, output, createInput(inputs))); } public static void addShapeless(int outputStackCount, RegistryEvent.Register<IRecipe> event, ItemStack output, Object... inputs) { output.setCount(outputStackCount); addRecipe(event, j++, new ShapelessRecipes(MODID + ":" + j, output, createInput(inputs))); } public static void addShapeless(RegistryEvent.Register<IRecipe> event, Item output, Object... inputs) { addShapeless(event, new ItemStack(output), inputs); } public static void addShapeless(RegistryEvent.Register<IRecipe> event, Block output, Object... inputs) { addShapeless(event, new ItemStack(output), inputs); } /* * Adds a shapeless recipe with X output using an array of inputs. Use Strings for OreDictionary support. This array is not ordered. This has a custom group. */ public static void addShapeless(RegistryEvent.Register<IRecipe> event, String group, ItemStack output, Object... inputs) { addRecipe(event, j++, new ShapelessRecipes(MODID + ":" + group, output, createInput(inputs))); } public static void addShapeless(RegistryEvent.Register<IRecipe> event, String group, Item output, Object... inputs) { addShapeless(event, group, new ItemStack(output), inputs); } public static void addShapeless(RegistryEvent.Register<IRecipe> event, String group, Block output, Object... inputs) { addShapeless(event, group, new ItemStack(output), inputs); } /* * Adds a shapeless recipe with X output on a crafting grid that is W x H, using an array of inputs. Use null for nothing, use Strings for OreDictionary support, this array must have a length of width * height. * This array is ordered, and items must follow from left to right, top to bottom of the crafting grid. */ public static void addShaped(RegistryEvent.Register<IRecipe> event, ItemStack output, int width, int height, Object... input) { addRecipe(event, j++, genShaped(output, width, height, input)); } public static void addShaped(RegistryEvent.Register<IRecipe> event, Item output, int width, int height, Object... input) { addShaped(event, new ItemStack(output), width, height, input); } public static void addShaped(RegistryEvent.Register<IRecipe> event, Block output, int width, int height, Object... input) { addShaped(event, new ItemStack(output), width, height, input); } /* * Adds a shapeless recipe with X output on a crafting grid that is W x H, using an array of inputs. Use null for nothing, use Strings for OreDictionary support, this array must have a length of width * height. * This array is ordered, and items must follow from left to right, top to bottom of the crafting grid. This has a custom group. */ public static void addShaped(RegistryEvent.Register<IRecipe> event, String group, ItemStack output, int width, int height, Object... input) { addRecipe(event, j++, genShaped(MODID + ":" + group, output, width, height, input)); } public static void addShaped(RegistryEvent.Register<IRecipe> event, String group, Item output, int width, int height, Object... input) { addShaped(event, group, new ItemStack(output), width, height, input); } public static void addShaped(RegistryEvent.Register<IRecipe> event, String group, Block output, int width, int height, Object... input) { addShaped(event, group, new ItemStack(output), width, height, input); } public static ShapedRecipes genShaped(ItemStack output, int l, int w, Object[] input) { if (input[0] instanceof Object[]) input = (Object[]) input[0]; if (l * w != input.length) throw new UnsupportedOperationException( "Attempted to add invalid shaped recipe. Complain to the author of " + MODNAME); NonNullList<Ingredient> inputL = NonNullList.create(); for (int i = 0; i < input.length; i++) { Object k = input[i]; if (k instanceof String) { inputL.add(i, new OreIngredient((String) k)); } else if (k instanceof ItemStack && !((ItemStack) k).isEmpty()) { inputL.add(i, Ingredient.fromStacks((ItemStack) k)); } else if (k instanceof Item) { inputL.add(i, Ingredient.fromStacks(new ItemStack((Item) k))); } else if (k instanceof Block) { inputL.add(i, Ingredient.fromStacks(new ItemStack((Block) k))); } else { inputL.add(i, Ingredient.EMPTY); } } return new ShapedRecipes(MODID + ":" + j, l, w, inputL, output); } public static ShapedRecipes genShaped(String group, ItemStack output, int l, int w, Object[] input) { if(input[0] instanceof List) input = ((List<?>) input[0]).toArray(); else if (input[0] instanceof Object[]) input = (Object[]) input[0]; if (l * w != input.length) throw new UnsupportedOperationException( "Attempted to add invalid shaped recipe. Complain to the author of " + MODNAME); NonNullList<Ingredient> inputL = NonNullList.create(); for (int i = 0; i < input.length; i++) { Object k = input[i]; if (k instanceof String) { inputL.add(i, new OreIngredient((String) k)); } else if (k instanceof ItemStack && !((ItemStack) k).isEmpty()) { inputL.add(i, Ingredient.fromStacks((ItemStack) k)); } else if (k instanceof Item) { inputL.add(i, Ingredient.fromStacks(new ItemStack((Item) k))); } else if (k instanceof Block) { inputL.add(i, Ingredient.fromStacks(new ItemStack((Block) k))); } else { inputL.add(i, Ingredient.EMPTY); } } return new ShapedRecipes(group, l, w, inputL, output); } public static NonNullList<Ingredient> createInput(Object[] input) { if(input[0] instanceof List) input = ((List<?>) input[0]).toArray(); else if (input[0] instanceof Object[]) input = (Object[]) input[0]; NonNullList<Ingredient> inputL = NonNullList.create(); for (int i = 0; i < input.length; i++) { Object k = input[i]; if (k instanceof String) { inputL.add(i, new OreIngredient((String) k)); } else if (k instanceof ItemStack) { inputL.add(i, Ingredient.fromStacks((ItemStack) k)); } else if (k instanceof Item) { inputL.add(i, Ingredient.fromStacks(new ItemStack((Item) k))); } else if (k instanceof Block) { inputL.add(i, Ingredient.fromStacks(new ItemStack((Block) k))); } else { throw new UnsupportedOperationException( "Attempted to add invalid shapeless recipe. Complain to the author of " + MODNAME); } } return inputL; } }
  7. Answering my own (noob) question in case anyone else out there gets stuck like I was. Basically I got it working by changing my I18n calls to this I18n.format("gui.config.category.toggles") I18n.format("gui.config.category.values") And changed my en_us.lang file to this: gui.config.category.toggles.tooltip=Toggles Tooltip text here gui.config.category.values.tooltip=Values Tooltip text here I kind of get the logic now ...
  8. I'll say first I am VERY new to using the *.lang file and have historically done the evil deed of putting my string text in my code instead. However so far I can't find a way to set the tooltips of my GuiScreen / ConfigElement category buttons any other way other than the en_us.lang file. So the good news is I can set the tooltip values of my mod config buttons now via my en_us.lang file ... but the bad news is that all the tooltips append the string ".tooltip" to the end of all of them - as seen here (or attached): https://imgur.com/lmdLATO Contents of my en_us.lang file #PARSE_ESCAPES gui.config.category.toggles=General Mod Settings gui.config.category.values=Adjust settings for Humanoid and Related Mobs gui.config.category.valuesla=Adjust settings for Large Animals gui.config.category.valuesma=Adjust settings for Medium Animals gui.config.category.valuessa=Adjust settings for Small Animals
  9. I am trying to flesh out different categories of my mod config but my code is more duplicated/non-dry than I'd prefer. I'd like to just have to define one public static class Whatever extends CategoryEntry vs having to do it for EVERY category of my mod config screens. Anyone out there know how to compress these two blocks into one, reusable, more absract/dry approach? public static class CategoryEntryToggles extends CategoryEntry{ public CategoryEntryToggles(GuiConfig owningScreen, GuiConfigEntries owningEntryList,IConfigElement configElement) { super(owningScreen, owningEntryList, configElement); } @Override protected GuiScreen buildChildScreen(){ Configuration config = Config.getConfig(); ConfigElement myCat = new ConfigElement(config.getCategory(Config.CATEGORY_TOGGLES)); List<IConfigElement> propertiesOnScreen = myCat.getChildElements(); String windowTitle = "Mod Config: Toggles"; return new GuiConfig(owningScreen, propertiesOnScreen, owningScreen.modID,this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart,this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart,windowTitle); } } // THIS IS BASICALLY COPY OF ABOVE WITH JUST DIFF myCat value =/ public static class CategoryEntryValues extends CategoryEntry{ public CategoryEntryValues(GuiConfig owningScreen, GuiConfigEntries owningEntryList,IConfigElement configElement) { super(owningScreen, owningEntryList, configElement); } @Override protected GuiScreen buildChildScreen(){ Configuration config = Config.getConfig(); ConfigElement myCat = new ConfigElement(config.getCategory(Config.CATEGORY_VALUES)); List<IConfigElement> propertiesOnScreen = myCat.getChildElements(); String windowTitle = "Mod Config: Values"; return new GuiConfig(owningScreen, propertiesOnScreen, owningScreen.modID,this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart,this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart,windowTitle); } }
  10. Thank you @V0idWa1k3r and @Draco18s. Much appreciated! All sorted out now. Sorry if I semi-hijacked this thread btw - I did come here trying to avoid a dup post. Again - thank you both.
  11. Yeah I'm struggling to hook into EntityJoinWorldEvent for Anvil. Admittedly I am not a MC mod/java pro so I could be doing it wrong but seems to only triggers when I place it on the ground. Ideally I'd like to find what event fires when the Anvil is "USED" to repair/upgrade something. Forge has that onAnvilUpdate() in the ForeHooks but that SEEMS to have zero information about the Anvil being used (only has cost, item left, item right etc) @Draco18s when does that falling action/chance moment fire? Is that happening inside an EntityJoinWorldEvent or another, more specific event?
  12. Thanks, @V0idWa1k3r. So would overriding those events/entity only affect new anvils or all (existing) anvils?
  13. I'm interested in altering the durability of the anvil as well but am struggling to get my head around where/what to do here. Am I right that EntityJoinWorldEvent and EntityFallingBlock events only occur when you first create/place the anvil the first time? Or does this fire every time you use the anvil?
  14. I found an old thread from WARDOGSK93 on how to give a custom player_head skull as an ItemStack but thread got locked because it was so old. Just wanted to share the method I made (updated to be 1.12.2 compatible) for this (I added giving it a custom name too). // REFERENCE: http://www.minecraftforge.net/forum/topic/24228-solved-1710-player-skulls/ private ItemStack GetCustomHead(String playerName, String headName) { ItemStack customHead = new ItemStack(Items.field_151144_bL, 1, 3); customHead.setTag(new NBTTagCompound()); customHead.getTag().setTag("SkullOwner", new NBTTagString(playerName)); customHead.getOrCreateChildTag("display").setString("Name",headName); return customHead; } @WARDOGSK93 - Thank you again if you're still out there!
  15. Awesome! Thanks!! Trying to find how to give it a custom name now (vs. "SoAndSo's Head").
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.