Best way to store many ItemStacks

Discussion in 'Plugin Development' started by Lordloss, Feb 18, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    Lordloss

    Hello there,

    for my auction house plugin where every user can offer items to sell i need to store many (probably hundrets) of ItemStacks.

    Currently on server startup they get loaded from a config file and put into a List, at shutdown back into the config.

    Is this the best way of doing that?
    Thx for your suggestions
     
  2. Offline

    Zombie_Striker

    @Lordloss
    What is wrong with the way you currently have it? Could you explain what you think your way is "lacking"?
     
  3. Offline

    Gerov

    @Lordloss I think your current way is just fine, putting them into a HashMap with a unique ID for each of them would stop the chance of trying to put an exact copy of an item into the List.
     
  4. Offline

    elian1203

  5. Offline

    Lordloss

    @Zombie_Striker I was just not sure if this is the best way of doing it considering the performance.

    @Gerov Exact copys are ok because its an shop menu and people are allowed to sell the same kind of stack two times ;)

    @elian1203 thanks for this but the config API is doing this perfectly. Especially because i need to save 3 lines of lore too.

    thank you for your answers.
     
Thread Status:
Not open for further replies.

Share This Page