Inactive [ADMN] ChestRestock v2.0 - A simple way to restock chests and a unique way to give items [1.2.4-R1]

Discussion in 'Inactive/Unsupported Plugins' started by dumptruckman, Jul 4, 2011.

  1. Offline


    ChestRestock - A lightweight and easy way for server ops to make automatically restocking chests

    Version: 2.0

    ChestRestock 2.0 is ONLY avaiable at

    This plugin will allow server ops to set up chests that automatically restock based on configurable parameters. This will allow you to create special chests for a variety of situations. You could create a chest for people new to your server containing a set of starter gear that they can only loot once. Or make reward chests in dungeons where you don't have to worry about them being empty. All kinds of things are possible!

    IMPORTANT!: In version 1.1 I had to update how the chest data was stored to make this plugin more multi-world compliant. As such, your current chests will no longer be configured. However, if you know how to work yaml files, you can edit your config.yml file and update it pretty easily. You just need to create another sub-category under "chests:" which will be "worldname:" to indicate which world the chests reside in. (Just make sure to put the name of your world instead of worldname)

    • Automatically-restocking chests
    • Chests can either add to or replace their current stock
    • Configurable restock period
    • Can either be set to start timing based on the time a player last opened the chest or at specific intervals
    • Can be set to preserve the position of the items in the chest
    • *new* Configured chests will be indestructible by default with an option to disable said behavior
    • *new* Chests can be configured to limit the number of times it will restock for each player
    • *new* Restock chest by command
    • *new* Full multi-world support
    • *new* Chest naming
    Download ChestRestock
    Source Code

    There is lots of help available in game! Type "/chestrestock" to see a list of sub commands and "/chestrestock help" to learn more about the plugin.

    • Place ChestRestock.jar in your plugins folder.
    • Start or reload your server.
    • Type /chestrestock while in game
    • Or target a chest and type /chestrestock set
      • This will set up the chest with default settings (adjustable in config.yml) and will restock with the items currently in the chest.
    Version 1.1
    • Added option to make chest indestructible to anyone but ops. This will also cause explosions that hit them to be cancelled completely.
    • Added option to make chests lootable only X amount of times by each player.
    • Added a reload sub-command to reload the config file.
    • Added a restock sub-command to immediately restock a chest.
    • Added better multi-world support. Unfortunately this WILL break existing configurations.
    • Added ability to give chests a name. This should make it a little easier to find them in the config file.
    • Fixed bug that caused chests in replace mode to add items instead.
    Version 1.0-Beta
    • Initial Release!
    • Permissions support
    • Redstone restocking
    • Pretty up the in game text
    Ushlak, buckZor and scrub88 like this.
  2. Offline


    Ok thats awesome, thanks for the quick response!
  3. Offline


    Did you have an approximation? I'm waiting for your plugin before updating to 1.2.3 xD
    But I can wait heh?
    Just to have an idea of the time ;)
  4. Offline


    Well gosh, when you put it that way I feel bad. I got sidetracked with various other projects after getting that new library done. I juts attempted to update the old code enough for it to work and things were going well until i really looked closer and saw just how bad that old code is and how annoying it will be to fix. I will resume working on the rewrite asap. :)
  5. Offline


    thank you for working! I'll be waiting for you!
  6. Offline


    Waiting also for the updated version
  7. Offline


    That's not what I want, sorry xD

    Take your time, I'll wait ^^
  8. Offline


    Warak spunkiie Goombi
    Okay, so I have this beta version of 2.0...
    It may still contain some bugs but hopefully I got rid of big ones.
    Unfortunately you'll have to start with a fresh config so you could delete the old ChestRestock folder and it will regen a new one.
    Let me know what you think if you're willing to try it out :)

    edit: Btw, the new command for creating chests is "/cr create" instead of "/cr set" which is now used to set chest properties.
    Warak likes this.
  9. Offline


    Thank you for the time you spend for us \o/
    1.2 In comming =)

    Again, thaks for updating =D
  10. Offline


    I've been looking forward to ChestRestock 2.0 too and I will test it! Thanks for the update! I'll let you know if theres any major bugs :]
  11. Offline


    I seem to have gotten some bugs when trying to create a restocking single chest or a restocking double chest. I'm not sure what any of it means, whether its the plugin or some conflict with another plugin or if its incompatible with bukkit 1.2.4 R1.0​
    Hmm, not sure how to post this, but this is what popped up in the console when I tried creating the chests:​

  12. Offline


    Excellent, I'll get this fixed asap! Thanks for including the debug output :)

    Okay, that should be fixed in this version:

    Unfortunately, I didn't think through the file naming scheme well enough and as such, this new version uses a different scheme, which means it WILL NOT be compatible with the previous 2.0 files.
    It IS possible to update the files manually: Move them into a respective world folder, change the dashes (-) to underscores (except dashes indicating negative coordinates) and put the world name at the end so for example:

    C:\Users\Justin\Desktop\Arcticraft Server 03-28-12\plugins\ChestRestock\chests\Solitude--164-80-16.yml
    C:\Users\Justin\Desktop\Arcticraft Server 03-28-12\plugins\ChestRestock\chests\Solitude\-164_80_16_Solitude.yml

    Some other changes include fixing break permission not working correctly and protecting against various other forms of breaking.

    Here's 2.0.2 which fixes a bug in the set command and adds the command "/cr help" which should have been in there since the beginning!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 17, 2016
  13. Offline


    Thank you! The new .jar works fine! The only errors I get are when I'm doing something wrong. I'll let you know if another bug comes up :] Thanks again!
  14. Offline



    I want to set a global chest that respawn its contents every 300s. I don't need the anti-thief feature, it's a "luck" chest, the first player that open the chest gets the prize :p

    But it isn't working with your latest version. What I'm doing:

    1) put the prize item into the chest
    2) /cr create
    3) /cr set period 300
    4) /cr set unique false

    It seems your plugins is not respecting "cr set period" as it keep spawning itens without waiting the desired 300s.

    Could you please fix it ?
  15. Offline


    Sure thing, will investigate asap.
  16. Offline


  17. Offline


    I am having trouble reproducing this. When I try it, it restocks at the correct interval... Did you change your defaults at all?

    spunkiie Okay, I determined that "fixed" period_mode is what was broken. Fixed it in 2.0.1 which you can get here: until it's available on dbo.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 17, 2016
  18. Offline



    'fixed' period is still buggy. If I set it the plugin doesn't honor the period_time
  19. Offline


    Can you screenshot the output of "/cr check" on the chest?

    edit: Or find the file and it
  20. Offline



    Sure, give me 1 minute

    Here's the chest config:

    Here's the SS of /cr check:

    What I did:

    1) Put the item into the chest
    2) /cr create
    3) /cr set period 20

    -> Works like a charm, the item get restocked every 20s.

    4) /cr set period_mode fixed

    -> BUG!!!! The plugin does not honor 'period 20' anymore

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 17, 2016
  21. Offline


  22. Offline



    Working like a charm dumptruckman

    Thank you a milion. BTW: Where is the donation button ? :)
  23. Offline


    Are Dispensers supposed to work? I am able to "/cr create" on them, but when I power them with redstone nothing happens, and when I try to take something from them it crashes the server =D! These is the error it gives over and over before crashing:

    at net.minecraft.server.Container.clickItem(
    at net.minecraft.server.Container.b(
    at net.minecraft.server.Container.clickItem(
    at net.minecraft.server.Container.b(
    at net.minecraft.server.Container.clickItem(
    at net.minecraft.server.Container.b(
    at net.minecraft.server.Container.clickItem(

    Btw, I love you for this mod. Keep up the amazing work.
  24. Offline


    Yeah, it's suppose to work... Seems like something is stuck in an infinite loop. Considering it seems to be related to clicking an item in a container, i don't think it's related to ChestRestock... (as it does nothing when click items) Perhaps another plugin is causing this?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 17, 2016
  25. Offline


  26. Offline


    This plugin works so well, we love it on our server, but there are some features that we would really like if they're possible to do:-
    • Chests restock period persists through reloads and restarts - ie. If a chest has a 3 minute restock period, and is 1 minute into the timer when the server reloads or restarts the item would restock after 2 minutes. We've had this problem as our server has a 6hour restart time (to reset the RAM etc), and we want the chest to restock after 12 hours.
    • Adding a global message when a chest restocks.
    As I said before we're thrilled with the plugin, but these features really would be amazing!

    Thanks, keep up the good work.
  27. Offline


    The restock times are already persisted in the chest file... These times are based off your computer's internal clock. As long as you don't modify that it should already perform as you desire.

    Here's 2.1 for you with a global_message property. The file will be approved on soon as well.
  28. Offline


    Our chests seem to restock everytime the server restarts, I'll do more testing and get back to you on that though.

    Thats so awesome, amazing response time <3!

    EDIT: After more testing :-
    I am unable to use the /cr set command to set properties on the chest that I've created, this is parsed in the chat after I attempt to use a /cr set command, ie. /cr set name <string> :


    There are no errors parsed in the console, and the chestrestock.* permission node is set in the default group.

    After tinkering with the config of a chest I was able to get the chest to send the global message I desired which was awesome, although the message was only sent when the chest was opened and not when the chest was restocked. This could be due to the fact that I set the properties of the chest via the config instead of commands though.

    I hope that this helps, we appreciate the hard work you put into chestrestock.
  29. Offline


    Hmm... Can you tell me exactly what command you used for /cr set? Were you trying to set the message? it should be
    /cr set global_message This is the restock message!

    For the second issue... The way chests restock currently is when ever they are opened by a player or receive a redstone pulse, it does some calculations to determine, essentially, if it's been long enough since the last restock. If it has, it will restock, which triggers the message. Doing it this way instead of using timers/tasks helps to save resources on your server.
    Having said that, I'll reemphasize that redstone does trigger the restock check. As such, you could set up a very simple redstone clock to pulse to do the restock truly automatically.

    Thinking on it, I've decided to simply add a task that will poll all chests for truly automatic restock at an interval you choose. It is available in 2.1.1 (soon on with a full change log). The rate of this polling task can be adjusted/disabled via config. Chests must have "accept_poll" set to true for this task to check if they need a restock. Also fixed the issue with
    /cr set
    not working whatsoever (thanks for noticing!) as well as some other minor issues.
    Phew... *wipes forehead* that wasn't as simple as I initially thought but there you go!

    Edit: A warning. This feature won't work with unique chests! (There'd be no real reason for this anyway, I think..)
  30. Offline


    Again, I'm amazed by your response time, I have my server admins testing your 2.1.1 revision now thoroughly and will drop a message if we come across any issues!

    Thanks again.
  31. Offline


    Dear Dumptruckman,

    Firstly, let me begin by saying that I really appreciate all of your hard work in developing this plugin as it's made things easier when developing new content for the players on my server. I've not worked with Java so I've got no idea how difficult it is.

    I've used your plugin for a couple of items and, despite some issues getting it set up, once it's set up it works perfectly for what I've needed it to so far. I am also having the the issue discussed above; I cannot use /cr set <property> <value>. The plugin just returns the example text as shown above, so I'm working entirely by editing the chest .yml files in notepad. It's a bit more fiddly, but I'm fine with working this way.

    That said, I have two queries when working with your plugin.

    The first one is could you please update the in game help to display a list of all of the available properties for the chest, and the format for their values. Could you also please standardize the values? Some are enclosed in single quotation marks for example 'true' or numerical values '1'), and others are not (player, replace, etc...)

    An example might be:

    Preserve_slots: true/false
    items: slot number:t*:item id;#quantity/< item>
    redstone: true/false
    period_mode: player/fixed
    name: <text string>
    unique: true/false
    restock_mode: replace/add
    player_limit: 1
    indestructible: true/false
    period: 1 to whatever range you deem suitable
    global_message: <text string>

    *What does the t stand for?

    The second query is whether or not your plugin will do what I want it to. I've set up a redstone circuit to power 4 chests when a button is pressed by an Admin on the server. I don't want the chests to restock after a certain amount of time, or at set times dictated by the server. I only want it to restock when it gets power. What value can I place in the period property to have it never restock automatically?

    Yours Sincerely,

    Server Owner
    Kingdoms Minecraft Server
    Survival, Open PVP, Factions

Share This Page