[ADMN/MISC] BlockDetect - Detect unseen blocks! [860]

Discussion in 'Inactive/Unsupported Plugins' started by Taco, Mar 22, 2011.

  1. Offline

    Taco

    BlockDetect
    This 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
     
    Noppoly likes this.
  2. Offline

    AgentKid

    Cool plugin, been thinking about requesting this for awhile :p Feature request:
    Points compass toward closest result.
     
  3. Offline

    Taco

    Interesting idea, I may add that.
     
  4. Offline

    Waffletastic

    Nice release Taco
     
  5. Offline

    AgentKid

    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 :p

    Other than those 2 issues, though, I love this plugin :D Found this just now, ended up in the lava :(
     
  6. Offline

    Taco

    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.
     
  7. Offline

    AgentKid

    Okay, thanks :D
     
  8. Offline

    Taco

    Should be all fixed up now. Thanks for testing it!
     
  9. Offline

    Taco

    Le bump in hopes to get this moved to releases.
     
  10. Offline

    Taco

    612 update/le bump.
     
  11. Offline

    ChaoticTrack

    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...
     
  12. Offline

    Taco

    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.

    [​IMG]
     
  13. Offline

    Plague

    @Taco please update the thread to latest recommended build (and add description to the title)
     
  14. Offline

    Taco

    Done, thanks for the reminder.
     
  15. Offline

    Taco

    Cleaned up the post and added a .jar download.
     
  16. 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
     
  17. Offline

    Devian50

    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!
     
  18. Offline

    Juze

    @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.
     
  19. Offline

    Taco

    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.
     

Share This Page