Jump to content

[1.14.4] Custom block has the name "Air" in-game.


Cerandior

Recommended Posts

I don't know what I am doing wrong here. The block is registered with the proper registry name. The name is provided correctly (I think) in the lang file. Don't know why it would display as "Air" too. That's oddly specific considering I have no mentions of Air anywhere.

Any help would be appreciated.

Here are the related classes/files:

Main Class: 
https://github.com/Cerandior/VanillaExtended/blob/master/src/main/java/teabx/vanillaextended/main/VanillaExtended.java

BlockList Class: 
https://github.com/Cerandior/VanillaExtended/blob/master/src/main/java/teabx/vanillaextended/blocks/BlockList.java
 

ItemList Class:
https://github.com/Cerandior/VanillaExtended/blob/master/src/main/java/teabx/vanillaextended/items/ItemList.java
 

lang File: 
https://github.com/Cerandior/VanillaExtended/blob/master/src/main/resources/assets/vanillaextended/lang/en_us.json

Edited by Cerandior
Link to comment
Share on other sites

15 minutes ago, diesieben07 said:

You never register your block.

 

Additional remarks:

  • registerDispenseBehavior must be called through DeferredWorkQueue, it is not threadsafe.
  • Same for your entity spawn registration.

Oops, sorry about that, I thought I had set-up everything at the beginning, didn't think of checking what the heck I was actually doing in the event.

Also, thank you for the additional information about the two other things, however DeferredWorkQueue is deprecated for me on forge 1.14.4-28.1.96. 

Quote

This is being deprecated in favour of a new interface on loading events, to remove confusion about how it operates. #TODO

Is there any alternative?

 

Additional Question: Do all blocks take the air registry name by default if you don't specify one?

Edited by Cerandior
Link to comment
Share on other sites

Another thing which is unrelated to this topic, however I don't want to make another post about it since it's mostly a programming-practice related question more than problems with the mod.

I have read a couple of things about static initializers, and apparently they are not good for Forge. Anyone would care to explain why? Is the correct approach to declare objects as static but initialize them inside the registry events?

I am asking because my Entities are currently being initialized inside a static block. Or perhaps to be more specific I should say that I am declaring and initializing a static object at the same time. Is this bad?

Edited by Cerandior
Link to comment
Share on other sites

  • 1 year later...
  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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