Jump to content

[1.10.2] [SOLVED] Block missing texture in inventory


Recommended Posts

Posted

Hi,

 

I'm having a huge problem with my block: It renders perfectly fine in the world, but it does not render in inventory. It just shows a 2D plane with the missing texture texture and when holding in hand it is a cube with missing texture.

 

My block extends the BlockTorch and just adds some custom stuff to it.

Then  I have this code:

 

BlockList.torchOn = new BlockTorch();
BlockList.torchOn.setUnlocalizedName(Constants.MOD_ID.toLowerCase() + "." + "torch_on");
BlockList.torchOn.setRegistryName("torch_on");
GameRegistry.register("torch_on");
ItemBlock itemBlock = new ItemBlock(BlockList.torchOn);
GameRegistry.register(itemBlock.setRegistryName(BlockList.torchOn.getRegistryName()));

 

On the client this will also be called:

/** block */
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockList.torchOn), 0, new ModelResourceLocation(BlockList.torchOn.getRegistryName(), "inventory"));

/** item block*/
ModelLoader.setCustomModelResourceLocation(itemBlock, 0, new ModelResourceLocation(itemBlock.getRegistryName(), "inventory"));

 

I hope I posted above everything correct, cause I simplified the code, so no one has to worry about the automatic system which does exactly that from above in the background. (quite a lot of code in the background for achieving this, because I wanted it to work fine with all my blocks and subfolder stuff for the stone blocks)

 

Here are the json files now:

assets.primevalforest.blockstates.torch_on.json

 

  Reveal hidden contents

 

 

assets.primevalforest.models.block.normal_torch.json

 

  Reveal hidden contents

 

 

assets.primevalforest.models.block.normal_torch_wall.json

 

  Reveal hidden contents

 

 

assets.primevalforest.models.block.torch_on.json

 

  Reveal hidden contents

 

 

assets.primevalforest.models.item.torch_on.json

 

  Reveal hidden contents

 

 

There are NO errors in the fml-client-log... the torch_on name isn't even mentioned (checked multiply times, even with the search function of notepad++). Also checked multiply times the console... no errors.

 

So, what am I doing wrong here?

 

Thx in advance.

Bektor

Developer of Primeval Forest.

Posted

I had this weird issue where when I fixed the

Item

model for a

Block

, the

Item

ALREADY in my inventory stayed the black-purple box, but the SAME

Item

had a model in the creative tab. Maybe this is happening to you too.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted
  On 10/3/2016 at 1:14 PM, larsgerrits said:

I had this weird issue where when I fixed the

Item

model for a

Block

, the

Item

ALREADY in my inventory stayed the black-purple box, but the SAME

Item

had a model in the creative tab. Maybe this is happening to you too.

Nope, seems not to be.

Developer of Primeval Forest.

Posted

If you are specifying a variant default as inventory, you have to define it in the blockstates json file otherwise it has no model definition to reference and therefore will not render in slot as it's missing that variant.

 

Check your console log for the MissingModelVariantException that shows up.

 

The fix is simpler still:

{
     "forge_marker": 1,
     "defaults": {
          "textures": {
               "all" "primevalforest:blocks/torch_on"
    	},
    	"model": "cube_all"
    },
    "variants": {
    	"facing": {
		"up": { "model": "primevalforest:normal_torch" },
        	"east": { "model": "primevalforest:normal_torch_wall" },
        	"south": { "model": "primevalforest:normal_torch_wall", "y": 90 },
        	"west": { "model": "primevalforest:normal_torch_wall", "y": 180 },
        	"north": { "model": "primevalforest:normal_torch_wall", "y": 270 }
    	},
        "inventory": { "model": "priemevalforest:normal_torch" }
    }
}

Posted
  On 10/3/2016 at 4:18 PM, swordkorn said:

If you are specifying a variant default as inventory, you have to define it in the blockstates json file otherwise it has no model definition to reference and therefore will not render in slot as it's missing that variant.

 

Check your console log for the MissingModelVariantException that shows up.

 

The fix is simpler still:

