[MECH/RPG] Toolblock v.2.4 - Require the right tools for the job! [1000]

Discussion in 'Inactive/Unsupported Plugins' started by ktccd, Jun 20, 2011.

  1. Offline

    ktccd

    Toolblock - Tools are a requirement!
    Current version: 2.4

    Does not require Permissions, but works with it.

    This plugin makes it a requirement to use the right tools for the right blocks, simple as that!
    No longer will players be able to knock down walls with their bare hands, or chew through obsidian walls with a measly iron pick!

    Customisable config file!
    If it can not find a config file, it'll generate one, but the format goes like this:
    <block to deny breaking>: <item to hold to break> <another item to hold to break>
    The names are the material names of items and blocks, so for smoothstone I'd for example use:
    Code:
    STONE: IRON_PICKAXE WOOD_PICKAXE STONE_PICKAXE DIAMOND_PICKAXE GOLD_PICKAXE
    LOG_1: IRON_PICKAXE
    
    To use the datavalues, like only stone steps or only affecting wood steps, simply add _# to the block name, where # is the datavalue. For all datavalues, you can ignore using _# and just use the block name.
    I used the Material names from bukkit, found here (LINK) and the datavalues from minecraft wiki, found here (LINK).

    Current features:
    * Stops players from breaking blocks without the right tools
    * Supports permissions, override the plugin with "toolblock.override"
    * Supports different damage values (birch, redwood etc)
    * Configurable message upon using the wrong tool, as well as a configurable damage.

    <Edit by Moderator: Redacted mediafire url>
    Source

    Changelog:
    * V2.4
    - Added a second config file, with a message and a damage. If file is not found, it makes one with a default message and 0 damage.
    * V.2.3
    - Made the support work on all damage values (i e, all kinds of blocks with different types)
    - Updated to RB 1000, using the latest stable bukkit.jar as well

    * V.2.2
    - Added support for different kinds of logs, steps and doublesteps.
    * V.2.1
    - Removed logging on every block break. Was great on my own, must've been horrible with more people ^^.
    * V.2.0
    - Added, with some help from #devbukkit and especially winsock, customisable block denial!
    * V.1.1
    - Added captainawesome7's suggested code for permission checking
    * V.1.0
    - Release!

    Planned features:
    * Datavalues for the items to break with
    * Permissions per block to break, configurable node names

    Feedback, suggestions and such is welcome, I'll try and check back here every day or so ^^.
     
    Last edited by a moderator: Nov 27, 2016
  2. Offline

    captainawesome7

    @ktccd To make permissions not a requirement, put something like this:
    Code:
        private boolean UsePermissions;
        public static PermissionHandler Permissions;
        private void setupPermissions() {
            Plugin test = this.getServer().getPluginManager().getPlugin("Permissions");
            if (this.Permissions == null) {
                if (test != null) {
                    UsePermissions = true;
                    this.Permissions = ((Permissions) test).getHandler();
                    System.out.println("[SimpleReplace] Permissions system detected!");
                } else {
                    log.info("[SimpleReplace] Permission system not detected, defaulting to OP");
                    UsePermissions = false;
                }
            }
        }
    And keep setupPermissions() in your onEnable, and then just make a method like this:
    Code:
        public boolean canUseReplace(Player p) {
            if (UsePermissions) {
                return this.Permissions.has(p, "simplereplace.replace");
            }
            return p.isOp();
        }
    That makes it so that people can use permissions if they want to, otherwise it reverts to OP
     
  3. Offline

    ktccd

    Yeah, that's a better way to revert to OP than the one I thought of XD. Thanks man, I'll make this in v.1.1. (Tomorrow or so, it's 1am here now XD).

    There, updated with permissions independence :D.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  4. Offline

    Danjio

    looks great but it don't work for now :eek: or is it because i'm admin? :p
     
  5. Offline

    ktccd

    Admin, with default permissions, have the permissions '*', which means ALL permissions.
    Check the logs, they should say it lets you override whenever you break a block you shouldn't have.
     
  6. Offline

    Danjio

    i have no folder for toolblock :eek:
     
  7. Offline

    ktccd

    Hmm? By logs I mean the command-screen from bukkit ^^. I use a logger to display the info.
    Also, working on the listed feature. It's turning out to be quite a lot harder than I thought, but I'm getting there and learning lots ^^.
     
  8. Offline

    ktccd

    I'm not going to finish the next update today or tomorrow, got to much IRL stuff to do >_<.
    Hopefully the weekend will bring some more time to work on it ^^.
     
  9. Offline

    ktccd

    2.0 released! THANKS winsock! You're a lifesaver man ^^.
    (Also, all the other guys on #devbukkit as well, I got some nice help there too :D)

    Github also updated now ^^.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
    WinSock likes this.
  10. Offline

    Zetal

    Will you be continuing to update this? I get an error when the plugin is loaded, about it not being the correct version.
     
  11. Offline

    ktccd

    Hmm, could you post the error? I got an idea what could be the issue though XD.
    Also, I will continue to update this, I think it's too cool an idea to just leave ^^.
     
  12. Offline

    shot2400

    could u make a way to specify how long a tool has to live? like make the wooden pickaxe only able to mine 5 blocks total before it breaks. it would be really helpful in an adventure game to make certain tools last only so many blocks so you can base the dungeon off of it. THANKS!

    Edit: i really havent tried this plugin yet but i need to be able to change the life of the tool AND this plugin to get where i need. so changing that would be amazing!
     
  13. Offline

    ktccd

    That sounds more like a tool-changing plugin. This plugin simply makes only some tools work on some blocks. Changing the lives of tools themselves is an entirely different thing ^^. I think could do it, but it seems like something I'm sure someone else has done before :S.


    Also, @Zetal, would be great to have that error, I can't fix it otherwise I think ^^.
     
  14. Offline

    shot2400

    thanks for replying, i just took a look around and the only other types of plugins that people are making for tools are the "invincible" tool plugin and such. If you feel that it doesnt fit in with your plugin i understand, was just wondering if you could do that possibly. either way thanks for the consideration.

    EDIT: FYI i am only looking for bukkit plugins of course, i do run a small server so no one HERE has made what im looking for sadly.
     
  15. Offline

    Jonnyb42

    is there a way to disable the server INFO??
    everytime a block is destroyed is says "not listed, returning true" or false for whatever... i mean the console would be flooded with more players.
     
  16. Offline

    ktccd

    Ah, yeah, I think I'll reduce the logging ^^. Forgot some people run a server with 20+ people. Gonna remove logs and put them back in once I figure out how to make it configurable ^^.

    Also, the tool thing does sound interesting, but I think I'd rather make the a separate plugin if so ^^.

    If anyone wonders why I'm not updating right now, it's 'cause I can't work in this incredible heat >_<. That, and I'll go on a small trip soon, but I might be able to get some work done then :D.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  17. Offline

    nathanaelps

    This looks awesome. Can I set this up to behave differently on different worlds? I mean, does this have MultiWorld support?

    I'll make it work using Permissions for now, but it'd be cool if you couldn't break netherrack in the nether without a pick, but you could in the regular world, but have stone work the opposite.

    Thanks
     
  18. Offline

    ktccd

    Hmm, never tried multiworld support before, it could be fun to try ^^.
    (However, just got back from my trip, I'll spend tomorrow working out an update, 'cause I got 2 more plugins waiting in line for one as well XD)

    Updated, no logging on block-break. Will look into the multiworld thing for next feature actually, but got to get some work done on my other plugins right now ^^.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  19. Offline

    Astrum

    Hi Kt, will it be updated to 953 soon? (found this plugin awhile ago, and said this was just like you were talking about. Realized to day that you made it =D)
     
  20. Offline

    ktccd

    Ah cr*d, I knew I forgot something >_<.
    That's the new RB, right? I'll try and get that done today, should have some time ^^.
     
  21. Offline

    Astrum

    Yay! Thanks kt, keep up the good work.
    (also, if you have time, could you look at a [REQ] thread and see if you can/want to make it - Ill link it if your interested)
     
  22. Offline

    ktccd

    Too many projects man XD.
     
  23. Offline

    Astrum

    Ah well, thanks for replying!
     
  24. Offline

    compgurusteve

    Anyway to include block ID's in conjunction with the names? Or at least put out a valid name list? Don't know how to discern between wood slabs and stone slabs, ect.
     
  25. Offline

    ktccd

    Hmm, never thought of that >_<. I'll have to make that a more urgent TODO then. Right now the list is simply using the material names, I just assumed steps had different names for different types >_<.
     
  26. Offline

    compgurusteve

    IMHO Block ID's > names, but if you already have named them yourself you may as well put it in the default configuration with #before each block. If the person wants to use it they can just take the # out. You may as well go ahead and clarify the tools as well. :) I really have good use for this plugin but until that happens I just can't make heads or tails of it.
     
  27. Offline

    ktccd

    I'm not using my own names, that'd be SO SLOW to code XD.
    I'm using the bukkit Material (Which I believe is an enumeration), but I'll link the whole list for y'all to see them ^^. It's much easier to use than to make my own list, which would VERY likely also have been an enumeration anyway ^^.

    (Only annoying part was that ingame "Wood" was name LOG, which made me rage XD)
    Also, UPDATE!
    I tested this with the latest RB for 1.6.6, no problem and also added the support for those pesky steps, doublesteps, leaves and logs! Details above, but ask if you want to know something about it ^^.

    EDIT:
    Like, if there's some other block you want me to add datavalues for, it's easy to add.
    Might try and figure out how to make it decide on it's own.......................................................
    OMG... As I'm writing this, I figured out I could just remove the check for what block it is and test if you specified a special value anyway, since I DID make it not need them.... So stupid >_<. Will make that for the next update, when I'll preferably add a config for setting permissions to override the check on the blocks. Configurable permission nodes is the plan ^^.

    I'll see if there's a way to make Bukkit hand me a list of the Materials it uses and make the default contain them, since the Materials is an enum, I think it would be possible...
    Worst case scenario, it can't and I'll have to make it prepare a default config for you, but bear in mind that I'll have to be really bored to want to sit through every block and what tools you normally use on them ^^. Did it once already for first release, was SO boring XD.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  28. Offline

    compgurusteve

    :) can't wait for the update, thanks for the quick response. (btw did you mean 1.7.3? you said 1.6.6 above.)
     
  29. Offline

    ktccd

    It is for 1.6.6 ^^. I only code for the one I use, and my main RP server is stuck on 1.6.6 until permissions are fixed.
    (And IDK if I could update then, since I use permissions as well here and my next update will use it a lot more).

    So this is the updated version, but only for 1.6.6 so far.
    (We're planning on moving to 1.7 real soon though, so I'll likely update my plugins for it to be prepared)

    EDIT:
    Well, now that I think about it, I think I got the latest bukkit when I made this... I think it could work on 1.7, except I haven't made it use a newer version of permissions... Or tested it on later builds... I'll ask the admin for a probable date of update. If it's close enough, I'll update my plugins now and he can use them later when we update. We're updating once bukkit gets a RB for 1.7.3! :D
     
  30. Offline

    RogoOnThePogo

    I have been testing this on my 1.7 server for hours on end and it does not seem to work, so I eagerly await an update for 1.7.
     

Share This Page