Jump to content

[1.12.2] Can't Get Dropped Block Texture to Show - From A Variant Block [SOLVED]


HalestormXV

Recommended Posts

So I have some Variant blocks. And they are great, and work fine. They replicate Smoothstone and when you break them you get the Cobblestone Counterpart. I took the Vanilla function basically right out of the BlockStone class and it works fine, but only with one of the Variant Blocks. Here is what happens:

https://www.dropbox.com/s/bweu8qclnzjn1m4/ErrorHelp.mp4?dl=0

 

As you can see, the Blue Block (Default State) breaks just fine and drops the Cobblestone Counterpart (which is a separate block entirely). The Pink Block, which is a Variant with a meta data value of 4, drops the correct block, the Pink Cobble Counterpart and when you pick it up or place it, it renders fine, but when it is "dropped" by the Pink Stone it isn't rendering. I can throw the pink cobble on the floor and it renders, I can break the pink cobble and it renders just fine. There are no rendering errors on startup, or registry errors. And like I said, if I place the Pink Cobblestone standalone and break it it drops itself and has no issue rendering the texture. It is only when I break the Pink Smoothstone. So maybe I overlooked something, but the drop code is basically straight out of the vanilla code. 

 

https://pastebin.com/wXs9qTaZ (Drop code is on line 119)

https://pastebin.com/wtPK4aye (EnumHandler)

 

I don't think it is a JSON issue since nothing spits out on startup and the block renders just fine when I break it on its own, but if you still need them just let me know and I will post them.

Edited by HalestormXV
Link to comment
Share on other sites

You need to register the item model for all of your block variants.

 

I do it like this:

https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/hardlib/client/ClientEasyRegistry.java#L45-L54

  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

15 hours ago, Draco18s said:

You need to register the item model for all of your block variants.

 

I do it like this:

https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/hardlib/client/ClientEasyRegistry.java#L45-L54

Okay and thanks for the example and explanation. I appreciate it. Question though that I have is, this holds true even though the block that is supposed to “Drop” isn’t a Variant block? I guess I’m just trying to understand how it works. All the Variant blocks drop themselves as items just fine when you break them. The only two blocks that aren’t supposed to drop themselves are the smoothstone ones. Meta data 0 and Meta data 4. They are supposed to drop an entirely separate block (kinda like glow stone and dust) The meta 0 drops the counterpart but the Meta 4 drops the checkered box. Once again both the blocks that Meta 0 and Meta 4 are supposed to drop are entirely separate blocks. So you still need to register separate models for each?

Link to comment
Share on other sites

As far as I am concerned, any block variant that might exist gets an item, for the purposes of creative inventories and silk touch.

The standard drop might be different and that's fine, but the variant should probably still have an Item version of itself.

 

15 minutes ago, HalestormXV said:

They are supposed to drop an entirely separate block (kinda like glow stone and dust) The meta 0 drops the counterpart but the Meta 4 drops the checkered box. Once again both the blocks that Meta 0 and Meta 4 are supposed to drop are entirely separate blocks. So you still need to register separate models for each?

Again, whatever item that is supposed to be, you need to register a model for it.

 

I can't tell you much more because your post is confusing as all get out.

15 minutes ago, HalestormXV said:

All the Variant blocks drop themselves as items just fine when you break them.
[...]

The only two blocks that aren’t supposed to drop themselves are the smoothstone ones, which are not working.

 

  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

On 2/4/2018 at 8:55 PM, Draco18s said:

You need to register the item model for all of your block variants.

 

I do it like this:

https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/hardlib/client/ClientEasyRegistry.java#L45-L54

Thank you for the help and the example code. I apprecaite it. Okay, I know it is terribly confusing. Unfortunatly trying to communicate this particular issue is difficult. Here is a video with explanation to clear it up.

 

https://www.dropbox.com/s/pz5brwov61md321/ErrorRender.mp4?dl=0

 

As you can see the hotbar has the Variant Blocks. The block with Meta 0 (the intital block) is the one that I have 59 of in the inventory. 

Every block in the hotbar is a variant block (meta block, subtype, etc. whatever it is correctly called now), that all have models registered for both items and blocks (and they have an item model registered as well as you can see by me placing them and breaking them later in the video)

And when I break them (the light blue ones), they drop themselves with the correct model. They drop the correct block of themself and correclty render the item as it is on the ground.

