trakos Posted February 1, 2014 Posted February 1, 2014 TrksRecipeDoc is a very simple, yet quite capable, "mod" that reads NEI items and recipes, and writes it to .xml file, plus it also renders all item icons and recipe handlers backgrounds. It also tries to calculate raw cost for each item. Sounds cool, right? I've written a simple php page that uses this information and presents it nicely - I put up an online example: http://tekkidoc.s4.trakos.pl/ . This one is generated for tekkit. Alternatively, it is possible to autocomplete (or autoedit further on) mediawiki - here is one I put up, it's generated for mekanism mod: http://mekawiki.s4.trakos.pl/ . Some highlights: http://tekkidoc.s4.trakos.pl/Home/item/893/2 - the price for this is too damn high! http://tekkidoc.s4.trakos.pl/Home/item/5564/3 - even the galacticraft recipes work http://mekawiki.s4.trakos.pl/index.php?title=Ultimate_Energy_Cube - that's not cheap either http://mekawiki.s4.trakos.pl/index.php?title=Enrichment_Chamber_(method) - with some tinkering it can also show stuff like crafting type pages Source code: minecraft mod that exports: https://github.com/trakos/trks-recipe-doc (there's a 1.5.2 branch; master is for 1.6.4) example C# code that I've used to import to mediawiki: https://github.com/trakos/trks-recipe-doc-wikisync (though I'm not sure if it's up to date with current xml structure) php page source: https://github.com/trakos/trks-recipe-doc-www (which uses zend and some util classes from https://github.com/trakos/trks-zend-utils ) - you only need to put generated recipes.php in data/, and upload images to public/images/ Overall, it sounds too good, right? Yeah, there's a catch. Right now to calculate raw costs and make id - damage pair unique (some mods store data in NBT tags, and item with the same id and damage can be something entirely different) I have to write a bit of mod-specific stuff. See example: https://github.com/trakos/trks-recipe-doc/blob/MC1.5.2/common/trks/recipedoc/modsupport/mods/CCTurtleSupport.java . For raw costs, too many alternative ways to craft an item will cause omitting the item cost entirely, so sometimes the mod-specific code has to disable some recipes (for instance leaving only one way to craft an ingot). Also, marking items as base has to be done in mod support (i.e. allowing to use them in raw cost). Still, it's a lot less work than doing these kind of stuff manually. The code right now is still quite messy: It's my first MC mod, so "I have no idea what I'm doing" I should rewrite raw cost calculation, to make it a bit more universal It requires NEI and Mekanism to compile (only NEI to run) - though you can easily remove Mekanism dependency by removing MekanismSupport class. There's a hardcoded output path (C:/test/) - change that if you'll use it, especially on non-windows After the game starts with the mod loaded, it will automatically load the world named TrksRecipeDoc (creating it if not exists), export everything, and then shutdown the game - it made testing easier; it's designed for single run, remove the mod to actually play the game later if you'll want to skip item rendering, you'd have to comment it out The coordinates for items on the recipe backgrounds aren't in px, you'll have to scale it properly (see, for example, recipe.phtml in php page) Scaling the images is done by trial and errors, so it may not be working flawlessly with different mc versions and stuff; I had to change a bit in 1.5.2 branch I've saw Kobata version of item rendering - he's making it properly by usage of FBO and stuff. I am using a bit simpler approach - I'm clearing the screen with bright green, rendering the icon, and then calling the MC screenshot function (which, I think, uses FBO internally). Later, I just resize it and change the bright green to transparency. As you can see, there are some quirks here and then, but hey - it's open source, so you can fix it . Hope that's useful for somebody's mod or modpack documenting! Cheers. Quote
dwwojcik Posted February 2, 2014 Posted February 2, 2014 This is really cool. Looks incredibly useful! 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.