RestockIt
RestockIt
Note about Permissions
If Restockit has suddenly broken for you with 1.9.1, check the permissions and release notes below - OLD deprecated permissions (not used for 1.5 years) have been removed!
The restockit.chest.* permission has now been deprecated - see below! It still works, but will likely eventually cause issues (such as what I just mentioned)
About
RestockIt allows you to fill chests, trapped chests, hoppers, droppers and dispensers (plus whatever other containers you want to add) with infinite items, or with gradually refilling items.
It supports PermissionsEX and SuperPerms, with separate permissions for creating RestockIt chests and RestockIt dispensers.
If you don't use PEX or SuperPerms, RestockIt will automatically detect this and only allow ops to create RestockIt chests or dispensers.
RestockIt also has a blacklist, so you can prevent the use of dangerous or expensive items.
There is a major update in the works, which is an almost full rewrite; this will include things like enchantments, different items in one chest and more. I don't have an ETA for it, so the best I can give is "eventually" - I don't want to give a date to avoid disappointment.
How to use
To create a RestockIt container, create a sign above or below the chest/dispenser/whatever with the following syntax:
line 1: Anything
line 2: RestockIt
line 3: Item number or name
line 4: Delayed Restocking Information OR Anything
One sign is required per ccontainer, double chests only require one sign. However, if you place a sign above each half of the double chest, with different items on each, the double chest will be filled half-and-half with each item.
Additional Features
- As well as item ID numbers, internal Minecraft names can also be used, for example: stone or trapped_chest
- Items with damage values are fully supported, for example Lime Green Wool would be written as WOOL:5 or 35:5
- You can also use RestockIt as an Incinerator - just put Incinerator on line 3.
- Dispensers will automatically re-stock themselves whenever they are triggered - you don't need to open them.
- RestockIt supports Full Chest syntax as well as its own, so you don't have to re-sign all of your chests if you used to use Full Chest.
- To use delayed restocking, set the 4th line to:
- x Items, ys - this will restock one item every y seconds, until there are x items in the chest. (Alternate: xi,ys)
- x Stacks, ys - this will restock one item every y seconds, until there are x stacks in the chest. (Alternate: xs,ys)
- Rather than specifying time in seconds, you can specify it in ticks (20ths of a second), by not typing an s after the time.
- Remember to put a comma between the number of items and the delay, or it won't work.
- If you don't want to use delayed restocking, leave line 4 blank, or put anything you want in it.
- To use the blacklist, simply add items (number or capitalised name, just like on a sign) to the config.yml file in the RestockIt folder.
- Bedrock and TNT are blacklisted by default - you can remove these if you want.
- To add additional containers to fill, add items to the "singleContainers", "doubleContainers" or "dispensers" list in config.yml - they should be fairly self-explanatory.
- Unless there's a container you specifically want to use, I'd recommend leaving these alone.
Permissions
Permissions for PEX and SuperPerms are:
- restockit.container.create
- restockit.container.open
- restockit.container.destroy
- restockit.dispenser.create
- restockit.dispenser.open
- restockit.dispenser.destroy
- restockit.incinerator.create
- restockit.incinerator.open
- restockit.incinerator.destroy
- restockit.blacklist.bypass
Remember, you don't need PEX or SuperPerms to use RestockIt - It will automatically use op status if you don't have PEX.
Without a permissions plugin, *.open defaults to everyone, *.create and *.destroy default to ops, and restockit.blacklist.bypass defaults to nobody.
Also, you can use the opsOverrideBlacklist setting (set it to true) in the config.yml to allow ops to bypass the blacklist. (This is only really useful if you're not using a permissions system)
Planned Features
- A way to control how many items a chest can accept being put into it
- Ability to save current chest inventory, and restock that
- A system of accessing a main chest from multiple other "slave" chests
New to 1.9.2/3
- Fixed issue with deprecated permission detection for the blacklist
- RestockIt (hopefully) now works with Java 1.6
- Fixed exception when checking permissions under certain circumstances
Sorry for the rapid updates!
New to 1.9.1:
- [Bugfix] Permissions now work properly with new containers
- OLD deprecated permissions have been REMOVED
- New permission restockit.container.(create|destroy|open)
- Permission restockit.chest.* has been DEPRECATED (still works, but please change it...)
New to 1.9:
- Any container can now be used (set in config.yml)
- Trapped chests, droppers and hoppers now supported out of the box
- Items on signs no longer have to be all upper case
- General code cleanup (see GitHub if interested)
You can download Restockit from the button at the top right of this page.
The latest build is available at a wget-friendly link: http://dev.bukkit.org/media/files/768/478/RestockIt.jar
Source is available at https://github.com/xCP23x/RestockIt
RestockIt is open source, and uses the GNU GPL v2 license.
Special thanks go to Scott Marshall for code contributions and debug help.
Thank you so much! This will be very useful for Easter eggs :D
@JakamoJD
I've not tested it with 1.2, but it SHOULD work...
Just to make sure, you're using RestockIt 1.6?
I'll test it with 1.2 now, and will edit this comment with my results.
I tend to only release RestockIt with Bukkit RBs, however if it doesn't work I'll build it for 1.2 straight away.
EDIT: Found an NullPointerException caused by the scheduler, will try to fix this now
EDIT 2: It seems to be something with the beta/dev Bukkit builds... ContainerBlock has been deprecated, and InventoryHolder, Chest and Dispenser are returning null inventories. I'm guessing that they've broken something inventory-related. I'll try a few other things, but I don't know how much I can do.
EDIT 3: Fixed it! It seems that 1.2 throws NullPointerExceptions much earlier that it used to, all I had to do was prevent it earlier. I will upload a fixed version now (1.6-2034)
I can get all the features to work except for the timed restocking. i have tried all the different ways to rearrange the last line; 1 Item, 5s 1i,5s 1i, 5s but i cant seem to get it. i am running in 1.2 though... anyways is there anything im doing wrong?
Thanks, it works now! Just to let you know, I've been looking for a plugin like this for weeks... Then Acrobot directed me here (if you know him - he made ChestShop) :)
@Kurtis1928
Try putting a comma between the number of items and the delay - after reading through the description again, I noticed that it's not very obvious that you should put a comma there, so I'll amend that now.
Everything else on the sign seems correct, so it looks like it's just the missing comma stopping it working.
Oh, and you're correct, RestockIt doesn't have a config file (at the moment).
Thanks,
xCP23x
EDIT: Amended the description, it should be a lot clearer now
Hi, I think I'm having a problem... Whenever I make a RestockIt sign, the chest always has unlimited items. Any ideas why? I'm using CB 1.1-R4 (I used /version to check it) and the latest download you have. Also, there isn't a config file for the plugin, but I don't think there's supposed to be. Here's what I did:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - I want my chest to respawn one dirt every second until the chest is full. Here's how I made my sign:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - EDIT: I'm pretty sure that the last line's format is incorrect, because putting random things on it creates unlimited items... I followed the description exactly. Could someone please tell me the correct format?
@powerpawn
At the moment, no, although with the features I'm working on, a fair amount of the code to do something like that will be there. When I've finished implementing some other features and the code base is there, I'll look into doing something like this.
Oh, and thanks!
-xCP23x
Hey! Nice plugin! Just out of curiosity, could I use this as a spawn chest and make it so that a person can only use it once? Thanks!
@EHAndrew
Short answer: Yes
Long answer:
The current version (1.5.5 at time of writing) is not compatible with R5. However, the major re-write I'm working on is 99% done. It uses the new listener system, and does not use any deprecated methods, so will work with R5. As it's almost done, it should be released within the next few days, so will be ready in time for R5.
will restockit be ready for R5?
@ramsydk
The idea of placing items in chests, then restocking those is brilliant - I hadn't thought of that. I'll have to look into adding that as a feature. Until then, however, you could have a RestockIt chest full of one particular map.
For example, the item ID of map_1 would be 358:1, and map_2 would be 358:2, etc. So you could place a sign with, eg, 358:1 or whatever the number of the map created by courier is, and the chest will be filled with map_1.
I've been working on an adventure map, and instead of having users read notes in notepad or so i would write a letter with courier and place it in a chest that would restock. But i dont think that is possible, since you put the item to restock on the sign?
I guess there is no chance of placing an item in the chest and having it restock that instead? one for each player would suffice
@Brock_Blocking
Thanks for the suggestion, I will try to implement this for the next release, which is almost finished now. If not, it will be in the release after.
-xCP23x
Could you please add a blacklist for items. For us non permission admins. I'd like everyone to have this feature so long as I can remove the game breaking items, diamond block, gun power, nether items and so on.
@fengchiu1997
Thanks!
Funny you should ask about Super Perms, I literally implemented that yesterday. I'm currently in the process of re-writing a bunch of code, so that and some other features (eg. delayed restocking) SHOULD be ready by the end of this week.
This plugin is EXACTLY what I need. Is it possible to make it super perms compatible?
@Brock_Blocking
That was pretty much what I was thinking (although I may put both on the bottom line)
I'm currently working on another requested feature (making chests available from other chests (eg to fill multiple dispensers from one chest)) and some of the code from that should be re-usable for item limits, so that's next on my list.
Also, I'm cleaning up and commenting code for anyone who wants to look at it for help with anything they're writing (It's GPL, so I've got no problem with that).
Anyway, thanks for the suggestion.
-xCP23x
you could make use of those other two lines by adding a chest open cool down and item number limit. :D
ex: 1 diamond in chest can only be opened once every 24 hours.
@Zombiemold
I'll work on signs below chests now, and will start trying out some of my ideas for the cooldown period. Thanks for the comment, I really find feature requests useful.
-xCP23x
EDIT: RestockIt 1.5.2 now supports signs under chests
I would like to second what @kahlilnc requested. It's the one thing stopping me from truely getting some serious use out of this plugin. I would also like to be able to set a time on when the chest restocks, maybe have a cooldown. Additionally, being able to put a sign below a chest (to hide it) would also be very very welcome.