BlockDetectThis plugin is no longer supported by the creator of it. Please contact Taco if you wish to continue this plugin. Description:This plugin simply allows you to detect all blocks of a set ID within a set radius. Why would you want to do this? It can be used as an admin tool to find hidden chests of suspected thieves, or a mining tool to find diamonds or dungeons!Permissions:Currently only ops can use the commands in this plugin, though I do plan on releasing another version with support for the permissions plugin. Download: Download BlockDetect.zip (.jar) Source code: Download the source Commands: /detect [ID] [Radius] - Detects all blocks of the given ID within the given radius. Ex. /detect 54 10 will detect all chests within a 10 block radius of you. /dpage [page #] - Displays page by page all results, if any were found. If not, it will display the last successful results. Known bugs: - None. Changelog: 3/22/11: - Initial release
Cool plugin, been thinking about requesting this for awhile Feature request: Points compass toward closest result.
Okay, 2 things: 1st one: Screenshot Not sure why it came up with 2 results, but could be that I moved around a bit while it was searching. 2nd: Throws out this when you simply /detect without an item ID/radius: Code: 16:00:49 [SEVERE] null org.bukkit.command.CommandException: Unhandled exception executing command 'detect' in plugin BlockDetect v1.0 at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37) at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80) at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:229) at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:645) at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:608) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:602) at net.minecraft.server.Packet3Chat.a(SourceFile:24) at net.minecraft.server.NetworkManager.a(SourceFile:230) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:76) at net.minecraft.server.NetworkListenThread.a(SourceFile:100) at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272) at net.minecraft.server.ThreadServerApplication.run(SourceFile:366) Caused by: java.lang.ArrayIndexOutOfBoundsException and this when you /dpage: Code: 15:57:13 [SEVERE] null org.bukkit.command.CommandException: Unhandled exception executing command 'dpage' in plugin BlockDetect v1.0 at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37) at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80) at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:229) at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:645) at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:608) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:602) at net.minecraft.server.Packet3Chat.a(SourceFile:24) at net.minecraft.server.NetworkManager.a(SourceFile:230) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:76) at net.minecraft.server.NetworkListenThread.a(SourceFile:100) at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272) at net.minecraft.server.ThreadServerApplication.run(SourceFile:366) Caused by: java.lang.ArrayIndexOutOfBoundsException: 0 at com.FriedTaco.taco.BlockDetect.DPageCommand.onCommand(DPageCommand.java:23) at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35) ... 12 more I know that both of those are caused by not having an item ID or radius, but it'd be nice if it just returned a proper command usage rather than internal server error Other than those 2 issues, though, I love this plugin Found this just now, ended up in the lava
This was a rather quick release, so I guess I forgot those XD I will fix those in a second. Also in regards to the duplicates, I will make it so it only uses the location you start at to detect so if that is the case, that should fix it.
Okay so I did /detect 56 1000 to see where the diamond ore was within 1000 blocks of me and it lagged my player out after like 5 seconds and totally shutdown my server. Well it didn't shutdown the server but I could not input and commands and I could not rejoin. My computer is also a bit laggy now. Thanks a ton. Might have to restart now...
That should be common sense not to do that. That's a 2000X2000X2000 square (It spans 1000 in every direction. Meaning 1000 from the point of origin. You are the point of origin,) that you're trying to make the server scan. Meaning every single block there has to be looked at. Edit: You deserve this.
May i give you a small performance suggestion? rather use this Code: int ymax = player.getWorld().getHighestYAt((int)this.loc.getX() + x, (int)this.loc.getZ() + z); if ((int)this.loc.getY() + y >= ymax) { y = ymax - (int)this.loc.getY(); } if I'm right, that should skip all blocks that are air from the top of the map, and thus increasing performance Code: Location reference = player.getLocation(); int min = 0 - radius; int max = radius; Block middle = reference.getWorld().getBlockAt(reference.getX(), 0, reference.getZ()); int a = min; int b = 128; int c = min; boolean needNewB = false; while (c <= max) { Block cur = middle.getRelative(a,b,c); //perform your script stuff b -= 1; if (b <= 0) { a += 1; needNewB = true; } if (a > max) { a = min; c += 1; } if (needNewB) { needNewB = false; b = middle.getWorld().getHighestBlockYAt(middle.getRelative(a,0,c).getLocation()); } } Thats how I did my detector part in GrowingOre, the performance is very high due to it skipping unecesery blocks if i scan in a radius of 200 (thats 400x400x128 = 20m blocks), it will only take about 20 seconds which is really fast edit: however this will take all blocks in the Y instead of ... radius around you
hey! I would gladly use this plugin if a code like Streammz suggested is used. seeing as I am running my server on a comp with only 4gb of ram atm low cpu/RAM usage would be nice! but for now I use a client mod!
@Taco : Header is wrong, title is wrong (CB# must be at the very right hand side, [TAG] BlockDetect - Detect blah blah [CB#]), title tag must be uppercase ([ADMN/MISC]), there is no tag ADMIN, text color is wrong (Must be black for readability), adfly is banned so remove your adfly link, download section should be at top, preferrably second or third in list. #740 inactive, test against latest RB.
Since I've got a few too many plugins, and this one is fairly simple. I am going to leave the source of this up for download and leave this for people to learn from. The source is next to the download.