Posted September 23, 201510 yr Hi everyone! I was wondering if there was a way in Forge to pull additional data from a JSON file on top of what Minecraft normally pulls. All of my current searches kept pulling up nada to help me here. Any help would be appreciated! Thank you!
September 23, 201510 yr Author Basically it's going to be a model JSON file for an item, but I want to add in additional data like offsets applied to the modular item it will be a part of. My current system stores this offset separately but I'd like to make it so users can make a JSON and have the internal system update from the file rather than hard-coding everything. This would also allow people to make additional models without needing to make a new mod and still be compatible with the current design.
September 23, 201510 yr Why don't you create your own .JSON file reader - search for the file the user creates with the model information, parse it to whatever you need, then apply to the item model. Really, I don't see why you would do this with this .JSON system, pretty flexible with rotations / translations / scale. Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]
September 23, 201510 yr Author Why don't you create your own .JSON file reader - search for the file the user creates with the model information, parse it to whatever you need, then apply to the item model. Really, I don't see why you would do this with this .JSON system, pretty flexible with rotations / translations / scale. Because translations and rotations won't persist with my current item. Individually it would but the design I worked on is a compilation of multiple item models, unless ISmartItemModel has some rotation voodoo I haven't found. As for a JSON file reader, I feel like an idiot now. Thank you! (Will update with results.)
September 25, 201510 yr Author I got it! It was actually surprisingly simple, if a little tedious. For those who are curious, hunt down the JsonParser class in the dev environment, and remember JsonObject, JsonElement, and JsonArray. Good luck!
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.