Once I break the Light Blue Smoothstone, you can see it drops the Light Blue Cobblestone as it should (which is a unique block unto itself).

As you can see I then place both the Light Blue Cobblestone and the Pink Cobblestone. (Both are entirely separate blocks, not variant blocks, nothing. Just separate blocks with different IDs.)

Once I break them as you can see in the video they drop themselves correctly just like in Minecraft. The model is rendered, the items is fine, and it has its own item model, everything is good.

 

I then go to break the pink blocks and as you can see in the video they all drop themselves and have a model registered to each along with their item model and drop it accordingly.

I then go to break the Pink Smoothstone and as you can see the checkered box shows up. However, it is still the correct block (Pink Cobblestone, as you can see when it goes into my inventory).

So I just am failing to see why it does this and why it specifically is this one block when all of the others do exactly what they should.

Link to comment
Share on other sites

BUMP - I'm at a loss here. I can't figure this out for the life of me. It should literally be so simple. I break a block, I get a different block. Why it works with one and not the other is beyond me. Hopefully somone can shed some light on this. I mean it is probably so stupid and I am so frustrated that I just can't see it. Here is the code, it is easier to just post my GitHub link instead of pastebin everything.

 

CODE:

https://github.com/HalestormXV/Runic-Sorcery/blob/master/src/main/java/halestormxv/init/BlockInit.java

https://github.com/HalestormXV/Runic-Sorcery/blob/master/src/main/java/halestormxv/utils/handlers/EnumHandlerStone.java

https://github.com/HalestormXV/Runic-Sorcery/blob/master/src/main/java/halestormxv/objects/blocks/BlockStones.java

 

JSONS

https://github.com/HalestormXV/Runic-Sorcery/blob/master/src/main/resources/assets/hsrs/blockstates/block_mystic_cobblestone.json

https://github.com/HalestormXV/Runic-Sorcery/blob/master/src/main/resources/assets/hsrs/blockstates/stone.json

https://github.com/HalestormXV/Runic-Sorcery/blob/master/src/main/resources/assets/hsrs/models/block/block_mystic_cobblestone.json

 

And yes @Draco18s I did read what you said and I understood what you meant. As a matter of fact I used it to render my furnace block which has multiple variants. But the issue here is that the block that should drop is literally just a basic block. No variants, nothing. The block that should drop it is the one that is a Variant, but even as you may see in the code, I beleive I accounted for that.

Link to comment
Share on other sites

This line:

https://github.com/HalestormXV/Runic-Sorcery/blob/master/src/main/java/halestormxv/objects/blocks/BlockStones.java#L130

Says to drop the item "Mystic Cobble"

While this line:

https://github.com/HalestormXV/Runic-Sorcery/blob/master/src/main/java/halestormxv/objects/blocks/BlockStones.java#L123

Says to drop the item "Lupresium Cobble"

combine that with this line:

https://github.com/HalestormXV/Runic-Sorcery/blob/master/src/main/java/halestormxv/objects/blocks/BlockStones.java#L58

Which sets the item stack of the above item (mystic or lupresium cobble) to have a metadata value. For mystic cobble, this value is 4.

 

You never register a model for Mystic Cobble with metadata 4.

Edited by Draco18s
  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

 

Ahhh, I understand, I think. So even though Mystic Cobble is a totally separate block, it is technically dropping Mystic Cobble (Meta/Damage 4) and Minecraft is kinda like Wtf? There is no Mystic Cobble with Meta 4. Throw him checkered box. 

 

So does that mean I'd have to strip meta 4 from the https://github.com/HalestormXV/Runic-Sorcery/blob/master/src/main/java/halestormxv/objects/blocks/BlockStones.java#L130  before returning the item? Or is there an alternative way? Set the dropped item to have "no damage." I am hoping that I am not going to need the dreaded bitWise operators again. They always screw me up.

 

EDIT: Never Mind, Im an idiot....

 

if (state.getValue(VARIANT) == EnumHandlerStone.EnumTypeStone.MYSTIC_SMOOTHSTONE)
{
    return 0;
}

 

in my damageDropped fixed it because I only care about the MysticSmoothStone when it drops. It just needs to make sure to not damage that. Everything else's defaults are fine. There shouldn\t be anything wrong with doing it that way right?

Edited by HalestormXV
Link to comment
Share on other sites

Bingo

  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.



×
×
  • Create New...

Important Information

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