Jump to content

Recommended Posts

Posted

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!

Posted

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.

Posted

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]

Posted

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.)

Posted

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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