Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

After changing value in config it reloads and works fine, but sometimes it spams "List on key X is deemed to need correction. It is null, not a list, or an empty list. Modders, consider defineListAllowEmpty?" about every key and recreating config. 
Here's files: https://gist.github.com/Aaur1s/4c9fee20fff6463f68c6bff62e634050
Using defineListAllowEmpty didn't resolve the problem.
I checked with debug mode and seems like all of the keys are null. Am I doing something wrong?

Edited by aut1sto

Basically, you are adding a reload listener that can have its data repopulated using the `/reload` command. Since it looks like your data is all server related, you would need to listen to `AddReloadListenerEvent` on the Forge event bus and register a `PreparableReloadListener`. The reload listener will be responsible for reading your data into the game whenever the world is opened or the `/reload` command is called.

I would recommend using `SimpleJsonResourceReloadListener` instead of implementing your own, as then you just need to implement the storage system and relevant access points from your mod.

However, I must ask, what is the point of your configurations? Looking at it even more closely, it looks more related to feature spawn rates in biomes.

  • Author

It's config for quarry, basically list of ores/resources for biomes and height of it. Every tick quarry picks random rarity and random ore from list from config, however if resources didn't exist (for ex. ore from thermal, but no thermal mod installed) it rerolls resource. I tried to recieve random resource from chunk generator, but failed and wrote all of ores in config. Maybe you know the way of getting resource from generator?

6 hours ago, aut1sto said:

I tried to recieve random resource from chunk generator, but failed and wrote all of ores in config. Maybe you know the way of getting resource from generator?

Is the ore or resource a specific block? Additionally, when you mean chunk generator in this context, do you mean you are trying to generate a list of these ores and resources within the positions inside the chunk itself? Are you trying to grab all the ore features that are generated within a chunk?

  • Author

I need go get block that will be generated at random X, specific Y, random Z and specific biome (but not generate it in world or e.t.c.)

Edited by aut1sto

1 hour ago, aut1sto said:

I need go get block that will be generated at random X, specific Y, random Z and specific biome (but not generate it in world or e.t.c.)

So, if you wanted to do the true implementation, you would probably need to use a BiomeModifier to read the placed features for each biome, execute the PlacementModifier list for each placed feature to get the block positions the feature would spawn in, and then group it by feature. The main issue there is that you have no context what feature is which. You could attempt to use the registry key to find similar naming schemes (e.g., name contains ore or something like that). You would also need to invalidate the data every time the biome modifier is reloaded.

 

Of course, as this is highly complicated to properly implement, it's probably just better to use a config with optional entries to handle your logic.

  • Author

I looked at placed features, but couldn't properly implement it. I will try to use datapack serialization, thx for help!

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.