Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancement] Load NBT in the background #1

Open
JoshuaVandaele opened this issue May 9, 2021 · 4 comments
Open

[enhancement] Load NBT in the background #1

JoshuaVandaele opened this issue May 9, 2021 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers suggestion Got an idea? Give it out.

Comments

@JoshuaVandaele
Copy link

Currently, when we load a NBT file which has a lot of NBT data, the game can freeze for a few seconds.

I'm suggesting overwriting the vanilla way of loading the file for it to not freeze the whole game.
Maybe even add a little loading bar in the inventory between the text and the left arrow.

@VideoGameSmash12
Copy link
Owner

You can use the [ and ] keys to navigate through files without causing lagspikes, though opening the inventory afterwards will still cause a lagspike.

The mod tries to be as close to vanilla as possible so it modifies the existing implementation of hotbar loading to accommodate for it. I feel like overriding it would break other mods that might use the hotbar system.

@JoshuaVandaele
Copy link
Author

"I feel like overriding it would break other mods that might use the hotbar system."
This is a valid concern, however, I've rarely seen mods mess with the hotbar system. This is your call, as I imagine it could require quite a bit of work

@VideoGameSmash12
Copy link
Owner

This is a valid concern, however, I've rarely seen mods mess with the hotbar system. This is your call, as I imagine it could require quite a bit of work

You would be correct - To me it's not worth the effort and could cause problems even beyond what I've already mentioned. However, your suggestion would be a good idea. However this most likely affects vanilla Minecraft too, so it might actually be worth taking it up to Mojang themselves to do this kind of thing.

@VideoGameSmash12 VideoGameSmash12 added enhancement New feature or request good first issue Good for newcomers suggestion Got an idea? Give it out. labels May 10, 2021
@VideoGameSmash12
Copy link
Owner

I have decided to take a look at this again as a priority. To help speed things up a bit, in v2 the mod automatically caches saved hotbars into memory for faster hot-swapping, but in addition I plan to do something like this where it loads the hotbar NBT files in the background on another thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers suggestion Got an idea? Give it out.
Projects
None yet
Development

No branches or pull requests

2 participants