Jump to content

Acces the src directory from java code?


ItsAMysteriousYT

Recommended Posts

Noo, you shouldnt create a fake resourcepack! The Json library (Gson) which is implemented in mc by default and is accesible as long as you add the minecraft project to the classpath of your modproject.

 

I don't think you understood what the OP wants to do. First of all, this isn't a "fake" resource pack; it is a real resource pack that you create during initialization. He does plan to use JSON, he's not saying he wouldn't.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Im verry sorry, I indeed misunderstood something. And I think I used a wrong word.( Im not English).

 

Anyway, I still think that this way is a bit complicated since you can simlly use the resourceManager in combination with a resourceLocation to get an inputStream. No need for reflection.

 

Again Im sorry for misunderstanding

Projects:

Discontinued:

- N2ConfigAPI

- Meachanical Crafting Table

 

Latest:

- CollectionUtils

 

Coöperations:

- InGameConfigManager

Link to comment
Share on other sites

oke, I think its the best to end the discussion here Since you got an answer already. Besides I'm probably confusing others, which is not the purpose of a forum :P.

Again I'm so sorry for this, I feel bad for creating this mess!

Projects:

Discontinued:

- N2ConfigAPI

- Meachanical Crafting Table

 

Latest:

- CollectionUtils

 

Coöperations:

- InGameConfigManager

Link to comment
Share on other sites

Did you get this going? I have a few questions about how this might be implemented.

 

JSON files are loaded via the resource manager. So just register a custom resource pack (IResourcePack) and put it into Minecraft#defaultResourcePacks (you will need reflection as the field is private). Then that IResourcePack can fabricate the InputStreams for the JSON files out of "thin air". A helpful thing to do that is converting a String to an InputSteam.

 

How do you register a custom resource pack and when does it have to be done?

 

Could the pack be modified and a model changed at runtime? If so, how?

 

 

 

Link to comment
Share on other sites

Ok, I had understood the registering it and adding it to the list were two differents steps. I've got the reflection going and my resource pack is on the list.

 

I have build myself a simple tool for building item models in game. Instead of using a seperate applications like MC Model Maker, I am building the model with blocks, selecting them, and then generating a json model. So far, I have this writing to a file which I relocate when I quit the game, but, if not complicated, it would be interesting to load the model at runtime.

 

 

Link to comment
Share on other sites

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.