Jump to content

Recommended Posts

Posted

Dear all

 

I recently started to update from 1.7.10 to 1.9 (Forge: 12.16.1.1887) and I am experiencing a really hard time with my old setup of a meta data based block. The setup was really simple: Having a general colored Block (meta data based) class, an enum for the minecraft colors and its ItemBlock so that I only had to specify its name and general block properties (hardness etc) for further colored blocks.

 

Following vanilla minecraft code, MinecraftByExample and the Forge BlockState documentation I've created the following block class (which contains the enum):

 

 

  Reveal hidden contents

 

 

And the corresponding ItemBlockMetaData class:

 

  Reveal hidden contents

 

 

And this blockstates json

  Reveal hidden contents

 

 

The issue that occurrs is, the block's texture (in world and as itemblocks) are not rendered, resulting in the beloved missingtexture texture. Additional confusion is created by the fact, that absolutely no exceptions are thrown, nor any form of warning. This is confirmed as far that if I would remove one of the mentioned textures, I receive the error, that said texture is not there.

 

Furthermore, via F3-debug I can confirm that the correct block was placed (having an orange one, results in an orange one). Listing them all in the creative tab works fine as well.

 

I guess that I've somehow missed a point in the forge block state json, which would be obvious for an experienced forge coder.

 

Thank you in advance for replying!

 

Sincerely -pick

Since English is not my mother tongue, my sentences may are confusing.

 

I'm coding java for a long time now - just MC and forge stop me sometimes.

Posted

Dear all

 

I recently started to update from 1.7.10 to 1.9 (Forge: 12.16.1.1887) and I am experiencing a really hard time with my old setup of a meta data based block. The setup was really simple: Having a general colored Block (meta data based) class, an enum for the minecraft colors and its ItemBlock so that I only had to specify its name and general block properties (hardness etc) for further colored blocks.

 

Following vanilla minecraft code, MinecraftByExample and the Forge BlockState documentation I've created the following block class (which contains the enum):

 

 

  Reveal hidden contents

 

 

And the corresponding ItemBlockMetaData class:

 

  Reveal hidden contents

 

 

And this blockstates json

  Reveal hidden contents

 

 

The issue that occurrs is, the block's texture (in world and as itemblocks) are not rendered, resulting in the beloved missingtexture texture. Additional confusion is created by the fact, that absolutely no exceptions are thrown, nor any form of warning. This is confirmed as far that if I would remove one of the mentioned textures, I receive the error, that said texture is not there.

 

Furthermore, via F3-debug I can confirm that the correct block was placed (having an orange one, results in an orange one). Listing them all in the creative tab works fine as well.

 

I guess that I've somehow missed a point in the forge block state json, which would be obvious for an experienced forge coder.

 

Thank you in advance for replying!

 

Sincerely -pick

Since English is not my mother tongue, my sentences may are confusing.

 

I'm coding java for a long time now - just MC and forge stop me sometimes.

Posted

You're using the wrong model.

minecraft:cube

is a cube with a separate texture on each side,

minecraft:cube_all

is a cube with a single texture on all sides.

 

When registering models for the item form, you should use the colour name as the variant of the

ModelResourceLocation

instead of

"inventory"

. This will allow each metadata value of the item to use the corresponding block model.

 

I suggest using the existing

EnumDyeColor

and extending

BlockColored

.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

You're using the wrong model.

minecraft:cube

is a cube with a separate texture on each side,

minecraft:cube_all

is a cube with a single texture on all sides.

 

When registering models for the item form, you should use the colour name as the variant of the

ModelResourceLocation

instead of

"inventory"

. This will allow each metadata value of the item to use the corresponding block model.

 

I suggest using the existing

EnumDyeColor

and extending

BlockColored

.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

Thank you for this informative reply. It was really due to the wrong model.

 

Further I really appreciate your git repo, I personally learn the forge / mc mechaniques best by reading code, so thumbs up for your work there.

 

Sincerely -pick

Since English is not my mother tongue, my sentences may are confusing.

 

I'm coding java for a long time now - just MC and forge stop me sometimes.

Posted

Thank you for this informative reply. It was really due to the wrong model.

 

Further I really appreciate your git repo, I personally learn the forge / mc mechaniques best by reading code, so thumbs up for your work there.

 

Sincerely -pick

Since English is not my mother tongue, my sentences may are confusing.

 

I'm coding java for a long time now - just MC and forge stop me sometimes.

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.