Jump to content

[1.8] Auto-assigning block textures


SamTebbs33

Recommended Posts

Back in 1.7 an before, I had made a system that assigned textures to blocks with support for their names and having different textures for different sides of the block (the code would handle displaying the relevant side by using metadata based on rotation), but now that metadata has been abandoned and textures have to be designated in a .json file (WHY MOJANG!?!?!?!!?), this system is completely broken. What was great about my old system was that I only had to provide the textures in the resource path and then give each block an unlocalised name and the rest was processed by the mod. How would I achieve a similar system but using the new (annoying) .json system?

"Thinking that coding is the nerdy IT guy at work rebooting your computer is like thinking that music is what happens when the piano tuner comes round." - Ed Rex

Link to comment
Share on other sites

One of the exact reasons why I've been advocating people NOT use 'unlocalized' names for shit.

The idea in 1.8 is to move your definition of blocks into json not code. So just make your jsons as needed.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

Back in 1.7 an before, I had made a system that assigned textures to blocks with support for their names and having different textures for different sides of the block (the code would handle displaying the relevant side by using metadata based on rotation), but now that metadata has been abandoned and textures have to be designated in a .json file (WHY MOJANG!?!?!?!!?), this system is completely broken. What was great about my old system was that I only had to provide the textures in the resource path and then give each block an unlocalised name and the rest was processed by the mod. How would I achieve a similar system but using the new (annoying) .json system?

 

Personally I think the json is a much better way than before.  All that hardcoded render block switch statements, what a nightmare....  remove as much coding from block customisation as possible, put it back into the hands of folks creating the resourcepacks I reckon.  All "proper" commercial games are written that way- the coders code, the artists create content.

 

But if you really really want to do your autotexture assignment :), you can use ISmartBlockModel to do exactly the same thing as before.

 

-TGG

 

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

I think there are legitimate cases where code-based texture assignment makes more sense than JSON. With JSON you have to create properties to map all possibilities to textures, whereas like the OP said with code you could do something like having a large array of textures with file names that are algorithmically deterministic. Something that might take 10 lines of code could take hundreds, even thousands, lines of JSON.

 

The ISmartBlockModel sounds interesting, gotta have a look at that.

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

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.