Inactive [ADMN/SEC] WatchBlock v2.21 - Block Protection - [1.2.5-R4.0]

Discussion in 'Inactive/Unsupported Plugins' started by slade67, Mar 29, 2012.

  1. Offline



    PLEASE USE Bukkit - Dev

    WatchBlock is a high performing Block Protection plugin which protects each individual placed Block by saving it to a MySQL Database or to FlatFiles. This Project is greatly inspired by BananaProtect. It works basically the same but is only limited to Block Protection and not interfering with anything else and along side using a MySQL Connection. Since I did not want to loose any already protected blocks by BananaProtect I also wrote a importer for all the already placed Blocks which is working pretty well but of course depending on the number of files created takes a while. The Remove and Add of a Block to the database is placed in a queue and run in another Thread to ease the pressure on the main thread. However the Check if the Block is owned by somebody is handled directly in the mainthread to ensure the functionality. Also the bananaprotect import command is handled in a seperate thread however if you convert bananaprotect to the database it would make more sense to keep the server in maintance mode so nobody places blocks in the meanwhile. We are currently running this Plugin on our Server with 50 People and about 2,3 Million Blocks registered in the database partially imported Blocks from Banana Protect. So far it is running perfect for us. Just as a warning I am not sure how this Plugin will run with a 100+ Server, as I would suggest some good MySQL Tuning if you plan on a big scale usage like that. If your server is a bit slower or you dont have access to a MySQL Database no Problem just use the Flat File System.

    • Automatic Block Protection
    • Output of who placed the Block
    • Commands to allow/remove players
    • Threaded Insert and Remove of Blocks (Not Blocking Main Thread)
    • Great Performance
    • Multiworld support
    • Banana Protect import of Flatfiles
    • Admin can destroy any Blocks with Permission
    • Easy config, Easy Use
    • Exlcusion Blocks List
    • Toggle Protection off/on if not Needed
    • Protect Blocks above your Blocks as well
    • FlatFile support
    • Admin Tool
    • Import from SQL to Flatfiles and the other way around
    • Import BlockProtection Database to WatchBlock
    • Import OwnBlocksX Database to WatchBlock
    • Protection against Piston Movement
    • Water/Lava Bucket Protection
    • Locale - Messages can be changed to your language (FlatFiles only at the Moment)
    • The Fastest Live Block Protection Plugin outthere with MySQL or Flatfiles
    • WorldEdit support to easily Transfer owned Blocks or Protect old Blocks before using WatchBlock

    • none, either choose MySQL or FlatFiles!
    Admin Permission

    • watchblock.admin (To Destroy every Block)
    Permission Nodes

    • watchblock.protect (To start protection of Blocks you need to add this Permission Node to your group!!!!)
    • watchblock.transfer (needed to be able to use the /wtransfer command, ADMINS Please dont use this. watchblock.admin is what you need for transfer)

    • wallow playername (Allows the Player to destroy your Blocks)
    • wremove playername (Disallow the Player to destroy your Blocks)
    • wlist (Displays all allowed players)
    • bananaprotect-import worldname (import Banana Protect files for the specified world)
    • wtoggle on/off (turn on or turn off Block Protection)
    • wb-import sql-to-flat (will import all blocks from all available worlds to flatfile.. this will take some time!)
    • wb-import flat-to-sql worldname (worldname == Name of the World you want to import. Will import flatfiles to sql.. this will take some time)
    • wb-import bp-convert flat/sql filename <- choose either flat or sql whichever you want to import to, filename is the name of your BlockProtection Database file place the file in plugins/WatchBlock/
    • wb-import ownblocksx-to-flat (set config.yml Flatfiles:true and mysql.yml add your OwnBlocksX DB information)
    • wb-import oldsql-to-newsql You need to run this command ONCE when you are coming from 1.xx Version to 2.xx it will also cleanup old tables be careful!!
    • wb-import oldsql-to-flat (Will convert your old sql database to flatfiles Use this if you are paranoid about switching to v2.xx from v1.xx
    • wtransfer playername (Transfers the WorldEdit Selected Protected Blocks to the playername specified, Regular Users with permission node watchblock.transfer can only transfer their own blocks, Admins please use permission node watchblock.admin!!)

    • Ops and Admins with PermissionNode watchblock.admin are able to use the woodenshovel to see Owner of Blocks
    Installation & Configuration

    • Place WatchBlock.jar in plugins
    • if you want to use MySQL and do not already have the mysql connector for your server download here : and place it in your server folder/lib/
    • Start Server once and let it create config.yml and mysql.yml
    • open mysql.yml and edit your details for your Database Connection or config.yml and set to FlatFiles
    • start the server
    • if console shows errors please check your MySQL Configuration again
    • config.yml worlds can be disabled by setting them to false (you can also manually add worlds in case they are not found correctly)
    Import from other Plugins

    • BlockProtection
    • BananaProtect
    • OwnBlocksX
    • Switch between WatchBlock MySQL and FlatFiles with the built in Importers

    • on first start generated and should have all registered worlds and values set to true
    • you can also add worlds manually to config.yml in case multiverse didnt hook before WatchBlock
    • All worlds set to false will not be monitored at all!
    • FlatFiles - true/false enables or disables FlatFiles and automatically enables or disables MySQL
    • ProtectAreaAroundBlocks - Protect from placing blocks above your blocks
    • BucketGrief (if true prevent Bucket Griefs)
    • ProctectPistonMovement (if true prevents moving owned blocks with pistons)

    • this is pretty simple add the hexadecimal datavalue of the block you want to exclude from protection just like the first one i put in there
    • set the value to true if you want to exclude. values which are not defined will be protected. values defined and set to false will be excluded
    Please read before getting started !


    Within the mysql.yml is a setting for the poolsize. I suggest setting it as high as your player count is in order to guarantee that you are not running out of mysql connections if all of your players want to break a block at the same time. However keep in mind to also edit your max connections for your MySQL database in (i.e. /etc/mysql/my.cnf) and add a few spare connections for your other plugins/forums etc. This is just a suggestion though! If you are not to technical with MySQL Just use the FlatFiles

    • Very High Performance using the FlatFiles
    • MySQL Performance for Servers very high!

    • Please Report Bugs to Ticket Section
    Need a Feature ?
    • Let me know in the comments!
    Short Video


    - initial Release
    - fixed the Windows issue with the mysql connection driver (stupid me)
    - improved add queue and remove queue
    - improved empty queue
    - added world support from config.yml you can now disable specific worlds
    • added new command /wtoggle on/off to enable or disable BlockProtection
    • added in config.yml to Protect Blocks Above already placed Blocks
    • added Exlcuded Blocks list (its in HexValues so the regular Minecraft Data Values, Netherrack = 87 and so on)
    • added flatfile support (Config: Flatfiles to true turns off MySQL and enables flatfiles)
    • added permission node watchblock.protect without this node blocks wont be protected
    • added softdependency for Multiverse-Core so on new startup all worlds will be registered in newly created config.yml automatically.
    • bugfixes with new flatfile support
    • improvement on flatfile performance
    • admin tool
    • lots of small things
    • added import from sql to flat file and from flat file to sql
    • increased inserts and remove in SQL abit
    • smaller bug fixes
    • fixed a minor issue on flat file importer causing the folder not to be generated
    • very minor change. FlatFiles on new Config Creation now default. So Plugin works at first start.
    • added BlockProtection Converter use : /wb-import bp-convert flat/sql filename <- choose either flat or sql to import into flatfiles or sql, place your blockprotection db file in plugins/WatchBlock and change filename to the name of your db File (most credits go to Tjnome for the Converter)
    • fixed Windows XP bug
    • added Protection against Bucket Empty (so Lava or Water from all sides) use config : Bucket ProtectBucketGrief = true
    • added Protection against PistonEvents on own Blocks (nobody is able to use Pistons to move owned Blocks) Pistons: ProtectPistonMovement = true in config.yml
    • added default option flatfiles
    • The Bucket Event und Piston Event Protection is at the moment only for flatfiles. MySQL will come later sorry
    • added Full Piston Protection. It works even if Blocks placed between Pistons now.
    • added World Edit support to Transfer or Newly Protect Blocks in Worldedit selection (Water,Lava and Excluded Blocks will not be protected), Players can only transfer their own blocks if the have permission node: watchblock.transfer.
    • added new Commands : /wreload, /wtransfer playername (wtransfer needs permission watchblock.transfer or watchblock.admin don't use both! wtransfer only works with WorldEdit!!)
    • added Protection from Sticky Pistons
    • fixed wrong Text Messages
    • added on Player Login Event to toggle on Protection if it was previously turned off
    • Greatly redesigned MySQLwithout lying the new Database scheme is as far as I can tell the fastest Live Block Protection out there on a big scale
    • fixed allow issues for Piston and Bucket
    • fixed issue on using reload command if using flatfiles (still never use reload anyway)
    • added Piston and Bucket Protection to MySQL
    • added Importer from oldsql-to-flat, oldsql-to-newsql, updated the other importers they should import into the new database now.
    • fixed alot of minor things, which either were missing or wrong
    • loooots of Code Cleanup

    Project now on DevBukkit as well!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 24, 2016
    Luigimezzo, rossistboss and TheMaa like this.
  2. Offline


    does not work :
    05:04 PM [SEVERE] [WatchBlock] MySQL connection lost
    05:04 PM [SEVERE] java.sql.SQLException: No suitable driver found for jdbc:mysql:\\localhost:3306\minecraft
    05:04 PM [SEVERE] at java.sql.DriverManager.getConnection(Unknown Source)
    05:04 PM [SEVERE] at tk.minecraftopia.util.MySQLConnectionPool.getConnection( 

    my data in the database are correct
  3. Offline


    You would of course need to place the mysql connector driver in yourserver/lib/
    I will update the instructions too.

    Here is the connector:
    in the root of your server folder where the plugins folder is as well create a folder lib and place the mysql connector inside it.
  4. Offline


    nothing to do, I keep the plug already inserted, almost makes me this error when the server starts and 100%
    17:25:49 [GRAVE] java.sql.SQLException: No suitable driver found for jdbc:mysql:
    17:25:49 [GRAVE]        at java.sql.DriverManager.getConnection(Unknown Source)
    17:25:49 [GRAVE]        at java.sql.DriverManager.getConnection(Unknown Source)
    17:25:49 [GRAVE]        at tk.minecraftopia.util.MySQLConnectionPool.getConnecti
    17:25:49 [GRAVE]        at tk.minecraftopia.watchblock.WatchBlock.getConnection(

    17:25:49 [GRAVE]        at tk.minecraftopia.util.SQLQueue.addBlockQueueToDB(SQLQ

    17:25:49 [GRAVE]        at tk.minecraftopia.util.SQLQueue$
    17:25:49 [GRAVE]        at

    17:25:49 [GRAVE]        at Source)
    17:25:49 [GRAVE] java.lang.NullPointerException
    17:25:49 [GRAVE]        at tk.minecraftopia.util.SQLQueue.addBlockQueueToDB(SQLQ

    17:25:49 [GRAVE]        at tk.minecraftopia.util.SQLQueue$
    17:25:49 [GRAVE]        at

    17:25:49 [GRAVE]        at Source)
  5. Offline


    Well as stated above you do need the mysql driver connector so you need to place it correctly.
    yourserver/lib/ <----- place the mysql-connector jar

    The Error message you get is about no mysql driver found. <--- download and place in yourserver/lib/

    then stop and start your server again.
  6. Offline


    look :




    my db is "mine" mysql and open, and the password of the mysql and correct
  7. Offline


    Ok I figured it out please try this version
    Will upload to bukkit dev

    I just realized you are using Windows to start your server. Just had to change a line so correct path seperators are used.
  8. Offline


    now works correctly, thanks
    [INFO] [WatchBlock] MySQL connection established 
  9. Offline


    Thanks for pointing out the issue!
    Just as an information -> poolsize of 999 means that also your MySQL Server needs to accept that many connections if they are needed. I usually set MySQL config (my.cnf or my.ini) to MaxPlayerCount + 10 (for other plugins). This is just an advise. But make sure not to set the poolsize higher than what you have available.
  10. Offline


    If you want to improve, you do that when others support a cube on a cube protected, it does not make Eagle, so it would be nicer
  11. Offline


    I am not quite sure what you mean by that.
  12. Offline


    Please set permissions so only admins/ builders can have their blocks protected!
  13. Offline


    I can certainly add that, as well as the wb on/wb off feature to enable/disable block protected on the next set blocks.
  14. Offline


    sorry for my english, watch this video you should understand:
  15. Offline


    I think you mean to not protect Blocks of other People on top of your already placed blocks?
  16. Offline


    yes please fix , if you can, you can use the H2 as a database?
  17. Offline


    First its nothing to fix since its not broken at all, this is a feature you want. Second I can look into it but it wont be in the next release maybe in the ones after this.

    Next release will include the toogle for protection and maybe as well an importer for BlockProtection and OwnBlockx and most likely a flat file system support so You can choose between MySQL and flatfiles. And Permissions to not protect blocks from certain groups. (add the permission node to group to stop protection for them entirely )
  18. Offline


    plays should only have protected blocks if given a permission node, just makes more sense to me. If it was done the way you said it an admin would not be able to have protected blocks because he would have -'*'(all permission nodes)
  19. Offline


    You are absolutly right. Of course It has to be that way. And I will add the permissions for that.
  20. Offline


  21. Offline


    New Update to Version 1.3:
    • added new command /wtoggle on/off to enable or disable BlockProtection
    • added in config.yml to Protect Blocks Above already placed Blocks
    • added Exlcuded Blocks list (its in HexValues so the regular Minecraft Data Values, Netherrack = 87 and so on)
    Next Release Features (aprox. tomorrow)
    • Permission Node for Protection
    • WorldEdit support to change owner of an area (needs watchblock.admin)
    • Flatfile support besides of MySQL
    Future Release
    • Transfer your owned blocks (need worldedit selection) maybe with Vault to charge money too
    • Import for BlockProtection

    New Update to Version 1.4
    • added Permission Node watchblock.protect without this node no blocks will be protected
    • added flatfile support (in config set flatfiles to true, MySQL will be turned off)
    • added softdependency for multiverse, on new config.yml creation all worlds will now written to config.

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


    a little to heavy for my server, i will just go with something that logs the destroying of blocks!
  23. Offline


    try FlatFiles just look in the config and set flatfiles to true. Maybe its more suited for you server!

    New Update v1.7
    • fixed exclusion list for Flat Files now working correctly
    • added Admin Tool to check Block owner!

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


    Great plugin, all the features you need, quick and very easy to setup/configure.
    Recommend this plugin strongly!

    Quote from Slade.
    New Update v1.82
    • added import from flatfile to sql and the other way around (new command wb-import)
    • fixed some minor bugs
    • set default to flatfiles so you dont even need to configure anything to get start
    • increased inserts and remove in SQL abit

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


    New Update v1.83

    BlockProtection Importer -> Import your BlockProtection Database into WatchBlock see Bukkit Dev for more Information

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 24, 2016
  26. Great plugin, works as adverised, but is there a way a retore a destroyed sign's text?
  27. Offline


    New Update with cool Features v1.84
    • added Water/Lava Bucket Protection on all sides of owned blocks
    • added Piston Movement Protection. owned Blocks cannot be moved (both in config.yml can be seperately turned on/off)
    • Unfortunately the new Features are at the Moment only working with flatfiles, sorry MySQL will come later*
    @The Minecraft Guy
    Thats a feature LogBlock or Hawkeye do, I dont think I will be able to integrate that for now.

    New Update v1.85
    Fixed a bug with Pistons please update.

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


    non admins cant use this block protection what can i do that they can do it to.
  29. Offline


    add the permissionnode : watchblock.protect
    to each group you want to have protected blocks
  30. Offline


    hey, what u mea group?? i want normal players to use the protection to sorry im new in craftbukkit dont know anything ;d

Share This Page