[MECH] SimpleBlock v0.4- Disallow certain people to place certain blocks [1.0.1-R1]

Discussion in 'Inactive/Unsupported Plugins' started by Rahazan, Oct 28, 2011.

  1. Offline


    <Edit by Moderator: Redacted bit url>

    This plugin allows one to disallow a person with a permission to place the block specified in said permission. One might, for example, want to have a railway specialist be the only one to be able to place railroad blocks.

    This is a plugin that contains less than 50 lines and is part of codename_B's under 50 challenge.

    How to use:

    Example permission node:
    This disallows the person or group to place dirt blocks.

    To override this, give a person or group:


    * A new-age permissions plugin. PermissionsBukkit for example.


    * Easy to configure.

    * Extremely Lightweight.


    * <Edit by Moderator: Redacted bit url>

    Show Spoiler
    How does it help my plugin?
    Plugin-wise, in absolutely no way.

    Then why on Earth would I donate?
    Time and effort was put into this plugin. Maybe this plugin makes your life easier, gets your server more players or simply makes you and the players have a good time.
    How do I donate?
    You can donate through PayPal. If you do not have the means to do so, you can also "donate" by showing your appreciation in the form of a nice comment. These donations and comments keep me motivated. Oh, and it keeps me alive in this overpriced studentroom I live in. It means the world to me.

    Thank you for reading this.

    Version 0.4
    * Updated for CB 1.0.1-R1.
    * Added support for 326 and 327 (water and lava buckets, respectively).

    Version 0.3
    * Updated for CB #1542.

    Version 0.2
    * Added override function.

    Version 0.1
    * Initial release.

    Any feedback is more than welcome!
    Last edited by a moderator: Feb 20, 2017
  2. Offline


  3. Offline


    Does it work with WaterBuckets and LavaBuckets?

    Cause for me it doesnt :C
  4. Offline


    No, because these are not placed blocks.

    If you wish I can add this.
  5. Offline


    Please!@! lol

    And also I dont know if this is your fault, or Bukkit Permission, but here we go.

    On default rank i put:
    simpleblock.8: true

    on Member Rank I put:

    simpleblock.8: false

    So member should be able to put down Water and not Default right?

    But this wont work...

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


    That's caused by the way BukkitPermissions works. I think you're best of looking in their thread or googling about.
    You need to, somehow, have one of the two permissions to be more important than the other.

    EDIT: Hang on, I'm working on something

    If you re-download,
    you can now give your member simpleblock.override.8
    This will cause that group to be able to do so :)

    I have not tested this, but I foresee no problems whatsoever.

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


    Ty man, Ill test this soon
  8. Offline


    Any luck?
  9. Offline


    Updated for CB #1542 :)
  10. Offline


    Unless you add 327 and 326 this plugin is just a waste of space. The 2 most important things to block are Lava and Water with a bucket. If you add this to your plugin it will be very useful. Having that set on permissions would be very nice.
  11. Offline


    Have you added the ability to block Water and Lava Blocks yet. When you do I will donate to your plugin. My Server Donates to all Plugins that we use.
  12. Offline


    @Maxxgold Added what you have requested.

    Version 0.4

    • Updated for CB 1.0.1-R1.
    • Added support for 326 and 327 (water and lava buckets, respectively).
  13. Offline


    My users can still use 327 and 326 while using this. I'm using CB 1597 and I use Group Manager for permissions.
  14. Offline


    Hmm, I am using PermissionsBukkit for permissions, but that shouldn't matter.
    Could you ensure that
    - The group or user actually has/have or inherits simpleblock.326: true
    - The group or user does not have (or inherit) simpleblock.override.326: true
    - The user that is testing this is not an OP (inherits all permissions).
    - The version you are running is 0.4 (/version SimpleBlock ingame or open SimpleBlock.jar and open the plugin.yml)
    - The other blocks are working (for instance, simpleblock.3 for dirt)
  15. Offline


    Yeah the group has simpleblock.326 and 327
    No groups have simpleblock.overide
    User does not have OP
    I cant see the version number anywhere. I just used the direct download link
  16. Offline


    It seems dropbox is down :confused:, you may not be using the last version, please make use of this <Edit by Moderator: Redacted mediafire url>
    Last edited by a moderator: Nov 12, 2016
  17. Offline


    Could you PLEASE make a BukkitDev page so we RB 1337 users can download older versions of this? Thanks!
  18. Offline


    Hey there,

    I kinda stopped using BukkitDev, I suck at making the layout for a plugin there. Also, it's a lot of work to keep both the forums and BukkitDev up to date. Especially with this many plugins I try to keep up-to-date :/. I believe I maintain the most plugins at the moment out of all of the plugin devs..
    I have a hard time keeping all the plugins up to date, and I feel like I am giving people with feedback the impression I'm not open to their ideas..

    Also, the forums grant one I'd say, at least 400% more views and downloads unfortunately..
    If anyone feels like documenting my plugins on BukkitDev, please do step forward :). This job consists of creating the layout for the plugins and keeping them up-to-date with the forum (the text-page).

    Regarding the CB#1337 version, I tend to overwrite my old versions. A bad habit, I know. I'm pretty sure a plugin dev like you can compile it for the required CB version, the source is only 40 lines long anyway ;). Despite the new features, it's still part of the <50 lines challenge.

    Here's the source
    1. package me.rahazan.simpleblock;
    2. import java.util.logging.Logger;
    3. import org.bukkit.Material;
    4. import org.bukkit.event.Event;
    5. import org.bukkit.event.block.BlockListener;
    6. import org.bukkit.event.block.BlockPlaceEvent;
    7. import org.bukkit.event.player.PlayerBucketEmptyEvent;
    8. import org.bukkit.event.player.PlayerListener;
    9. import org.bukkit.plugin.java.JavaPlugin;
    10. public class SimpleBlock extends JavaPlugin {
    11. @Override
    12. public void onEnable() {
    13. getServer().getPluginManager().registerEvent(Event.Type.BLOCK_PLACE, new blockListener(), Event.Priority.Highest, this);
    14. getServer().getPluginManager().registerEvent(Event.Type.PLAYER_BUCKET_EMPTY, new playerListener(), Event.Priority.Highest, this);
    15. Logger.getLogger("Minecraft").info("[SimpleBlock] by Rahazan loaded.");
    16. }
    17. @Override
    18. public void onDisable() {
    19. Logger.getLogger("Minecraft").info("[SimpleBlock] by Rahazan unloaded.");
    20. }
    21. }
    22. class blockListener extends BlockListener {
    23. public void onBlockPlace(BlockPlaceEvent event) {
    24. if (event.getPlayer().hasPermission("simpleblock." + event.getBlock().getTypeId())
    25. && !event.getPlayer().hasPermission("simpleblock.override." + event.getBlock().getTypeId())){
    26. event.getPlayer().sendMessage(org.bukkit.ChatColor.DARK_RED + "You are not capable of doing this.");
    27. event.setBuild(false);
    28. }
    29. }
    30. }
    31. class playerListener extends PlayerListener {
    32. public void onPlayerBucketEmpty(PlayerBucketEmptyEvent event){
    33. if ((event.getPlayer().getItemInHand().getType() == Material.WATER_BUCKET || event.getPlayer().getItemInHand().getType() == Material.LAVA_BUCKET)
    34. && event.getPlayer().hasPermission("simpleblock." + event.getPlayer().getItemInHand().getTypeId())
    35. && !event.getPlayer().hasPermission("simpleblock.override." + event.getPlayer().getItemInHand().getTypeId())) {
    36. event.getPlayer().sendMessage(org.bukkit.ChatColor.DARK_RED + "You are not capable of doing this.");
    37. event.setCancelled(true);
    38. }
    39. }
    40. }
  19. Offline


    I just compiled it for CB 1337. Thanks for the source!
  20. Offline


    This still doesn't block users from picking up lava with a bucket. It says they can't do it but if you keep clicking on the lava eventually it gives it to you
  21. Offline


    That's because it doesn't blocks what users can pick up. It prevents the placement. If you would just look at the source, you could easily read, even if you're not a dev, onPlayerBucketEmpty.
  22. Offline


    Duh. Thanks for assuming something. I have those blocks restricted. If your not a moron you could have easily not assumed that I didn't know that.
  23. Offline

    Mista Epic

    How exactly do I use this? :l
  24. Offline


    What exactly do you not understand of the instructions in the opening post?
  25. Offline

    Mista Epic

    It won't work?

    I use /permissions player setperm havealaugh ( my friend who blows everything up. -.- ) Survival.simpleblock.46 true
  26. Offline


    This plugin is great! I'm using it to stop people from placing lava, water and TNT. Can you make the message configurable or compile it for me with the message set to "Please ask an admin to do that." I can see how to change it, but I don't know how to compile.
  27. Offline


    Your plugin really help my server! I have a multiworld setup with a rank system, so this plugin has helped me customize what poeple can do in the different ranks.

    There was no trouble installing and configuring it at all, i have no idea what Maxxgold's problem was.

    I have a request though. In 1.1 we got mob eggs, and i really want to continue using this plugin and NOT have my creative world swamped with creepers and other mobs. Can you add them to the plugin? It would help me a lot!
  28. Offline


    Pleeeease update it!
  29. Offline


    You could try out my iBlock plugin.
    It's basically the same but instead of 'simpleblock.<id>', it's changable in the configuration.
  30. Offline


    Can you make iBlock become SimpleBlock? Because I think iBlock is harder to be use. Better use simpleblock style.

Share This Page