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.
07:57:02 [SEVERE] Could not load 'plugins/RestockIt.jar' in folder 'plugins' org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: org/xcp23x/restockit/RestockIt : Unsupported major.minor version 51.0 at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:150) at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:305) at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:230) at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:213) at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:189) at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigurationManager.java:53) at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:156) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:422) at net.minecraft.server.ThreadServerApplication.run(SourceFile:492) Caused by: java.lang.UnsupportedClassVersionError: org/xcp23x/restockit/RestockIt : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:41) at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:29) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:139) ... 8 more
@bladedpenguin
Thanks for the bug report!
I've now uploaded RestockIt 1.8.2, which fixes this and another bug.
No matter what I do, the chest is always full when I open it. I set line 4 of the sign to "27i,80000s", which, if I understand correctly, should add something once per day untill the chest is full. Am I missing something?
Thank you very much!
@sheepwool7
Sure, I'll start work on that tomorrow, it shouldn't be too hard to implement.
Thanks for the suggestion!
EDIT: Added lots of new permissions - see "Permissions" section
Hi again!
Is it possible that maybe you could do a
Just so that if I want a dispenser trap, (dungeons or something) then they user can't steal from it? I was trying to find a way to make them really far away just so players couldn't reach, but I feel like someone would find a glitch to get to it.
@Curtis321
Good idea, I'll probably work on that soon, after I've got a couple of things done.
Thanks for the suggestion!
@sheepwool7
No, not at all! The current version of RestockIt works with 1.2.5, as it did not change anything that RestockIt uses. I only tend to re-upload for every second or third Bukkit update, unless something has broken, in which case I'd do it straight away.
I hope this didn't die all the sudden! :P I'm still on 1.2.4 so I'm in the clear for now...
@Brock_Blocking
Thanks for the bug report, RestockIt 1.7.1 should be uploaded soon, fixing the chest filling on a blacklist rejection.
About the trouble with DOOR and DOUBLE_STONE, RestockIt uses the internal IDs Minecraft supplies, which are WOODEN_DOOR / IRON_DOOR and DOUBLE_STEP. I'll probably make a common names list at some point to make this sort of thing easier.
Alright update. Noticed a blacklist bug where after it says you have no permission, the chest afterward is filled with the item ;)
Also its having trouble recognizing DOOR and DOUBLE_STONE
Fantastic plugin. I love working with signs to quickly accomplish what I need. Please keep it up!
Looking forward to dat blacklist. Great plugin.
@Kurtis1928
Again, sorry for the delay, it seems that bukkitdev notifications may have been broken for me on the 16th.
Just to confirm, that setup works normally, but if you put a damage value on the item, it doesn't work?
EDIT: After writing that, I may have thought of a possible bug that stops damage values working with delayed chests - I'll have a look into that now.
EDIT 2: Found the bug, fixing it now.
EDIT 3: Fixed it! RestockIt 1.6.1 should be available to download shortly.
@jorisk322
Sorry for the slow reply, it seems that I didn't get an email notification.
For the future, I was planning some sort of system that would allow you to set up a RestockIt chest using commands, so I should be able to implement this. Once I've finished a couple of things I'm working on for RestockIt, I'll definitely look into doing something like this
Thanks, xCP23x
Could you make it so it doesn't require a sign? Because where I want to use them, the block above and underneath are both visible.
@xCP23x
Alright, thanks. I'll update to the latest latest later today and let you know if it works. If it doesn't, here's the picture of my layout:
PS. That transparent blue stuff is edited in; it's where a block normally is.
EDIT: Alright, I just tried it. I updated to build #2082 (from dl.bukkit.org), but no luck :( I wonder if it's the way I have my signs. And it may have used to work, I can't remember when though.
@Kurtis1928
Thanks for the suggestion, I'll see if I can implement something like that. The new inventory system that caused me some grief with 1.2 provides the listeners I'd need to do this, so it should be fairly straightforward.
About the damage values, I'll look into that and edit this when I find the problem.
EDIT: I'm on a server on Bukkit 2060, using RestockIt 1.6-2034, and it seems to be working fine for me (getting mossy stone bricks). Maybe try updating your server, and checking logs to see if RestockIt is giving any exceptions. If that doesn't fix it, reply and I'll see if I can duplicate it.
Hi, I remade all my shops just so I could have them restock themselves... :P This is an amazing plugin! I was wondering if you could add a feature... I want people to be able to buy and sell to shops. When they buy things, they have to wait for the shop to restock itself. But say someone sells their weekly cobble gain, and fills the chest. Nobody can sell anymore until someone buys all of that cobblestone. So I was wondering if you could make it (say, on the last line of the sign) where you can tell the chest to sell x items every x seconds.
Example:
"g" for give, and "t" for time. And you don't have to do it exactly like that; I just thought of it real quick for an example. :P But yeah, if it's possible to add that, I'd be very happy!
EDIT: Instead of posting again, I'll just edit this... My damage values don't seem to be working. I want Mossy Stone Bricks, so I put "98:1" in line 3. But I just get Stone bricks; no damage value. Any ideas? I have the latest version of RestockIt, and I have build 2040 of CraftBukkit.