Spigot Custom EnderChest 1.13.1

[1.7.10 - 1.16.3] Similar to popular EnderChest++ but with more features and up to date.

  1. brunyman submitted a new resource:

    Custom EnderChest - [1.7.10 - 1.8.7] Similar to popular EnderChest++ but with more features and up to date.

    Read more about this resource...
  2. thanks, enjoy:p
  3. No, this was coded from 0, I never even downloaded that plugin.
    Here is my github: HERE
  4. Well, I don't mean you stole code, I'm suggesting the absolute concept and use has already existed months in advance, this doesn't bring anything exceptionally new to the table
  5. I know that, I coded it because I used the old popular plugin CustomEnderChestPlus and needed it updated for uuid support and some more customizations. I use this on my servers, and just decided to share it.
  6. Hey there,
    you said:
    "Hi, when upgrading the enderchest items already stored will not get lost. When downgrading on mysql only items stored on slots that will be lost will also get lost, on flat file no items will be lost but you will only be able to get the items in slots lost if you upgrade the enderchest back, for more post on Discution forum. Thx"

    Is there a chance, that you can make this configurable for both storagesystems?
    (I would need the storage on mysql and that the items don't get lost, for timed permission groups, for example VIP's )

    Hope that was clear, not my native language...
  7. Hi, have you tested the storage? Like downgrading the size?

    On MySQL if you downgrade only the items that are on sloths that will get lost downgrading the size of the enderchest will get lost,, so you won't get lost the entire inventory, just the items on slots that will get lost when the enderchest will get smaller. It's the same on flat file, but with 1 small change. if you upgrade the enderchest back the items that were on slots that were lost will appear back into the enderchest.

    This is different on MySQL because we encode the inventory into Base64 strings, so this way it's easy to pack and unpack the inventory when saving it to mysql. While on flat file we only update the slots that are changed and not the entire inventory content to save resources. But anyway the loss affects only items that are on slots lost when downgrading the enderchest.
  8. Yeah, I understood that, but i would like it, that i can configure that.
    So that when for example a VIP on my server expires, his items aren't lost, but available after he purchased the upgrade to VIP again.

    But I understand that it must be a big change to normalize your database and possibly break existing data (and of course code) with it.
  9. Right now it's not possible, because on mysql i take the entire picture of the enderchest and code it into a string, and that overwrites any items left behind, this was the best way to store it over mysql, if i'l find another way i'l change it.

    You could use flat file saving for now if you don't share enderchests over more servers using mysql
  10. Another way to do this would be to make an extra table with the slotid of the enderchest as an additional key. This way you could store the itemstack for each slot individually. (If you like, even Base64 encoded^^ )
  11. but how for each player?
  12. Well as said you should normalize your Database!
    Thats one of the very basics.
    Don't save everything in one table, but in more tables.
    Then you can select your data based on a query with inner joins.

    What you have:
    id int(10) AUTO_INCREMENT, player_uuid varchar(50) NOT NULL UNIQUE, player_name varchar(50) NOT NULL, enderchest varchar(10000) NOT NULL, size int(3) NOT NULL, last_seen varchar(30) NOT NULL, PRIMARY KEY(id)

    everthing in one table.... what you should have:

    id int(10) AUTO_INCREMENT, player_uuid varchar(50) NOT NULL UNIQUE, player_name varchar(50) NOT NULL,size int(3) NOT NULL, last_seen varchar(30) NOT NULL, PRIMARY KEY(id)

    id int(10), slotid int(10), enderchest varchar(10000) NOT NULL, PRIMARY KEY(id, slotid)

    Hope that makes it somewhat clear. If not you should really consider to take a good book about databases and read it ;)
  13. Yes, i'm not that experienced yet, problem is I tried to make i as light as possible, and saving data for each player for each slot will get the databa se very large and when you will have a large amount of players and also more server resources used to save all the data, right?
  14. The overhead for the additional table is negligible.

    And the only information you didn't have before is the slotid, this can even be just a byte, so thousand Players => 1KB more on your filesystem.
    Plus overhead and everything else maybe 20KB max for all scenarios... Nothing, that should matter nowadays ;)

    Disclaimer: This Information is not proved in any way and can vary extremely, blablabla. But it should be negligible in every situation you can encounter ;)
  15. i mean, you have to scan the inventory content and save each item, instead of packing the hole inventory
  16. yeah, but this should already be outsourced to an async task, so that it doesn't lag the server...
  17. Hi

    There is a blocking issue when there are no player on the server for some hours.
    The mysql socket is closed and then it fails to load the data.

    Error log

    You should always check if the mysql socket is open before accessing the database and if not, open it again.