EbonJaeger / perworldinventory-kt

Multi-world inventory plugin for Spigot written in Kotlin.
MIT License
46 stars 35 forks source link

Queston: What is the correct way to only have 1 world have a seperate invenroty? #161

Open TomLewis opened 4 years ago

TomLewis commented 4 years ago

I have my 3 survival worlds that 99.9% of players play on, then I have a Jail type world we send naughty players to when they need a break. I only want to have this jail world (Called locker) be the one that has its own separate inventory. I have this working, but I noticed a bit of a performance issue, at present every single player that plays is having their Survival/Nether/End data saved into PWI, this is not required and only required for this 1 world (Locker).

How do I set up the worlds/config so that just this one world is having a separate inventory saved? (So I am not creating extra overhead for things like opening and moving items in peoples inventory in normal survival) Current configs:

Config: https://gist.github.com/FrozenBeard/c66aa9fb561cec10255ca10637865320 Worlds: https://gist.github.com/FrozenBeard/76051f6dd1f6eb57751c3ab389e69be0

I have 114944 folders in my /data folder.

EbonJaeger commented 4 years ago

It should be set up fine as-is. What do you mean that "every single player that plays is having their Survival/Nether/End data saved into PWI"?

TomLewis commented 4 years ago

Yeah, its working, that's not the issue. Have you used LuckPerms? If not, the default "group" on luckperms is given to everyone, since this is everyone there is no need to save this information into the database for all 160,000 players I have, as its the default role, everyone inherits this, its a design choice to not add all this extra data for no reason.

At present, I have this plugin to only separate inventory for 1 world, my jail world. So I have all these overhead for saving players data for no reason, I want to figure out how I can set my main 4 worlds (Including the christmas one I forgot about) as just default, without the plugin installed all worlds share the same inventory, this is how I want to set this system up so im not having to store all this extra data, not having to read/write using this plugin for inventory for all my main worlds when I just need to store a fresh inventory for 1 world that's used 0.01% of users.

EbonJaeger commented 4 years ago

Currently, PWI saves to disk in the following scenarios:

Looking at it, I don't see why we're saving data on logout to begin with, but I don't really see a way around not saving data on death (due to dupe glitches).

Your use case is a little different from most people's. :) Why exactly does the jail world need a separate inventory?

TomLewis commented 4 years ago

Gotcha.

Yeah, I only need a separate inventory for this locker world I have, so saving everything for my main survival is just a waste of resources/overhead in loading inventory's.

So my locker/jail world is a unique Idea I came up with for punishments, if you get sent to this world, its a fresh inventory, no tools, no food, no nothing, and to get out you must mine sand with your bare hands and give it to a sign to get out (multiple inventories full), you cant chat or read chat, and people can see you on the live map.

It works wonders, much better than temp mute/temp kick, as they have to earn their way out and cannot communicate.

Whats even better, is my servers Pirate themed, so its called "Davy Jones locker", which is where Jack sparrow gets stuck "in between worlds" with nothing but sand and his ship in pirates of the Caribbean, so its a pop culture reference too!

https://vignette.wikia.nocookie.net/pirates/images/f/f5/Black_Pearl_Locker_Expanse.jpg/revision/latest?cb=20100611004158

This is my locker world (Look at the hilarious messages of people who have been sent there) https://map.piratemc.com/?worldname=locker&mapname=surface&zoom=5&x=-39&y=64&z=59