[INACTIVE][SEC] OwnBlocks v10.0 - Players may not break blocks placed by others [860]

Discussion in 'Inactive/Unsupported Plugins' started by cvenomz, Apr 19, 2011.

  1. Offline


    Version: v10.0

    (7-10-2011) - Please see the latest branch of OwnBlocks, called OwnBlocksX. It is recommended you use OwnBlocksX now.

    OwnBlocks keeps track of placed blocks, and who placed them. Players are not allowed to break blocks placed by other players. Note however, that indirect breaking may still occur (i.e. fire, tnt).

    • Blocks you place cannot be broken by others
    • Persistence; Server remembers who owns what blocks after a restart or "reload"
    • Toggleability! Use /ownblocks or /ob to toggle OwnBlocks on and off
    • Ability to exclude certain blocks from being protected
    • Support for Permissions AND non-Permissions servers
    • Auto-saving intervals for database protection
    • Add (pre-placed) blocks to the database manually
    Download OwnBlocks v10.0

    please note - If you are using iConomy, only version 4.6 is currently supported.

    Source Code
    OwnBlocks is released under the WTFPL License.

    Config File Options:
    Please note that at any time you may move/rename/delete you config file, and restart your server to produce the example/default config file with these options pre-filled along with descriptions. Also remember that lines preceded by a '#' are comments, and are ignored.
    exclude - enter comma separated integers of block-ids you wish to exclude from being protected and entered into the database. An example would be to enter the block-id for saplings, so planted trees do not have a single log at the bottom that is protected when a tree is harvested by another player.
    iConomy - enter an integer greater than '0' (zero) to enable. The number entered becomes the 'Basic Rate' at which players are charged to place protected blocks. Players will not be able to place blocks if they have insufficient funds.
    debug - If you are experiencing errors, and want to post them here to resolve them, or just want to spam your server log with information, set debug equal to 'true'
    status-message - Set this to 'disable' to not receive the message "[Username] - OwnBlocks is now activated for you....". Set this to 'simple' to receive a simple "OwnBlocks activated/deactivated" instead. Lastly, set this to 'disable' to disable messages entirely. Now that I think of it, disabling status-messages seems like a really bad idea......but the choice is yours.
    save-interval - Enter the number of seconds specifying the interval between database saves. The default is 60 seconds. Increase this number if you have an obscenely large database that takes a long time to write to disk. Decrease this number if you are paranoid and/or have very fast disk IO.
    info-id - Enter the integer representing the ID of the material or tool you would like to use as your "information tool" which will display the Owner of a block you right click with specified tool. Default is 269, which is the wooden shovel.
    add-id - Enter the integer representing the ID of the material or tool you would like to use as your "add tool" which will add the block you left click with the tool to the database. Default is 268, which is the wooden sword.
    enabled-on-login - True means that OwnBlocks is automatically activated for every player as soon as they log in. False means that OwnBlocks must be activated manually by each player when they want to start building protected blocks.

    Permissions Nodes:
    You will need to add these nodes to your Permissions configurations if your server uses Permissions:
    'OwnBlocks.ignoreOwnership' - Allows player to break blocks placed by others. This node is typically given to admins.
    'OwnBlocks.use' - Allows a player to even use OwnBlocks. If you want everyone to be able to protect blocks with OwnBlocks, and assuming you have a "normal" Permissions configuration, then add this node to your "default" class.
    'OwnBlocks.info' - Allows a player to use the info-tool to display who owns a protected block.
    'OwnBlocks.add' - Allows a player to use the add-tool to add blocks to the database for protection.

    • Version 10.0 (5-20-2011)
      • Added configuration to set whether OwnBlocks is activated for players upon login
      • Added tool to add pre-built blocks to the protection database
      • Improved process of saving database
      • Fixed status-message configuration options (inconsistent verb tense)
      • Default to protecting all blocks when Permissions is not detected
    • Version 9.0 (5-5-2011)
      • Added support for Servers without the Permissions plugin
      • Added 'OwnBlocks.use' and 'OwnBlocks.info' nodes
    • Version 8.2 (5-4-2011)
      • Fixed NullPointerException when right clicking with empty hand
    • Version 8.1 (5-4-2011)
      • Added ability to use tool to display who a block belongs to. use info-id in your config file
    • Version 7.0 (5-3-2011)
      • Added database auto-saving intervals
      • Added ability to enable/disable 'status message'
    • Version 6.5 (4-29-2011)
      • Added iConomy support for charging a basic rate for each block placed
      • Added config option for debug mode
    • Version 5.0 (4-23-2011)
      • Added Permissions Integration :)
      • I think I fixed a bug that occurred when the 'reload' command is issued
    • Version 4.0 (4-23-2011)
      • Added properties file (/plugins/Ownblocks/OwnBlocks.properties)
      • 'exclude'
      • Blocks are now removed from database when broken by their owners
    • Version 3.0 (4-22-2011)
      • Added the ability to toggle OwnBlocks on and off
      • Added commands: /ownblocks or /ob
    • Version 2.0 (4-21-2011)
      • Moved data directory from main folder to the plugins folder
      • Added/fixed serialization (Persistence)
      • Made database searching more efficient
    • Version 1.0 (4-20-2011)
      • Initial Testing Release
    ToDo: Should there be continued interest in this plugin, I will consider looking into:

    • MySQL support
    • Support for group projects
    • Add configuration option to prevent "adjacent construction", where a player builds blocks on blocks owned by another player
    • Add support for Metadata values
    • Area Selection
    • Update this iConomy shenanigans.
    • Look into solution for chest protection
    • Add command to check the database for blocks that have become air because they were deleted externally by something like WorldEdit
  2. Offline


    rename your old one and restart bukkit. It will generate the new default.
  3. Offline


  4. Offline


    Since there were no screams of terror, corruption, or incompatibility, I updated the original post to v10.0
  5. Offline


    It only regenerates a new config if the Database.db is not present or renamed, I would consider this a bug really, as anyone updating would not want to have to remove/rename their database just to update their config file.
  6. Offline


    awesome. tips: can you try to write date on when the release of the newest updates are made: v10 - 21.05.2011 (exampel) =) then i know if i missed an update! :) Thank You! Awesome Work Keep it up! ^^
  7. Offline


    Could you make so that when normal users try to break other players block, they get a message that the block is protected by {username} ??

    Nice plugin btw :)
  8. Offline


    Ill double check that, because it isnt supposed to be that way.
    Thanks :) and I just added that to the changelog section. I am using the backwards American date format though. (if there is a general consensus to format it another way, ill do so)
    Thanks :] I could. The reason I didnt make it that way was because I wasnt sure whether server admins would want to restrict the ability to see who owns what blocks to only those players who have OwnBlocks.info
    What do people think about this?
  9. Offline


    This plug-in would be AMAZING if it also listed blocks that are touching blocks that were modified by a player as their's. (I dig a hole. All the blocks that are touching the blocks that I modified to make the hole are now mine)
  10. Offline


    I think with OwnBlocks.info you have sufficient ability to see who owns what blocks. I like to be able to keep the ownership secret if I like and only allow admins to see who owns the blocks.
  11. Offline


    Seems my OwnBlocks has stopped working and calls an error when i start the server. Server runs but OwnBlocks randomly has stopped working.. Nothing has been changed on my server since it has worked fine for almost a month now.

    Edit now the server starts up without any errors.. and OwnBlocks seems to not even work. however the startup lines on sever say "08:55:25 [INFO] [OwnBlocks] Database read in from file"

    This is what i get when i try to use "ob" just to see if maybe i had it off or something.

    org.bukkit.command.CommandException: Unhandled exception executing command 'ob' in plugin OwnBlocks v8.2
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:85)
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:255)
            at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:675)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:638)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:632)
            at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
            at net.minecraft.server.NetworkManager.a(NetworkManager.java:195)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:74)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:370)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:285)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    Caused by: java.lang.NullPointerException
            at me.cvenomz.OwnBlocks.OwnBlocks.togglePlayer(OwnBlocks.java:178)
            at me.cvenomz.OwnBlocks.OwnBlocks.onCommand(OwnBlocks.java:198)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
            ... 12 more
    Like i said it has been working perfect for a while..
  12. Offline


    What version of craftbukkit are you running? Also, you are running OwnBlocks version 8.2. Have you tried v10.0 to see if it fixes the problem?
  13. Offline


    2011-05-23 21:53:30 [SEVERE]     at java.io.ObjectInputStream$BlockDataInputStream.readFully(Unknown Source)
    2011-05-23 21:53:30 [SEVERE]     at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
    2011-05-23 21:53:30 [SEVERE]     at java.io.ObjectInputStream.readSerialData(Unknown Source)
    2011-05-23 21:53:30 [SEVERE]     at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
    2011-05-23 21:53:30 [SEVERE]     at java.io.ObjectInputStream.readObject0(Unknown Source)
    2011-05-23 21:53:30 [SEVERE]     at java.io.ObjectInputStream.readObject(Unknown Source)
    2011-05-23 21:53:30 [SEVERE]     at java.util.HashMap.readObject(Unknown Source)
    2011-05-23 21:53:30 [SEVERE]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2011-05-23 21:53:30 [SEVERE]     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    2011-05-23 21:53:30 [SEVERE]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    2011-05-23 21:53:30 [SEVERE]     at java.lang.reflect.Method.invoke(Unknown Source)
    2011-05-23 21:53:30 [SEVERE]     at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
    2011-05-23 21:53:30 [SEVERE]     at java.io.ObjectInputStream.readSerialData(Unknown Source)
    2011-05-23 21:53:30 [SEVERE]     at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
    2011-05-23 21:53:30 [SEVERE]     at java.io.ObjectInputStream.readObject0(Unknown Source)
    2011-05-23 21:53:30 [SEVERE]     at java.io.ObjectInputStream.readObject(Unknown Source)
    2011-05-23 21:53:30 [SEVERE]     at me.cvenomz.OwnBlocks.OwnBlocks.onEnable(OwnBlocks.java:84)
    2011-05-23 21:53:30 [SEVERE]     at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:127)
    2011-05-23 21:53:30 [SEVERE]     at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:676)
    2011-05-23 21:53:30 [SEVERE]     at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:249)
    2011-05-23 21:53:30 [SEVERE]     at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:131)
    2011-05-23 21:53:30 [SEVERE]     at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:109)
    2011-05-23 21:53:30 [SEVERE]     at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:218)
    2011-05-23 21:53:30 [SEVERE]     at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:205)
    2011-05-23 21:53:30 [SEVERE]     at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:145)
    2011-05-23 21:53:30 [SEVERE]     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:260)
    2011-05-23 21:53:30 [SEVERE]     at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    Getting this error on load 10.0 with Bukkit 766.
  14. Offline


    The idea here is amazing! This seems a million times less complex than WorldEdit and WorldGuard, but since I have those already installed and other plugins that require them, I am forcing myself to learn them. Keep up the good work!
  15. Offline


    It dont work more on my Hosting server:S
  16. Offline


    Is this bug reproducible? Do you already have a Database.db file? Was it corrupted the last time you tried to save it? Is there any way the user account used to start your bukkit server doesnt have read and write permissions to the plugins/OwnBlocks directory?

    This provides no information regarding the problem you are having. I can't try to fix it if I dont know what it is.
  17. Offline


    I was wondering if you had plans to integrate this into WorldEdit so that we can select a region and then set all the blocks within the region to be protected instead of having to click each one. I'm talking about already existing blocks if you don't know. It'd be awesome just to select two opposite corners of a house and have a command to protect all the blocks that aren't air.
  18. Offline


    Hi great plugin you make here)) keep good work)) but TNT still a problem)) it blow up blocks even if they "protected"....and flameble blocks(like wool or wood) are burn down to no mater what....
    Well on my server i solved TNT\fire problem buy turning off TNT block dmg effect and fire burning blocks....
    So it be really cool that you include TNT\fire resistance to nex ver )
    Again ty for great plug)
  19. Offline


    It woud be nice if you could make so that in the config you can configure an message that the normal users get when they try to break an protected block that is places by an other player. Exempel message:
    "This block is protected by *Username*
    If this block is on your property, contact admin/mod"

    or something similar :)
  20. Offline

    Dr Danco

    I appreciate your work here I've been looking for this exact plugin for a long time now.
    If i could make a request/suggestion that, please please please add worldedit functionality! lolz when i lay down blocks with it they arent protected :(
    any way other than that, perfect plugin. Thanks :D
  21. Offline


    Any chances u get iConomy 5.0.1 support?? I'm using some plugins on my server which relay on iconomy and when I use 4.6 they all bug out. For me it's kinda like - either use iconomy for other plugins or use it for ownblocks. I rly like the functionality that u have to pay for protecting your blocks but erm - think u should update the support to the newest version :)
  22. Offline


    I'd like to add this, but I dont know how I would logistically program something like this.
    Yup, OwnBlocks only protects against players breaking your blocks directly. I was considering adding an option for this at one point. Not sure if I will get to it.
    I was thinking of adding this option earlier. Hopefully Ill get around to it.

    Yeah, this has to do with the way WorldEdit makes/places blocks. Not sure how I would add this feature yet.
    Yes, I wanted to update to iConomy 5.0.1, but it threw all these compile errors when I tried. I will try again eventually.
  23. Offline


    There are two big things holding me back from getting this plugin. I dont know how easy they would be to add though. Anyways, here are my two requests:

    First one would be the ability to add a player to someones protected areas via a command. Like say two friends join and want to build together. Both of them would add each other to a friends list through a command like /ob addfriend <name>. Also a /ob removefriend <name> would have to be added. This is very important for me as I have quite a few groups that come by. If I had the plugin on, they would have to build separate homes and would leave my server because they couldn't build together within a sense. It's just not practical to share a house that you cannot fully edit.

    Second addition that would put icing in the cake is limiting the number of protected blocks a user has. Not only would it prevent greifing, it would also reduce the size of the database holding all the blocks. The config would naturally handle it. The idea being that if someone goes beyond 50,000 (that's not a very realistic number though, but gives you and idea) blocks that it would force them to go into a non protected status. Adding on top of that, there would be a call for permissions to handle overrides and if you want to get fancy, use permissions to configure different values for protection at different ranks.

    This has been requested, but I feel is also a good investment, is having a small cube of protection so that people cannot build right up on someone elses block. Another minor idea I had was to have a command that could reclaim a user names protection and turn it into public space once more. But this is minor as I suppose one could just delete a user's entry data in the plugin files and reload the plugin.

    I have some other minor ideas, but this is what I feel is the most important. If you can add the first two, I'd love you long time and become and avid supporter and user of this plugin if it helps you sleep at night. Sorry for the wall of text.
  24. Offline


    Can you make this multi-world with a separate DB for each world? I want to combine 2 servers and this would help greatly!

    Also, what if you made this plugin split up the world into areas and each area would have it's own db. This would stop lagging in other areas of the world, but I'm just thinking out loud and this may cause more lag lol.

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


    You should add mysql support, group system and message when broken: This block is owned by PLAYERNAME...
    My opinion

    This plugin is very handy on my server which has a big load of traffic and players.
  26. Offline


    how to edit database.db file?
  27. Offline


    Love the plugin but I would really appreciate the support of worldedit regions, I'd like to be able to select a region of blocks and assign them to a user, so I can go back and protect old structures pre OwnBlocks. Like select a world edit region, then run a OB command, like ob addowner username and all the blocks within the region would be added to the database as placed by that user. That is my ultimate wish. Would this be possible or is it too painful?

    Or maybe just select //pos1 and //pos2 and run the command.

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


    do u have to update this to 818, or is it ok to already use it?
  29. Offline


    @starcraftjunkie Thanks for the ideas and feedback. The only concern I have with the block limit is the fact that there currently is no way to un-protect blocks except for breaking them and rebuilding them while OwnBlocks is not enabled. I agree with you about the building together thing.

    @silenceheaven Multiworld would get interesting. I would have to re-write a lot of code. Maybe such a feature would be more
    realistic to add if I ever add MySQL support.

    Thanks for your vote about the "block owned" message. I am also starting to consider MySQL more seriously now. I may try to add support for it.

    For better or worse, this is not possible through manual edits. All edits must be made through the plugin.

    Adding something like this is possible, however, there are plenty of other plugins that specialize in zone protection. I do suppose OwnBlocks could be given that functionality though.

    Ill be perfectly honest. Half the time I just edit the darn number to whatever the latest is, and then do a double check sometime later. Here's the gist: generally speaking, the things they change from each version to the next are not things that OwnBlocks interacts with; and if they are used by OwnBlocks, then these new updates dont 'break' OwnBlocks. So in short, everything should work fine. However, I would definitely recommend that you always make a backup just in case.

    If I were a server admin who used OwnBlocks and I knew what I know now, as the developer of the plugin, I wouldn't give a rat's ass what the number says; I would just assume it works. I kinda feel like its just there for reassurance purposes. Lol. :)
  30. Offline


    lol, i use to do that, then one plugin, (still havent found out) crashed my server XP, i started a new one though, the update between 1.5~1.6 was pretty big :p
  31. Offline


    Just waiting on an iConomy 5 version.

    But what I really need to say, is for you to puh-lleeeeze, not compile your plugin against Permissions 3.0. It's a headache in a handbasket, and will only slow down your progress.

    That, and, is there a way to ensure that when a user destroys a block they've protected, they have to pay to protect it again? If that's already the case, then don't mind me and the question. Haven't been able to implement the plugin and know. :(

Share This Page