ItemFinder
What is it?
ItemFinder is a plugin which basically allows you to scan through all chests, furnaces, hoppers, and other stuff wich can hold items in your world and see if someone contains a specified item. This is really useful if, for example, you had a bad admin who, before getting banned, has hidden some precious stuff in some chests all around the world, and you don't know where.
How to use
- when you first install the plugin, before starting to search for an item, you have to index all inventory holders in all worlds. To do so, you have to type the command
/itemfinder index
and then typeY
. Indexing all those chest will take a while (depending on world size, it could also take several minutes); - once indexing is done, you can start searching for your items! Simply type
/itemfinder search <item...>
, replacing<item...>
with the IDs or the names of the items you want to find. For example, if you want to find all inventory holders containing iron and diamond sworlds, you would have to type/itemfinder search iron_sword diamond_sword
. Remember that if you want to search something again, you don't need to re-execute the/itemfinder index
command!; - teleport to the locations found and evaluate what to do. If you have ProtocolLib installed, you can teleport to one of them by simply opening the chat and clicking on the desired location.
The plugin has an updater, which basically allows it to update itself when I publish a new version. You can disable it in the config, setting the key autoUpdate
to false
.
Commands
/itemfinder index
: indexes all inventory holders in all worlds;/itemfinder cancel-indexing
: cancels inventory holder indexing;/itemfinder search
: searches for an item in all indexed inventory holders.
Dependencies
To work, this plugin needs to have PowerNBT installed. Additionally, you can also install ProtocolLib if you want to have the additional teleporting utility discussed before.
Permissions
itemfinder.*
: allows the player to use all the ItemFinder commands;itemfinder.itemfinder.*
: allows the player to use all the/itemfinder
commands;itemfinder.itemfinder.index
: allows the player to use the/itemfinder index
command;itemfinder.itemfinder.cancelindexing
: allows the player to use the/itemfinder cancel-indexing
command;itemfinder.itemfinder.seach
: allows the player to use the/itemfinder search
command.
Todo
disable the player to search for an item before inventory holders have been indexed;read region files directly to get all inventory holders;put the indexing code on a separate thread to reduce server lag;- add support for data search;
- make the plugin also scan through all entities, especially minecarfts with furnaces or chests;
- make the plugin also scan through all player inventories;
- make the indexing work with multithreading;
- add the ability to index and search for enchantmets etc..
If you have any suggestions or have found a bug, please tell me!
It's pretty useless if you can't search for all diamond pickaxes which have let's say an enchantment that's over the top... You can just search for plain items...
@Creeperbossya2
Of course not!
Edit: if you look at the description above, you can find everything about permissions and permission nodes ;)
@fungreenfox
Oh, now that I think about it, the confirm message could may be unclear. You have to open the chat and then type
Y
(and then, of course, press enter). I'll fix this in the next update, sorry! :)@Creeperbossya2
I dont have access to others server for this. But a normal player with itemfinder.* will experiense the same as i do, at my server.
Does this work if you are not an admin and on other people's server?
@imamo
Yes the NBT is installed. Itemfinder says type Y to continue, but nothing happens.
@Zilacon
I have to use that dependency because of the use of NBTs. In fact, in the Bukkit API you can't access, save, or modify NBTs. I would need to do some reflection and work with NMS to make this work. I already tried to do this (and I didn't get it to work) but since I'm not a professional nor I have that much time to spend on my work, I gave up. For now, PowerNBT is a required dependency, but in the future I may make my own implementation of Minecraft's NBT system.
@imamo
Why would you make your plugin use such a large dependency for such a simple plugin?
250 KB for a single function is kinda ridiculous.
@fungreenfox
Did you install PowerNBT? Because it's a required dependency now. By the way, I just uploaded a new version because the other one got rejected because of the updater. Now everything should be fine, I hope they'll approve it, since it's already the second time it got rejected for the same reason.
It doesnt load atall. Using 179 and itemfinder is an unknown command.
@fungreenfox
I finally updated an new version! Now it is much faster and efficient :D There's still a little glitch, I hope I figure out rapidly how to fix it.
I'll probably have to reflect the whole NMS NBT system to get stuff work, since the PowerNBT API isn't doesn't work well in most recent version of CB when chunk processing. It's not really necessary, but this will make work much easier in the future when I'll add checking for enchantments etc. Point is, this will require some time ;)
if it can help: i am using worldborder, and 10 worlds are max 7000 radius and one is without border, but only little building in this last one, and likely no chests in that one.
Some worlds are 2 years old, some from bukkit 162 and one from 172.
@fungreenfox
Oh this is so frustrating! I tried it a couple of times before uplading it, and I didn't get any problems. Now I tried again with a bigger world save and I get errors... :( Anyway, thank you really for your support! I'll try to fix it asap!
I do not know, if this itemfinder is doing anything, or it stopped due to this error:
2nd edit: (it actualy stops after choosing /if index)
[01:46:37 INFO]: [ItemFinder] Indexing all inventory holders: 0% done.
[01:46:37 WARN]: Exception in thread "Craft Scheduler Thread - 23"
[01:46:37 WARN]: org.apache.commons.lang.UnhandledException: Plugin ItemFinder v2.0 generated an exception while executing task 193825
at org.bukkit.craftbukkit.v1_7_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:56)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Asynchronous entity world add!
at net.minecraft.server.v1_7_R1.World.a(World.java:2468)
at net.minecraft.server.v1_7_R1.Chunk.addEntities(Chunk.java:765)
at net.minecraft.server.v1_7_R1.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:131)
at net.minecraft.server.v1_7_R1.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:88)
at org.bukkit.craftbukkit.v1_7_R1.CraftWorld.getChunkAt(CraftWorld.java:118)
at org.bukkit.craftbukkit.v1_7_R1.CraftWorld.getBlockAt(CraftWorld.java:82)
at mamo.itemFinder.Indexer$1.run(Indexer.java:69)
at org.bukkit.craftbukkit.v1_7_R1.scheduler.CraftTask.run(CraftTask.java:58)
at org.bukkit.craftbukkit.v1_7_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
... 3 more
@imamo
I am looking forward to use it Imamo. It will be tested up against 11 worlds.
@fungreenfox
Dude, after replying to your post I finally got back to the plugin! I worked all day, finishing what I started some time ago. And... It's done! ItemFinder v. 2.0! Now it's endless times faster and doesn't cause lag any more. The plugin has only to be approved and then will be avaiable for download. :D
Good luck, ill try next version :)
I changed the last file back to Alpha, as there are still some stupid errors in the permissions and it the inventory holder indexing isn't that "good". If you want do downlad it, click here.
@fungreenfox
I'm already back. I'm trying to rewrite the code to read directly the region files through NMS instead of using Bukkit API, wich loades the chunks to read them (which is slow). The only problem is that I'm really busy in this period and I can't seem to find time to work on the plugin. I'll tell you when I have some updates.