Jump to content

UberWaffe

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by UberWaffe

  1. If the reflection method is the prescribed one, then cool. I'll use it. Thanks for the reply. [EDIT] Reflection working fine. Ore dictionary support tested and working. Thanks for the help. [/EDIT]
  2. I've made a fork of LepkoQQ EasyCraft mod (https://github.com/UberWaffe/EasyCrafting), and in my own capacity I've been trying to add Forge ore dictionary support into it. I looked into "ShapedOreRecipe.java", since I need to grab the list of ingredients a recipe is made up of. I need this in order to be able to do a scan of the player's inventory for the ingredients (or their equivalents). This check in turn determines what easycraft recipes are allowed (you have the stuff needed to craft them). But I've hit a bit of a wall with getting the "private Object[] input = null;" field data, because of that little hiccup in bold. It's private. Which in itself is not an issue, except there is also no function in the class to expose a copy of the data inside the "input" field. A Google search revealed that one can use reflection and other tricks to get access to a private variable, but these seem to be more on the "I'm-hacking-this-to-bits-now" approach. Is there something obvious I am missing, or is there just no allowance made for checking the ingredients for an ore dictionary recipe? I've noted functions for checking if the items in a given crafting grid are equal to the recipe, but this is not entirely what I want. There is no crafting grid... well, at least not in the easycraft mod's easycraft table. [EDIT] I've managed to do all the other coding work for supporting Object[] recipes. (New commit on Github). So I'm going ahead with creating a manual list of ore-dictionary recipes (as sucky as that is), since I do not wish to mess around with java security to get reflection to work for private variables. Still, if anyone knows of a better way, please let me know. I'd love to automatically clone and convert all ore dictionary recipes (i.e. automatic mod support of other mods). [/EDIT]
×
×
  • Create New...

Important Information

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