vitzli / recipedumper Goto Github PK
View Code? Open in Web Editor NEWMinecraft recipe dumper
License: GNU General Public License v3.0
Minecraft recipe dumper
License: GNU General Public License v3.0
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.