Inactive [SEC] CustomBlockRestriction v1.4.2 - Total control over block placement and breaking [1000]

Discussion in 'Inactive/Unsupported Plugins' started by Randy Schouten, May 2, 2011.

  1. Offline

    Randy Schouten

    CustomBlockControl - Total control over block placement and breaking
    Version: v1.4.2

    Did you even want to restrict blocks that are not pre-defined in the plugin?
    Then this plugin is for you!

    Type whatever block you wish to restrict in the config file, and CustomBlockRestriction will automatically make a permission node for it.

    Features:
    • Permissions enabled
    • Restrict any block and/or item you want
    • Automatically creates a permission node
    Download:

    http://dl.dropbox.com/u/2485556/CustomBlockRestriction.rar
    http://dl.dropbox.com/u/2485556/CustomBlockRestriction.zip

    Check the new config file before switching over to v1.4!

    How to install:
    Just copy paste the contents of the .rar file to your plugins folder.

    How to use:
    Type whatever block you want in the config.yml file in the same way as they are already in there.
    That means 4 spaces, then a dash, then another space, then your block or item.

    That block will then be restricted to everyone on the server except "*" groups.
    The permissions nodes look as following:
    Code:
    cbr.destroy.[config material name]
    cbr.place.[config material name]
    cbr.reload
    Give the reload permission to admins and the likes to give them permission to reload.

    Changelog:
    • v1.4.2
      • Now works again (bug fixes etc)
    • v1.4.1
      • Fixed "/cbr" giving an error
      • Fixed gold placement not detecting
    • v1.4
      • Cleaned up code to make it a lot more lightweight
      • Added the /cbr reload command
      • Added break restrictions
    • v1.3
      • Automatically reloads the config file
    • v1.2.1
      • Added lots of items for which I didn't make a simplified name
      • Fixed directory name
    • v1.2
      • Fixed additional permissions, everything should be fine now
    • v1.1
      • Fixed permissions not working correctly
    • v1.o
      • Initial release
    Todo:

    • Damage values
    • Crafting restriction
    • Item use restriction
    If you liked this plugin and want more plugins from me: Donate!
     
  2. Offline

    Randy Schouten

    No problem, I will make a check if it's empty, and give a warning about it in the console :)
    I'm already happy I see some people are using my plugin, to be honest. Makes you feel good inside :D
     
  3. Offline

    Scizzr

    Randy,

    What about gold ore? Lacks support for:
    Any chance you can keep a copy of your name-to-number list somewhere like in a .db file instead of having it hardcoded in?

    Also, one complaint:
    Using just '/cbr' spits out a nasty error in-game:
    Code:
    An internal error occurred while attempting to perform this command.
    
    and in the server console:
    Code:
    04:25:04 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'cbr' in plugin CustomBlockRestriction v1.4
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:128)
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:281)
            at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:718)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:684)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:677)
            at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:217)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:401)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:311)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
            at randy.cr.cr.onCommand(cr.java:126)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
            ... 12 more
    
    Any advice (other than "don't use that command")?

    Thanks for a great plugin. Works very well with Paid2Mine (prevents users placing ore blocks they've mined so that they can mine them for multiple rewards).
     
  4. Offline

    Randy Schouten

    Fixed both bugs in v1.4.1.

    And as the feature, do you want yourself to be able to type the data values instead of the names?
     
  5. Offline

    Scizzr

    Would be acceptable. :)

    I know some plugins load from a .db file such as General. It's items.db file consists of these entries:
    Code:
    0=Air
    1=Stone
    2=Grass
    3=Dirt
    4=Cobblestone
    5=Wood
    6=Sapling
    6,1=BirchSapling
    6,2=SpruceSapling
    7=Bedrock
    8=Water
    9=StillWater
    10=Lava
    11=StillLava
    12=Sand
    13=Gravel
    14=GoldOre
    15=IronOre
    16=CoalOre
    17=Log
    17,1=Redwood,DarkLog,RedwoodLog
    17,2=Birch,BirchLog
    18=Leaves
    19=Sponge
    20=Glass
    21=LapisOre
    22=LapisBlock
    23=Dispenser
    24=Sandstone
    25=NoteBlock
    26=BedBlock
    27=PoweredRail,PowerRail,BoosterRail,BoostRail,PoweredRails,PowerRails,BoosterRails,BoostRails
    28=DetectorRail,DetectRail,DetectorRails,DetectRails
    30=Web,SpiderWeb,Webbing
    35=Wool,WhiteWool,WhiteCloth
    35,1=OrangeWool,OrangeCloth
    35,2=MagentaWool,MagentaCloth
    35,3=LightBlueWool,LightBlueCloth
    35,4=YellowWool,YellowCloth
    35,5=LightGreenWool,LightGreenCloth,LimeWool,LimeCloth
    35,6=PinkWool,PinkCloth
    35,7=GrayWool,GrayCloth,GreyWool,GreyCloth
    35,8=LightGrayWool,LightGrayCloth,LightGreyWool,LightGreyCloth
    35,9=CyanWool,CyanCloth
    35,10=PurpleWool,PurpleCloth
    35,11=BlueWool,BlueCloth
    35,12=BrownWool,BrownCloth
    35,13=DarkGreenWool,GreenWool,DarkGreenCloth,GreenCloth
    35,14=RedWool,RedCloth
    35,15=BlackWool,BlackCloth
    37=YellowFlower
    38=RedRose
    39=BrownMushroom
    40=RedMushroom
    41=GoldBlock
    42=IronBlock
    43=DoubleStoneSlab,DoubleStep,DoubleSlab
    43,1=DoubleSandStoneSlab,DoubleSandSlab
    43,2=DoubleWoodenSlab,DoubleWoodSlab
    43,3=DoubleCobbleStoneSlab,DoubleCobbleSlab
    44=StoneSlab,Step,Slab
    44,1=SandStoneSlab,SandSlab
    44,2=WoodenSlab,WoodSlab
    44,3=CobbleStoneSlab,CobbleSlab
    45=Brick
    46=TNT
    47=Bookcase
    48=MossyCobblestone,MossyCobble,MossStone
    49=Obsidian
    50=Torch
    51=Fire
    52=MobSpawner
    53=WoodenStairs
    54=Chest
    55=RedstoneWire
    56=DiamondOre
    57=DiamondBlock
    58=Workbench
    59=Crops
    60=Soil
    61=Furnace
    62=BurningFurnace
    63=SignPost
    64=WoodenDoor
    65=Ladder
    66=MineCartTracks,Rails
    67=CobblestoneStairs,StoneStairs
    68=WallSign
    69=Lever
    70=StonePressurePlate
    71=IronDoor
    72=WoodenPressurePlate
    73=RedstoneOre
    74=GlowingRedstoneOre
    75=RedstoneTorchoff
    76=RedstoneTorchon,RedstoneTorch
    77=StoneButton
    78=Snow
    79=Ice
    80=SnowBlock
    81=Cactus
    82=Clay
    83=Reed
    84=Jukebox
    85=Fence
    86=Pumpkin
    87=RedMossyCobblestone,Netherrack,Netherrock,RedCobble
    88=Mud
    89=Glowstone,BrittleGold,
    90=Portal
    91=Jack-O-Lantern
    92=Cake
    93=RedstoneRepeaterOff
    94=RestoneRepeaterOn
    95=LockedChest
    96=Trapdoor,Hatch
    256=IronSpade
    257=IronPickaxe
    258=IronAxe
    259=SteelandFlint,FlintandSteel,Lighter
    260=Apple
    261=Bow
    262=Arrow
    263=Coal
    263,1=Charcoal
    264=Diamond
    265=IronIngot
    266=GoldIngot
    267=IronSword
    268=WoodenSword
    269=WoodenSpade
    270=WoodenPickaxe
    271=WoodenAxe
    272=StoneSword
    273=StoneSpade
    274=StonePickaxe
    275=StoneAxe
    276=DiamondSword,DSword
    277=DiamondSpade,DSpade,DShovel,DiamondShovel
    278=DiamondPickaxe,DA,DP,DPick,DPickaxe
    279=DiamondAxe,DAxe
    280=Stick
    281=Bowl
    282=MushroomSoup
    283=GoldSword
    284=GoldSpade
    285=GoldPickaxe
    286=GoldAxe
    287=String
    288=Feather
    289=Gunpowder
    290=WoodenHoe
    291=StoneHoe
    292=IronHoe
    293=DiamondHoe
    294=GoldHoe
    295=Seeds
    296=Wheat
    297=Bread
    298=LeatherHelmet
    299=LeatherChestplate
    300=LeatherPants
    301=LeatherBoots
    302=ChainmailHelmet
    303=ChainmailChestplate
    304=ChainmailPants
    305=ChainmailBoots
    306=IronHelmet
    307=IronChestplate
    308=IronPants
    309=IronBoots
    310=DiamondHelmet,DHelm,DHelmet
    311=DiamondChestplate,DChest,DChestplate,DPlate
    312=DiamondPants,DPants,DPant
    313=DiamondBoots,DBoots,DBoot
    314=GoldHelmet
    315=GoldChestplate
    316=GoldPants
    317=GoldBoots
    318=Flint
    319=Pork
    320=GrilledPork
    321=Painting
    322=GoldenApple
    323=Sign
    324=WoodenDoor
    325=Bucket
    326=WaterBucket
    327=LavaBucket
    328=MineCart
    329=Saddle
    330=IronDoor
    331=Redstone
    332=Snowball
    333=Boat
    334=Leather
    335=MilkBucket
    336=ClayBrick,ClayBricks
    337=ClayBalls,ClayBall
    338=Reed
    339=Paper
    340=Book
    341=SlimeBall
    342=StorageMineCart
    343=PoweredMineCart
    344=Egg
    345=Compass
    346=FishingRod
    347=Clock
    348=GlowstoneDust
    349=RawFish
    350=CookedFish,Fish
    351=InkSack,IncSack,Black,BlackDye
    351,1=Red,RoseRed,RedDye
    351,2=Green,CactusGreen,GreenDye
    351,3=CocoaBeans,Brown,BrownDye
    351,4=LapisLazuli,Blue,BlueDye
    351,5=Purple,PurpleDye
    351,6=Cyan,CyanDye
    351,7=LightGrey,LightGreyDye,LightGray,LightGrayDye
    351,8=Grey,GreyDye,Gray,GrayDye
    351,9=Pink,PinkDye
    351,10=Lime,LimeDye,LightGreen,LightGreenDye
    351,11=Yellow,DandelionYellow,YellowDye,DandelionYellowDye
    351,12=LightBlue,LightBlueDye
    351,13=Magenta,MagentaDye
    351,14=Orange,OrangeDye
    351,15=BoneMeal,White,WhiteDye
    352=Bone
    353=Sugar
    354=Cake
    355=Bed
    356=RedstoneRepeater,Repeater
    357=Cookie
    358=Map
    2256=GoldRecord
    2257=GreenRecord
    
    Anytime an item is added to Minecraft (for example Maps and Hatches), users can easily add them to the .db file by just making an entry. You shouldn't have to do that much, and personally I think item IDs are enough.

    Thanks for adding goldore and fixing that problem. ^_^
     
  6. Offline

    baffu

    It restricts placing fine but not destroying??
    This is the config:

    place:
    - bedrock
    - dirt
    destroy:
    - cobblestone
    - stone
    - dirt
    - grass
    - sand
    - obsidian
    It lets e break all of the stuff but not place
     
  7. Offline

    Scizzr

    Randy,

    After restricting water through your plugin's config file and specifying a group's permissions to allow placing water and lava, I reloaded the server (stop, restart also) and the plugin still disallows them to place water and lava. I even attempted to allow cbr.* in their permissions and the same problem persists. Strangely, adding '*' allows me to place all blocks, so there's still a node that gives this permission (maybe you renamed the node?)

    I'm using v1.4.1 of your plugin and Permissions 3.1.5b and am willing to give you more information if you need. Let me know.

    Thanks.
     
  8. Offline

    Randy Schouten

    For some reason, the whole plugin stopped working, I did something wrong with the code.
    I'm almost done with an update for my other plugin NPC-Quester, then I'll get on this plugin.
     
  9. Offline

    Scizzr

    Randy,

    Sounds good. Looking forward to your plugin, as it's an essential plugin on my (and many others') server.

    Thanks. :)
     
  10. Offline

    Randy Schouten

    Sorry for the big delay, I will have it fixed by tomorrow.

    I was very busy with NPC-Quester.
    I did get a few things fixed while waiting for reactions tho, so I'm sure everything is fixed by tomorrow.
     
  11. Offline

    christley

    so ive given the cbr.* to my moderators. they can only place 1 of the items and then it says they need permission to do it further. doesnt report anything in the server log at all. nor does it work by giving them the cbr.place.* either.
    reloaded permissions and cbr. using 3.1.5 and 1.4.1
     
  12. Offline

    Randy Schouten

    I've noticed some things aren't working very well in this version.
    There will be an update out by tomorrow fixing all issues with this plugin.
     
  13. Offline

    Slyvr89

    Does it work by listing block item numbers or just names?
     
  14. Offline

    Randy Schouten

    At this moment only on names.
    But I'm planning on adding the ability to add the data values too.
     
  15. Offline

    baffu

    Cool, so your updating it today!
    Just so you know the restricting block breaking is not working at all for me as I said before I hope that gets fixed soon.
     
  16. Offline

    Randy Schouten

    Damn it, sorry guys, I can't get the update out today. :(

    I swear, tomorrow I pretty much have the day off, I WILL have it fixed by then!
    I know exactly how to do it know and wrote it down real quick, so it will be done early tomorrow.

    Again, I'm very sorry.
    I normally provide better support.

    EDIT: http://dl.dropbox.com/u/2485556/CustomBlockRestriction.jar
    Use with caution, might work tho!
    Now I must go to work before I'm too late.
     
  17. Offline

    Scizzr

    Randy,

    No luck. Spams game chat with the following message (yes, 6 times per try):
    Code:
    You don't have permission to place water.
    You don't have permission to place water.
    You don't have permission to place water.
    You don't have permission to place water.
    You don't have permission to place water.
    You don't have permission to place water.
    You don't have permission to place lava.
    You don't have permission to place lava.
    You don't have permission to place lava.
    You don't have permission to place lava.
    You don't have permission to place lava.
    You don't have permission to place lava.
    Thanks for your tries though.

    Edit: Not sure what you changed, but it's definitely borked since the goldore and command fix... Maybe you could revert to using that code and try something else? Not sure if you archive your code for a case such as this...
     
  18. Offline

    Randy Schouten

    Update v1.4.2

    Fixed the plugin, should work again :)
     
  19. Offline

    Scizzr

    Randy,

    Somewhat of a simple question that seems to be driving me crazy.

    I add water to the config file (restrict placing), and users can't place water (both 8 and 9) as well as water buckets (326). Should not 'water' restrict only water (8)? (see below) Furthermore, I grant them the permission node 'cbr.place.water' and they can only place water (8) but not water (9) or water buckets (326). The same occurs with lava (10, 11) and lava buckets (327). What gives?

    Is there some special code-name like 'water_bucket' or 'stationary_water' I need to be using? If so, what do the permission nodes look like? under_score? CamelBack?

    Better yet, is there somewhere a list that has all of these items (by name) for future reference?

    Thanks again.

    Found my answer after Googling for about 1½ hours.. :confused:
    http://www.minecraftforum.net/topic/58730-complete-item-list-as-a-cjava-enum/
     
  20. Offline

    Randy Schouten

    Ah yes, I've put all those together atm.
    I'll separate them at some time tho.
     
  21. Can this work with minecarts ?
     
  22. Offline

    Randy Schouten

    Maybe...
    I suppose you can test it :p
     
  23. Guess I deservered that :p

    i just wanted to ask before i try
    Tested with Cart and didnt work will try different Names when back home

    Thanks again :D

    Yea I have and it doest i tryed Cart, Minecart, 328 can stop all else except the carts unless these is something I havent tryed all in caps and non

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

    hnrch02

    Will this be updated?
     
  25. Offline

    Randy Schouten

    It should still work, seeing the comments above.
     
  26. Offline

    hnrch02

    Okay. Do you know when the item-use restriction will be finished?
     
  27. Offline

    Nathan Thorpe

    Okay this doesn't seem to work with flint and steel. It still allows me to place it.

    Does anyone know a fix for this?
     
  28. Offline

    Bonkerz

    how can i restrict diamondore breaking ?
     
  29. Offline

    p000ison

    When I've installed this plugin and the Essentials-Groupmanager I cant't use any commands of the groupmanager.

    Help? ;D (<---Bad English)


    Mfg p000ison from Germany
     
  30. Offline

    Fim

    hello dear sir,
    your plugin is exactly, what i was looking for. sadly, i still get that water-placement bug. so, my moderators cant place water, although i allowed them cbr.place.* ... and yes, i am using 1.4.2.
    in addition: will there be a cbr version for bukkit 928 (or higher) soon ?

    let me finish with a word of praise: you rock man ! :D
     
  31. Offline

    Phealoon

    Is this plugin ready to stop pistons yet?
     

Share This Page