{
     "forge_marker": 1,
     "defaults": {
          "textures": {
               "all" "primevalforest:blocks/torch_on"
    	},
    	"model": "cube_all"
    },
    "variants": {
    	"facing": {
		"up": { "model": "primevalforest:normal_torch" },
        	"east": { "model": "primevalforest:normal_torch_wall" },
        	"south": { "model": "primevalforest:normal_torch_wall", "y": 90 },
        	"west": { "model": "primevalforest:normal_torch_wall", "y": 180 },
        	"north": { "model": "primevalforest:normal_torch_wall", "y": 270 }
    	},
        "inventory": { "model": "priemevalforest:normal_torch" }
    }
}

This does not work. :(

 

And to this

MissingModelVariantException

: Read the last 4 sentences of my problem. ;)

 

EDIT: Your edit does also not work.

Developer of Primeval Forest.

Posted

If you specify in your modelLoader to look for a variant of name "inventory" it REQUIRES that variant to render in the inventory.

 

You miss it out and it's not our problem when it fails to render.

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • There is an issue with Modular Force Field System (mffs) Remove it or try other builds
    • I never imagined I would be writing this kind of testimony, but I feel it’s important to share my experience with Malice Cyber Recovery and how they helped me recover $230,000 I lost to crypto scammers. A few months ago, I got involved in a crypto investment opportunity that seemed legitimate at first. The scammers were incredibly convincing. They showed me impressive returns, sent regular updates, and even gave me access to what looked like a real trading platform. I was initially cautious, but after seeing the returns, I began to invest more, ultimately transferring over $230,000. Unfortunately, after a few weeks, when I tried to withdraw my funds, I found that the platform had disappeared, and I could no longer contact anyone involved. It was clear I had been scammed, and I felt completely helpless. For weeks, I tried everything to get my money back—contacting the authorities, reaching out to the platform’s so-called support team (who of course were unreachable), and trying to trace the transactions myself. But everything led to dead ends. The more I researched, the more I realized just how hard it was to recover stolen crypto. I began to lose hope. That’s when I came across Malice Cyber Recovery. At first, I was skeptical. Could they really help me recover my funds after everything I had been through? I decided to reach out anyway, just to see if they could offer any guidance. From the very first conversation, their team was not only professional but also deeply empathetic. They understood exactly how I was feeling and immediately made it clear that they were dedicated to helping me recover my lost funds. Malice Cyber Recovery’s team got to work quickly. They walked me through every step of the process, explaining the methods they would use to track down my stolen crypto. Their knowledge of blockchain technology and how to trace crypto transactions was incredibly impressive. They didn’t just give me vague promises they showed me the action they were taking and the progress they were making, which gave me hope that my money wasn’t gone forever. One of the most reassuring aspects of working with Malice Cyber Recovery was their transparency. They kept me updated regularly, letting me know what they were doing, what obstacles they encountered, and how they were overcoming them. It wasn’t an easy process; tracing funds through blockchain and dealing with scammers who hide behind fake identities and complex networks is incredibly difficult. But Malice Cyber Recovery’s team was relentless. They used advanced tools and techniques to trace the flow of my funds, and within just a few weeks, they managed to locate a significant portion of my lost funds. I couldn’t believe it when they informed me that they had successfully recovered a large chunk of my money. I never thought I’d see that $230,000 again. The recovery process wasn’t instantaneous it  took time, patience, and persistence but Malice Cyber Recovery delivered on their promise.  
    • Almost, just the java -server -Xmx4G -Xms4G -Dlog4j.configurationFile=log4jformattingfix.xml -jar forge-1.12.2-14.23.5.2860.jar nogui and if that doesn't work, try java --version
    • What so just copy and paste " java -server -Xmx4G -Xms4G -Dlog4j.configurationFile=log4jformattingfix.xml -jar forge-1.12.2-14.23.5.2860.jar nogui Pause >nul " into a cmd terminal? If that's what you mean, nothing happens
    • The networking has been far simplified in 1.20.5+ The docs could be old, as Ash has said feel free to submit a PR updating the community docs. However the only real up-to-date reference would be the code itself. So your best bet is to just read the code and give it want it wants.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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