Giter Site home page Giter Site logo

recipedumper's People

Contributors

vitzli avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

recipedumper's Issues

Dumper does not deal well with Pam's Harvestcraft, or other item IDs belonging to more than one oreDict list.

Hey,

Spent some time tracking down a bug where most Pam's Harvestcraft recipes are output incorrectly.

Here's the example I've been working on:

recipedumper:item!15841:0 U=item.PamHarvestCraft:zucchinibakeItem||L=Zucchini Bake
recipedumper:shapelessore!(@toolBakeware,1)(@listAllveggie,1)(@listAllveggie,1)(@foodToast,1)(@listAllveggie,1)(@foodCheese,1)->(15841:0,1)

The problem appears to be that Pam has created oredict entries for almost all of her items. This is probably to make her (many) recipes easier to deal with: she can specify e.g:

toolBakeware, cropZucchini, cropTomato, foodToast, cropCorn, foodCheese

... for this recipe instead of the item IDs directly.

The bug is in recipedumper.lib.Formatter.getItemOreDescription. Here, you've been given an ArrayList of ItemStacks, and you need to figure out which oredict name they represent. Unfortunately for you, Pam puts e.g. Zucchini in three lists:

cropZucchini, listAllgreenveggies and listAllveggies

... so your naive reverse lookup algorithm finds the item ID for Zucchini in listAllVeggie first and assumes that it must be that oredict entry.

I've been flicking through the 1.6.4 OreDictionary code (https://github.com/MinecraftForge/MinecraftForge/blob/1.6/common/net/minecraftforge/oredict/OreDictionary.java) and it certainly appears that the Forge folks didn't consider this use case either. Their implementation of getOreID(ItemStack itemStack) has the same bug.

The solution to me appears to be doing a deep comparison of the ArrayList passed to getItemOreDescription with all of the ones returned from OreDictionary.GetOres(oreName). If you're really lucky, they'll actually be the same ArrayList and you can directly compare equality.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.