Posted May 1, 20187 yr Hopefully you get the just of it in the title, but I'd like for a mod that displays all the blocks currently in the loaded chunks. Like 5000 dirt, 25000 stone... etc etc I don't know if there is anything like that already created, or if writing one would be rather simple... Not much experience modding, but maybe a little guidance would help get me started if anything <3
May 1, 20187 yr 5 hours ago, CSKLego said: Hopefully you get the just of it in the title, but I'd like for a mod that displays all the blocks currently in the loaded chunks. Like 5000 dirt, 25000 stone... etc etc I don't know if there is anything like that already created, or if writing one would be rather simple... Not much experience modding, but maybe a little guidance would help get me started if anything <3 create a gui and go through the clients world's loaded chunks array then for each type of block increment one and then display then as icons in a scroll bar gui. Make sure it's not an air block It's up to you if you want live updates or do you have to reopen the gui/refresh button since live every tick is laggy Edited May 1, 20187 yr by jredfox
May 1, 20187 yr The problem is that performance is going to be an issue. A single chunk has 65k positions you need to check, so 20 chunks has over a million positions! Functions that need to consider lots of blocks like rendering the world have very sophisticated ways -- like caching, culling and frustum checking -- to keep the processing work manageable. I think your best hope is to scan chunks as they are loaded and remember it. Even that will give a bit of a performance hit but at least it will be spread out and will only have to be done once. After the initial block counting, you'll also have to handle events for blocks breaking and blocks being placed/changed to keep your counts up to date. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
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.