Jump to content

[1.12.2] Crash involving generating trees that use block varients


Dizzlepop12

Recommended Posts

I have a strange problem when creating a new world. I recently changed all my tree logs to use block variants instead of being individual blocks, and it worked out at first but now it crashes. Any ideas?

Crash: https://pastebin.com/nsXbmrNx

EnumType class: https://github.com/TheSlayerMC/Journey-1.12/blob/master/main/java/net/journey/util/enums/EnumTypeLogs.java

Tree class: https://github.com/TheSlayerMC/Journey-1.12/blob/master/main/java/net/journey/dimension/corba/gen/trees/WorldGenCorbaMediumTree.java

 

From what I can tell, it can't apply the 'corbalog' variant to the block for some reason, but it can apply 'euca' and 'sizzler'. Any ideas?

Link to comment
Share on other sites

Quote

Caused by: java.lang.IllegalArgumentException: Cannot set property PropertyEnum{name=variant, clazz=class net.journey.util.enums.EnumTypeLogs$EnumType, values=[sizzlerlog, eucalog]} to corbalog on block journey:logs, it is not an allowed value

Your blockstatecontainer only allows for 2 variants.

 

If we look at your enum class, there are 9 total variants. This can't fit in 4 bits of metadata along with 2 bits used for log axis. Which we see:

https://github.com/TheSlayerMC/Journey-1.12/blob/master/main/java/net/slayer/api/block/BlockModLog.java#L55

https://github.com/TheSlayerMC/Journey-1.12/blob/master/main/java/net/slayer/api/block/BlockModLog.java#L96

 

BTW, your API has references to your non-API. This means your API cannot be packaged separately.

https://github.com/TheSlayerMC/Journey-1.12/blob/master/main/java/net/slayer/api/block/BlockModLog.java#L7-L15

 

Also, IHasModel is stupid. All items need models and none of the information necessary to register a model is protected or private.

Edited by Draco18s

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

6 minutes ago, Draco18s said:

Your blockstatecontainer only allows for 2 variants.

 

If we look at your enum class, there are 9 total variants. This can't fit in 4 bits of metadata along with 2 bits used for log axis. Which we see:

https://github.com/TheSlayerMC/Journey-1.12/blob/master/main/java/net/slayer/api/block/BlockModLog.java#L55

https://github.com/TheSlayerMC/Journey-1.12/blob/master/main/java/net/slayer/api/block/BlockModLog.java#L96

 

Also, IHasModel is stupid. All items need models and none of the information necessary to register a model is protected or private.

Thanks so much, I don't know how I didn't realize this.

Link to comment
Share on other sites

So now it no longer crashes, but the only log variants that generate are the eucalog and sizzlerlog types. In addition to this, the trees in the Euca dimension that are supposed to use the eucalog type are generating with the sizzerlog type, like it's completely random and it's not applying the variant specified. All variants show up in the creative inventory, though.

Edited by Dizzlepop12
Link to comment
Share on other sites

Nine Log Types * 3 axis of orientation = 27 possible state variants.
Metadata is strictly limited to 16 possible state variants.

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

17 minutes ago, Dizzlepop12 said:

Oh shucks, so I can't have that many variants? 

Well you can, you can use an ExtendedState and save the log type to a TileEntity. You just can't save it in metadata.

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

7 hours ago, Animefan8888 said:

Well you can, you can use an ExtendedState and save the log type to a TileEntity. You just can't save it in metadata.

ActualState

 

In either case, I do not recommend TEs for logs. Use multiple blocks like Vanilla does.

Edited by Draco18s

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

This is a classic issue that people making logs run into. Because logs have orientation it uses up some precious bits of meta data. People often try to be clever and combine all their variants them realize you need to break them up again. That is why vanilla has 2 log blocks, 2 leaves blocks, etc.

 

Note also that 1.13.x is moving even farther away by making every variant a separate block. This is called "the flattening".

Edited by jabelar

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.