Inactive [ADMN/SEC] SimpleJail 2.0.3 - Jail those nasty players [1.2.5-R4.0]

Discussion in 'Inactive/Unsupported Plugins' started by imjake9, Jun 5, 2011.

  1. Offline

    imjake9

    SimpleJail - Jail those nasty players!
    Version: 2.0.3
    Requires: PEX, PermissionsBukkit, or Vault


    This plugin gives bare basic jail functionality. It allows you to set two points: the Jail point and the Unjail point. Then, when you jail a player, he/she will be teleported to the jail point and demoted to the Permissions group specified in config.yml. Unjail will re-promote the player and teleport back out of the jail, to the unjail point.

    Features:
    • Super customizable
    • Use /setjail and /setunjail to easily set the two teleport locations
    • Set the group that jailed players will be demoted to in the config file
    • Players' initial groups are saved, so a normal jailed player will revert to a normal rank when unjailed, and a player with the VIP class will revert to the VIP class
    • Works with PEX, PermissionsBukkit, and Vault
    • Players in jail will respawn in jail
    • You can "tempjail" players who will be automatically unjailed after a set time
    • You can jail/unjail players even when they are offline
    Permissions Nodes:
    • simplejail.jail — Allows the use of /jail
    • simplejail.unjail — Allows the use of /unjail
    • simplejail.setjail — Allows the use of /setjail and /setunjail
    • simplejail.jailtime — Allows the use of /jailtime, which shows a players remaining tempjail time
    • simplejail.* — Allows all SimpleJail commands
    Download SimpleJail 2.0.3
    SimpleJail on GitHub

    Have suggestions or problems? Want to see possible additions in the works? Check out the SimpleJail issue tracker on GitHub!

    Changelog:
    Version 2.0.3:
    • Fixes the problem where users would be unjailed to the jail point.
    Version 2.0.2:
    • A purely API update, this restructures some code to allow plugins to be less active about redefining jail locations.
    Version 2.0.1
    • Now gives a more suitable error message when no permissions plugins are installed but Vault is.
    • Made /jailtime work with offline players.
    • Updated API to allow the jail and unjail methods to return information about the jail.
    • Made commands use the correct autocompleted names in messages.
    Version 2.0
    • API updated for use with SimpleJailCells.
    • Now uses Metrics for statistics logging.
    Version 1.7.11
    • Fixed bug with some new API code when restarting the server.
    Version 1.7.10
    • More offline player fixes.
    Older versions (open)

    Version 1.7.9
    • Fixed NPE when dealing with offline players.
    Version 1.7.8
    • Fixed issue with saving the jail status to the jailed.yml
    Version 1.7.7
    • Added Vault support to make SimpleJail compatible with virtually every server setup
    Version 1.7.6
    • Added tons of new API hooks for future features
    • Updated for Minecraft 1.2.3
    Version 1.7.4
    • Lowercased all permissions nodes
    • Made lacks permissions messages more intuitive
    Version 1.7.3
    • Improved the messaging system
    • Added "lacks permission" messages
    Version 1.7.2:
    • Fixed PermissionsBukkit unjailing with multiple groups
    Version 1.7.1:
    • Fixed some issues with PEX
    • Fixed offline jailing/unjailing
    • Updated for MC 1.1.0
    Version 1.7:
    • Added PEX support
    • Added offline jailing/unjailing of players
    Version 1.6.1:
    • Fixed issues with the new configuration system
    Version 1.6:
    • Updated to CB 1337
    • Added multiworld support
    • Various other incomplete additions in progress
    Version 1.5
    • Removed support for Permissions 2/3
    • Added support for tempjails
    • Bug fixes
    Version 1.4.7
    • Fixed bug with non-Bukkit permissions
    Version 1.4.5-1.4.6
    • (Finally) fixed superperms support
    Version 1.4.3-1.4.4
    • Fixed initialization bug
    Version 1.4.1-1.4.2
    • Fixed bug with superperms
    Version 1.4
    • Added support for Bukkit "superperms"
    • Fixed bug where users were being duped in the Permissions config
    Version 1.3
    • Made jailed players respawn in jail
    Version 1.2
    • Fixed bug where players in implicit groups couldn't be unjailed
    Version 1.1
    • Fixed config file not saving properly
    • Fixed Permissions 3 support
    Version 1.0
    • Initial release
     
    sglov, Habbo4Life, fawlcun and 6 others like this.
  2. Offline

    CarabinasS

    i dont use Permission's plugin :?
     
  3. Offline

    xtyro

    ok. commands work now.
    after /jail xtyro command everything look well:
    Code:
    users:
        xtyro:
            permissions:
            groups:
            - Jailed
    
    but :p, after /unjail :
    Code:
    users:
        xtyro:
            permissions:
            groups:
            - '[admin]'
    wrong group format.
     
  4. Offline

    imjake9

    As mentioned earlier:
    WTF? That's really odd...
    Anyway, it's fixed in 1.4.6.
     
  5. Offline

    xtyro

    worse :(

    Code:
    [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'jail' in plugin SimpleJail v1.4.6
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:129)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:320)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:713)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:677)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:670)
        at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:85)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.util.regex.PatternSyntaxException: Unclosed character class near index 0
    [
    ^
        at java.util.regex.Pattern.error(Unknown Source)
        at java.util.regex.Pattern.clazz(Unknown Source)
        at java.util.regex.Pattern.sequence(Unknown Source)
        at java.util.regex.Pattern.expr(Unknown Source)
        at java.util.regex.Pattern.compile(Unknown Source)
        at java.util.regex.Pattern.<init>(Unknown Source)
        at java.util.regex.Pattern.compile(Unknown Source)
        at java.lang.String.replaceAll(Unknown Source)
        at com.imjake9.simplejail.SimpleJail.jailPlayer(SimpleJail.java:127)
        at com.imjake9.simplejail.SimpleJail.onCommand(SimpleJail.java:70)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
        ... 12 more
     
  6. Offline

    p67738

    Hey, does this support any other plugin? Tell me what plugins if so.

    [tnt]+[creeper]=[sponge]

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

    imjake9

    My bad. Just redownload, that should fix it.

    What do you mean "does this support"? It uses Permissions 2/3 or PermissionsBukkit, if that's what you mean.
     
  8. Offline

    blubber4456

    Works fine for me too...
     
  9. Offline

    imjake9

    Um... that post was roughly 2 months ago. That problem was solved quickly.
     
  10. Offline

    xtyro

    it's the same file
     
  11. Offline

    imjake9

    No, I don't believe it is. It's the same version number, but that's just because I forgot to recompile it before uploading last time.
     
  12. Offline

    xtyro

    it's ok now, thank you. :)
     
  13. Offline

    BatteryAcid

    wheres the config file? There is none?
     
  14. Offline

    TerrorBite

    May I ask why SimpleJail forces Permissions 3 to reload its user files whenever a player is jailed or unjailed? I jailed someone on a busy server and about ten of the server's users (who obviously hadn't been saved into the Permissions file yet) immediately lost the ability to build and use commands.
     
  15. Offline

    imjake9

    The config file should be auto-generated when the plugin first starts.

    Because this plugin changes Permissions groups, it needs to make Permissions reload everything so that things get updated. It shouldn't change the default group, so I have no idea why unregistered users' Permissions would be changed.
     
  16. Offline

    nemesis91

    The plugin works though it appears to incorrectly demote and then promote a user. It is hard to explain. The best way I can describe this is:

    I have 3 groups: guest (can't build), builder (can builder), and admin (can build). When a builder is jailed, they are demoted down to guest. When they are unjailed, the guest permission somehow becomes the main parent so even if the user is back to builder status, they're unable to do anything.
     
  17. Offline

    alexmack929

    Hi, I'm pretty sure I've probably missed something but can jailed players change blocks?

    E.g - Destroy blocks.

    I was going to make my jail from obsidian but they could punch through...
     
  18. Offline

    imjake9

    This is very odd. I'll look into it. What version of Permissions are you using? Could you post your Permissions config file?

    This changes players' Permissions group when they are jailed, so set a group with nobuild turned on to be the jail group. That way, they won't be able to escape.
     
  19. Offline

    nemesis91

  20. Offline

    TerrorBite

    So you're saying that to change a user's group, you're editing the Permissions files on-disk and then forcing a reload? Is there no way to change a user's Permissions group via the Permissions API?

    The issue stems from the following:
    • When Permissions sees a new user log in, the user is created and assigned the default group.
    • However, when the Permissions config is reloaded, any users who are not listed in users.yml end up with NO group (and thus no permissions).
    • Permissions apparently does not update the file on-disk as soon as a change occurs, meaning the files on disk are out of sync with the actual permissions.
    • Finally, there appears to be no command that will force Permissions to write its currently in-memory config out to disk.
    These last three facts combined result in loss of state when reloading the Permissions file from disk.

    If your plugin can send Permissions a "/pr -reload" command then what's stopping it from sending it other commands to edit the permissions? All your plugin would need to do is query the user's group via the Permissions API, then issue the following commands:
    • /pr {user} w:{world} parents remove {current_group}
    • /pr {user} w:{world} parents add {jailed_group}
    And do the reverse for unjailing.

    This way, you never have to touch files on disk and thus there will be no issues. I think this is a much better method of modifying the permissions.

    Okay, I've looked through your code and have a few suggestions.

    Line 147 and line 190, currently reloading Permissions via a console command.
    if(!useBukkitPermissions) this.getServer().dispatchCommand(console, "permissions -reload all");

    This could be changed to use the Permissions API instead:
    if(!useBukkitPermissions) permissions.reload();

    At the top of jailPlayer() and unjailPlayer() you should add:
    if(!useBukkitPermissions) {
    permissions.saveAll(); //Permissions flushes its config to disk
    perms.load(); //Ensure that we load the up-to-date Permissions config file
    }

    This assumes you continue with your current method of modifying the Permissions config file directly, instead of using a dispatchCommand() call to run Permissions commands to change group membership (sadly the Permissions API doesn't seem to have methods that modify the parents of a user).

    Edited for formatting.

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

    alexmack929

    Hi there, I haven't got Permissions installed BUT my server has no /home command. If I build the jail from bedrock, would it work?

    Oh...

    This sounds like a GREAT plugin but unfortunately, my server docent have permissions...

    Anyway you could make it 'disable' commands instead of change group so I could use it???

    EDIT: Making it disable block interaction wouldn't be necessary for me, as I can make my jail from bedrock. :D

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

    imjake9

    Sorry for my lack of replies, I've been a bit busy lately. The main reason Permissions 3 support doesn't use the API is because this plugin was first created for Permissions 2.x, which had next to no API. When I updated for Permissions 3, I took the easy way out and just converted existing code to Permissions 3. This was probably a little lazy on my part.

    However, to be perfectly honest, I don't like Permissions 3. The two main plugins this plugin supports are PermissionsBukkit and Permissions 2.x. Eventually I will get around to doing it, but I'm very busy right now and it's low on my priorities list. However, you seem very capable, and the source is on GitHub. Feel free to fork my plugin and issue a pull request, I'd gladly accept it.

    Sorry if I sound a little rude, and I do appreciate the work you've already done for me.

    That is beyond the scope of this plugin. Making it "disable" commands is possible, but the point of this plugin is to make a simple jail system. I'd highly recommend getting a Permissions plugin (perhaps PermissionsBukkit?) to manage things, they're very useful.
     
  23. Offline

    TheMap

    Can you make this Jail upon death?
     
  24. Offline

    Jadedwolf

    @imjake9
    Code:
    2011-08-07 17:28:06 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'jail' in plugin SimpleJail v1.4.6
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:129)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:320)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:713)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:677)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:670)
        at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:85)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:452)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:362)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.NoClassDefFoundError: com/platymuus/bukkit/permissions/PermissionsPlugin
        at com.imjake9.simplejail.SimpleJail.jailPlayer(SimpleJail.java:121)
        at com.imjake9.simplejail.SimpleJail.onCommand(SimpleJail.java:69)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
        ... 12 more
    Using Bukkit 1000+ With simplejail 1.4.6
    Then happens when someone uses the /jail command on a players, also using permissions 2.7.*
     
  25. Offline

    imjake9

    It looks to me like you have usebukkitpermissions:true in the config file even though you are not using PermissionsBukkit.

    I guess I could. I'll consider it.

    Also, note to all users of this plugin:
    I am phasing out support for any permissions system but PermissionsBukkit/superperms. Support for other systems has taken a back seat, and will eventually be removed entirely. Please plan accordingly. Thank you.
     
  26. So does this require Permissions or no?
     
  27. Offline

    imjake9

    Yes.
     
  28. Offline

    TerrorBite

    Thanks. I see now why the code is the way it is. I'll see what I can do with GitHub, I haven't really used the site from the developer's side at all. You don't seem rude at all once I see your reasoning.

    I'm in favor of PermissionsBukkit myself, however, I'm waiting for the majority of plugins to implement support for it. I think Bukkit should have added permissions support long ago, I'm surprised it took this long.
     
  29. Offline

    imjake9

    Awesome, glad you understand. Thanks for being such a great "customer". :p

    Also, keep in mind that PermissionsBukkit has SuperpermBridge, so it's compatible with most original Permissions plugins.
     
  30. Offline

    alexmack929

    Ok, thanks!

    I've been putting off installing permissions for a while as last tine I tried, I did something wring and had to delete all my plugins.
    Do you know any SIMPLE permissions plugins that support prefixes?
     
  31. Offline

    Jadedwolf

    @imjake9
    "It looks to me like you have usebukkitpermissions:true in the config file even though you are not using PermissionsBukkit."
    I do not: "usebukkitpermissions: false"
     

Share This Page