Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[Solved] [1.15.2] Config-defined blocks


DoubleNegation
 Share

Recommended Posts

I'm currently looking into updating my mod from 1.14 to 1.15. When I created it for 1.14 I just wanted the mod to be as simple as possible to get it to work at all. Now that I'm updating to 1.15 I'm reconsidering some of the decisions I made in the 1.14 version.

I'm mainly very unsure about the proper way to implement the blocks which can be defined by the user in a configuration file. This ability to define new blocks via configuration is essential to the concept of the mod and can not be avoided. There is no good way for me to register all possible blocks because a new block can be defined for every other block that exists, which means that this would double the size of the block registry for only a handful of new blocks. (Also I'd need to know which blocks are going to be registered before the registry event is fired)

As far as I can tell, there are two different approaches on how this could be done:

Approach 1: Register each block that is defined in the configuration as its own block. This is what I did in the 1.14 version, and it works just fine. However, I have read that registering things based on a configuration file is not recommended and that all things should be registered, and then disabled based on the configuration file (which isn't possible in my case).

Approach 2: Register a single TileEntity that stores information about which block it's supposed to be in its NBT data. I haven't tried to implement this option yet, but it seems like it would be possible. However, I'm worried that this method would not only make the mod more complex and incompatible with other mods than it needs to be, but I also don't know whether there would be a negative performance impact from having these TileEntities generated all around the world (possibly dozens per chunk).

Which of these approaches should I use? Or is there an entirely different way to do this?

Btw the mod is https://www.curseforge.com/minecraft/mc-mods/compact-ores

Edited by DoubleNegation
Link to comment
Share on other sites

I'm sorry, I will :(

I just wanted the first release of my mod to be as simple as possible, so I don't abandon it half-way through like everything else I make....

I promise I will do stuff properly now. Now that the mod publicly exists, there's a reason for me to not just stop developing it, so I can afford to follow the rules now.

I know that that's not a good strategy to go through life by, but I've had way too many abandoned projects over the years and I wanted to have at least something for once. Please excuse my improper behavior.

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
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.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.