Jump to content

Best way to texture blocks


Faistman

Recommended Posts

So I am quite new to this but Im getting along and learning pretty well so excuse me if my wording isn't perfect.

 

I am creating a mod that uses minecraft textures to texture the blocks. 

My block state for most blocks is: 

{
    "forge_marker": 1,
    "defaults": {
        "model": "cube_all",
        "textures": {"all": "minecraft:blocks/glazed_terracotta_silver"}
    },
    "variants": {
        "normal": [{}],
        "inventory": [{}]
    }
}

 

This works great until I get to blocks like logs, leaves, granite,  etc. 

Could someone enlighten me on the best way to texture blocks with different variants and sides? I read through the forge docs and used it and vanilla code as an example. I can get the log to show the texture in the hotbar and when ]\

thrown on the ground but not when placed.

Thanks!

Edited by Faistman
Link to comment
Share on other sites

It depends on the block, i.e. what properties it has. Usually just using the vanilla block states instead of the forge block states is easier. 

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

Well even when I switched back and did it with a blockstate, a block, and a item json and use all the vanilla info I get this result. Which I BELIEVE just from my slow learning here lol, means the blockstate is off? 

BFzH3P7.png

Inventory and dropped item are textured fine. 

 

{
    "variants": {
        "axis=y":  { "model": "minecraft:blocks/acacia_log" },
        "axis=z":   { "model": "minecraft:blocks/acacia_log", "x": 90 },
        "axis=x":   { "model": "minecraft:blocks/acacia_log", "x": 90, "y": 90 },
        "axis=none": { "model": "minecraft:blocks/acacia_bark" }
    }
}

 

Link to comment
Share on other sites

28 minutes ago, Faistman said:

minecraft:blocks/acacia_log

This is what is wrong. It should just be minecraft:acacia_log

29 minutes ago, Faistman said:

Which I BELIEVE just from my slow learning here lol, means the blockstate is off? 

Correct, typically.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

10 minutes ago, Faistman said:

Exactly what I thought but that made no difference. json parses fine as well. Very odd. 

Post your log it should throw an error with information necessary to correct this.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

https://gist.github.com/Y0ungSandwich/eafc70cde0e864edb7f9ca4c2f8cce9f

 

Bunch of errors regarding other blocks but I haven't gotten to them yet. Acacia Log is the only one I have the 3 jsons in place for at the moment. 

 

Now this could be my issue but I'm not positive. If these blocks are purely for decoration will I need a BlockLog class or are they fine just using my BlockBase as is?

All blocks act like stone pretty much with no attempt at retaining any material properties. 

Link to comment
Share on other sites

Using a BlockBase class is an anti pattern (What if you want to extend another class?). Composition over inheritance is an OOP technique that you should be using. If you don’t need the functionalities of a class, don’t use it.

Thanks for using GitHub Gist! It makes it so easy to read your log and give you feedback.

However, “Suppressed additional 115 model loading errors for domain bb”, your log is swamped by errors for blockstates that you haven’t started to try and fix yet. Your mod id needs to be longer than 2 characters, what if another mod has the same mod id? You have 64 characters for your modid, use them!

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

On 10/23/2018 at 6:23 PM, Cadiboo said:

Using a BlockBase class is an anti pattern (What if you want to extend another class?). Composition over inheritance is an OOP technique that you should be using. If you don’t need the functionalities of a class, don’t use it.

Thanks for using GitHub Gist! It makes it so easy to read your log and give you feedback.

However, “Suppressed additional 115 model loading errors for domain bb”, your log is swamped by errors for blockstates that you haven’t started to try and fix yet. Your mod id needs to be longer than 2 characters, what if another mod has the same mod id? You have 64 characters for your modid, use them!

Thank you for all the good info! I did indeed figure this out by creating a GlassBlock class and extending GlassBlock from Minecraft. 

Excellent tip on the modID I'll be sure to change that before publishing the mod. 

I prefer gist and try to get all my users to report bugs with gist if possible. So much nicer than pastebin. 

I had textured all the basic blocks with one texture first but all blocks were in my ModBlocks so it was tossing a lot of errors. Slowly chipping away at it though. 

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.