ClearInv
ClearInv - A simple plugin that is useful to clear items from your own or other players inventories. You can either clear all items or select item(s). If you have any questions or comments please feel free to email me at [email protected] and I will reply to your email as soon as possible. I generally do not notice that there are comments on the page so that is your best chance at a response.
Version: 2.0.1
Features
- Can either clear all the items in your inventory, clear certain items, or clear all items except certain items, or clear the armor from your armor slots. If you are using permissions, this requires clear.self
- Can either clear all the items in another players inventory, clear certain items, or clear all items except certain items. This requires either OPs or permission node clear.other
- Will post a warning in the server console if a player without the permission to clear others tries to.
- A custom set of words for some items like rose for red_rose, and dandelion for yellow_flower (if you have any suggestion for new ones please let me know)
- Allows those with the permission to clear other players inventory to view the inventory first*
Download Links
Permission Nodes
- clear.self- Allows a player to clear their own inventory (this is good for a server that only allows certain permissions to certain donation levels.
- clear.other- Allows a player to clear other players inventories. This property will only go to op's and people with this property.
- clear.admin- Allows the player to clear the inventories of all the players online at the time either completely or selectively. Also allows a player to reload the items.csv
Command Syntax
- </clear> <playername> except [item1] [item2]...
- </clear> [item1] [item2]...
- </clear> armor
- </clear> reload
- </clear> undo
- </preview> <playername>
- </unpreview>
- </revert>
- More
Change Log
- V 2.0.1 Fixed a null pointer exception on the clear except command.
- V 2.0.0 Added the debug code which Smiley43210 wrote with some minor tweaks. Also fixed a rare null pointer exception for the preview command. Added the new items for 1.2 to the item list. Updated for compatibility with 1.2. Added a new mode of previewing inventories (continuous, where it will continually update your preview). When previewing an inventory from the server console certain items are red as a warning indicator, this can be adjusted in the config.yml dangerItems value. Added the clear to chest which will clear the items you tell it to a chest that it will spawn 1 block away from you (roughly in the direction you are looking), this requires LWC. Also some minor bug fixes and missing values in the config.yml and items.yml, in order to make sure they are written properly I recommend deleting your old versions before installing this version of ClearInv.
- V 1.9.6 a-lot of backend tweaks, heres the change log as I have it (from keeping track): Adjusted the output text to be more like other plugins (normal output grey, error output red). Also made the version command output the items.csv version currently on the server. Some major code cleanup (5 or 6 methods removed/combined), lots of comments added, and reworking of various methods. Added a new list to the config which is a list of item id's which have data values assigned to them (instead of the old way where they were hardcoded).
- V 1.9.5 No major update really, just updating for the latest items, sorry it took so long, things at school have been hella busy
- V 1.9.4 Ok so this version has a bit of code rewrite and removal. First I removed the autoupdate functionality in order to prevent some bugs. However in doing that I was able to make it so that java 6 was only required which is what everyone is using. I also wrote a function to check for updates (does not download them), and notify you, which should actually be faster in the check aspect than the library I was using. I also have included an items.csv within the jar which will automatically be written if the file does not exist already.
- V 1.9.3 I fixed the clear except for the server console which I overlooked while fixing it for the players. On top of that I have added the ability to undo a clear with the /clear undo command. This will clear your last undo, even if it was on another player, there are however a few limitations. It will not restore armor if you clear a players inventory slots, it will also not restore everyones stuff if you clear everyones stuff at the same time using the "*" wildcard
- V 1.9.2 I've had some people having the auto-updater download the item list to the wrong location (and had it work fine on other machines as well) so I added a way to reload the item list without reloading the server. So if yours puts the item list in the wrong place, just move it to plugins/ClearInv/items.csv and then run the clear reload command and it will reload the items.csv. This uses the clear.admin plugin and also can be done via the server console.
- V 1.9.1 Rewrote the way that the config file is programmed to be much simpler and easy to read.
- V 1.9.0 Updated and tested for the latest RB of craftbukkit.
- V 1.8.8 Removed support for the permissions plugin, the choices are either bukkits built in permission system or none at all. I also fixed a couple of rare null pointer exceptions and adjusted and added some outputs. Also some code cleanup as well.
- V 1.8.7 Fixed the console clear all players command (/clear *). Also some minor code cleanup.
- V 1.8.6 Fixed the bug in /clear except. Also adjusted the autoupdate so that when it updates the items.csv it will automatically overwrite the old one which required some minor adjustments and a new branch for the item list.
- V 1.8.5 Made it so you can preview an inventory from the server console
- V 1.8.4 Added the option to do /revert to get your inventory back while previewing another players inventory. Also did a couple back end tweaks which should increase it's performance slightly.
- V 1.8.3 Fixes the bug reported by SlyCooperMan, where upon loading the plugin if there is no config file, it throws an exception. Thank you for the report.
- V 1.8.2 Updated the configuration file loading for the updated bukkit recomended build (1317).
- V 1.8.1 got superperms in there for real this time. I also have fixed most of the command framework around the console (but clearing all players from there is still broken, for no apparent reason). I also have updated the items.csv for 1.9 which I will also link. I also have it so that you can have the plugin automatically download the updated item list if you give it permission to in the config.yml. Also I adjusted how the config.yml is written so that it will check to make sure all the values are there, and if they aren't it will add them with their default values.
- V1.8.0 Rewrote most of how it works in the background. Version 1.8 can clear items with damage values (for example only red wool). I have also written a roughly 1600 line CSV which is what is used, so you will have to download this and put it on under "plugins\ClearInv\items.csv". I have also added an option for superperms, which may be buggy, but will be worked on however the permission nodes are the same as before. There are a few known bugs, that I will work on, however for the most part it works. I know for a fact that some of the commands do not work from the server console, the other bug i found is that you can not use /clear armor (however you can clear each individual piece). There may be some other ones I haven't found, but I don't think there are (at least not major ones). You will also have to download this latest version manually due to the number of changes, in order to prevent major complaints about incompatibility with the auto-update.
- V1.7.1 Makes it so the preview will be unapplied after about 5 minutes (6000 server ticks). Also added the ability for the server admin (or anyone with the permission clear.admin) to clear all players inventories, either selectively or completely. You just have to use * as the player argument. This will also be able to execute from the server console.
- V1.7.0 Added the ability for OP's and players with the clear.other to view the inventory of other players using the /preview command. To return to their own inventory they just use the /unpreview. If they disconnect or are kicked, their inventory will be returned to them as well (or at least the server will attempt to).
- V 1.6.0 Code cleanup, and text fixes mostly however it also adds a new feature, added the ability to remove just select armor items, for example if you do /clear boots it will remove your boots. I also have done some major code cleanup in this latest version.
- V 1.5.1 Updated the autoupdate library
- V 1.5.0 This is a pretty major update as first off it fixes the bug that prevented being able to send the command via the server console. However it also includes the ability to have the plugin auto-update thanks to @Kalman Olah. If you wish to opt out of this, after the initial run of 1.5.0, then go into Plugins/ClearInv/config.yml and change the auto update value to false. In getting this set up so that it would auto-update it reqired some changes to the plugin.yml which will now make the folder that the config files are placed in ClearInv instead of clear, so once you update feel free to delete the clear folder. In the next update or two it will be code cleanup, and expanding the item list mostly.
- V 1.41 Made it so you can now just do /clear <playername> instead of /clear p:<playername>. The bug still persists that you can not execute the command from the console unfortunately.
- V 1.4 Added the ability to clear your armor slots (all of them only at once, I'll probably tweak this later). There is one known bug and that is that the server console can't execute the command, I can't seem to figure this out yet, but will keep working.
- V1.33 Code cleanup mostly which reduced the size of the jar. It also outputs the item name you put in instead of bukkit's name since some of them are odd.
- V1.32 Text bug oversight fixed. (also forgot to change the version in the jar file, so don't freak out when it lists the wrong version).
- V1.31: Added support for pistons, sticky pistons and shears (with smart names instead of the long names given by bukkit
- V 1.3: added the ability for the server console to clear a players inventory, and tested working on build 935
- V 1.2.1: small bug fix, where people with permission to clear others inventories couldn't clear their own. Sorry about that bug slipping through.
- V 1.2: initial public release, includes all the features listed above.
@AvdLrnProj
This is a really old plugin and isn't being updated. I doubt you'll get much support.
Hello. This doesn't seem to work with command blocks... or am I just being a n00b and can't figure out how?
Thanks!
@wwsean08
Does "/clear *" do armour as well or should that be done separately?
EDIT: No it doesn't.
@Teqna
You're supposed to be able to using the clear * command, however I got an email today saying that it was currently not working for at least the particular server admin who emailed me so I'm looking into it, however the syntax is:
/clear * will clear everyone logged into the server currently, use this sparingly, it requires the permission node clear.admin, which should be given sparingly
/clear * <item1> [item2]... this will clear the items listed in the arguments from all the player logged into the server and it requires permission node clear.admin, which should be given sparingly
/clear * except <item1> [item2]... this will clear all the items except the ones listed in the arguments from all the players logged into the server and it requires permission node clear.admin, which should be given sparingly
/clear * armor will clear the armor slots from all the players currently on the server and it requires permission node clear.admin which should be given sparingly
could you please add a way to clear the inventories of all online players? (sorry if this is already possible, I can't find how to do it if so)
I will have a version out for the RB soon (hopefully this weekend), I'm just trying to nail down a few loose ends first.
@quickclay
there we go, ClearInv 1.9.7 R2 has that new command, the syntax is /clear -c <player> <item1> [item2]... and it will put them in a chest which locks to the person who performed the command, it will be located 1 away from the player on either the x or z axis (depending which way they are looking). The chest placement isn't perfect, but it's a good start.
@quickclay
this also has a preview built in, (and the next version will have a better version which will continually update based off of events like player picking up items etc). I will look into that, obviously that exact command wouldn't work because it would clear chests out of their inventory, but i will kinda draw out how that would work and see what I can do
@wwsean08
Well the chest could just be one designated by the admin/moderator that retrieved the items. Then they could tp the victim to the chest later for retrieval. Or... loading into the LWC API to ... ehh. nvm that's getting complicated.
1) someone says "help bozo stole my diamonds and diamond sword!"
2) admin /clear bozo chest
3) items appear in a chest designated by the admin
4) /ban bozo, "come get your items"
Side note: essentials /invsee plus this has been awesome together in testing on our server.
After I release the version for 1.2 (which shouldn't be more than a day or so after 1.2 is finalized), I have a plan for enhanced inventory preview system, it should be pretty sweet if it works like i hope it does.
@quickclay
that's an interesting idea, the only thing i could see hard about it would be tracking who's stuff it is so the chest could be locked down to them
This looks very promising! I would love it if my staff could clear a player's (thief's) inventory and have all the items appear in a chest somewhere for stolen item retrieval.
@genesis_aix
sorry for the delay, I have been quite busy with school. That is the item list, which goes in the Plugins/ClearInv folder. Also I am posting a new version of ClearInv right now.
Just reporting in =)
On startup; [ClearInv] There is a new version of the items.csv available for download, you can get it at http://dcp.wwsean08.com/dl.php?id=items%20new&ver=latest
Im running 1.9.5. and the link obviously does not go to a jar file but a Item.csv
Beats me, just wanted to let you know.
@genesis_aix
good idea, and thanks, it's a pain sometimes, but I am working on some code cleanup currently.
Glad to see that your keeping it alive! Its a very neat plugin. Essentials build-in is just a hassle to use, and there is only one clearing option.
I think you should put "Command Syntax" above "Change log" on this page.
I'm sorry for the delay @gary470, i've been busy with school. This is not possible for that, however you could setup a plugin like mutliinv which allows you to define seperate inventories for certain worlds
Was wondering if there is a way to make it automatic . I have a creative world that people can go to and then back . I would like to clear there inventory before coming back to the survival server .
sorry for the delay guys (i didn't notice that there were posts), clear inv requires java 7 due to some of the fileio for the auto-updater. It would appear you are using java 6.
2011-12-19 16:20:05 [SEVERE] Could not load 'plugins/clear.jar' in folder 'plugins': java.lang.UnsupportedClassVersionError: com/wwsean08/clear/Clear : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:634) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:277) at java.net.URLClassLoader.access$000(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:212) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:36) at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:24) at java.lang.ClassLoader.loadClass(ClassLoader.java:321) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:170) at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:215) at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:136) at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:151) at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:127) at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigurationManager.java:52) at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:145) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:399) at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
D:
yes, I've moved the items.csv