[MECH/EDIT] SimpleSignEdit v1.7.1 - Edit signs with right-click, now on BukkitDev [1060]

Discussion in 'Inactive/Unsupported Plugins' started by Celtic Minstrel, Mar 22, 2011.

  1. Offline

    Celtic Minstrel

    Not satisfied with the mechanics of other sign edit tools, such as requiring the use of commands, I went and threw together a plugin that lets you edit signs simply by right-clicking them with another sign in hand.
    Download from the BukkitDev page. (Older versions available here.)

    When you right-click to edit a sign, you can then view and edit the text of the sign just as you would when creating it. You can only edit signs if you are the owner or if they are owned by everyone. To include colours on the sign, use the & character followed by a digit or a letter from A to F. This works both when placing and when editing. If you want to include an & character on the sign, and the plugin interprets it as a colour code, simply double it and the plugin will realize that you don't want it to be converted.

    To see who owns a sign, hold a stick in your hand (you can change this to any item in the config file), and right-click the sign. To change who owns a sign if you have permission, hold a feather in your hand (you can change this to any item in the config file), and right-click the sign. Then either type the new owner name into chat, or walk over and punch them. You can also enter the symbols @, #, and * into chat to set the owner to yourself, no-one, or everyone, respectively. You could also edit ownership by editing the config file, but since signs are stored by their location that would not be an easy task.

    To configure the items used for setting/viewing the owner of the sign, simply set the "view-owner" or "set-owner" values in the config file to the ID of the item you want to use. You can also change the "allow-stacking" and "break-protect" values if you wish. It's probably a good idea to leave the "signs" section alone since that keeps track of who owns which sign. You can also configure it so that you need to be sneaking (or not sneaking) to edit signs.

    Permissions nodes:
    • simplesignedit.edit - Allows players to edit the signs they have placed as well as public signs (owned by everyone). If Permissions is not installed, everyone gets this.
    • simplesignedit.edit.all - Allows players to edit any sign, including those with no owner and those placed by others. If Permissions is not installed, only ops get this
    • simplesignedit.colour.<code> - Allows players to use the specified colour on signs. Available colours are listed here, but leave out the underscores and use all lowercase. Or you can just give simplesignedit.colour.*; also, the U in colour is optional. Currently this is restricted to ops if Permissions is not installed
    • simplesignedit.setowner - Allows players to change the owner of a sign. If Permissions is not installed, only ops get this.

    Config options:
    • allow-stacking - Allows sign posts to be built on top of sign posts; if false, an attempt to stack sign posts will result in the edit window appearing.
    • break-protect - Protect signs from being broken by people other than their owner. Obviously signs owned by everyone can then be broken by everyone.
    • orphaned-breakable - If the above is set to true, this controls whether signs owned by no-one can be broken by anyone.
    • sneaking - One of "true", "false", or "both"; if true, you must be sneaking to edit signs, and if false, you must not be sneaking to edit signs. The default, "both", means that your sneaking status is not checked when determining if you should edit the sign.
    • view-owner - The ID of the item used to see the owner of a sign by right-clicking. Defaults to stick.
    • set-owner - The ID of the item used to set the owner of a sign by right-clicking. Defaults to feather

    Video by Warby579:


    List of things to maybe do:
    • None right now

    Changelog:

    Version 1.7
    • Now uses a database to keep track of sign ownership.
    • Added auto-save option.

    Version 1.6.2
    • Added configuration option to allow anyone to break signs that have no owner even if break protection is enabled; it has no effect if break protection is not enabled
    • Fixed a potential NullPointerException that would sometimes occur when disabling; this bug could in theory haved cause loss of owner data
    • Fixed PermissionsBukkit antibuild interfering with the operation of the plugin; now you should be able to edit signs if you have simplesignedit.edit even if you do not have permissions.build
    • Fixed duplication issue that resulted from a conflict with plugins that display an inventory window when right-clicking a sign; any other, similar duplication issues that I'm unaware of should be similarly fixed

    Version 1.6.1
    • Editing signs despite anti-build should now work with more anti-build plugins. It still might not work with some though.

    Version 1.6
    • Added an option to require that you are sneaking (or not sneaking) in order to edit signs. By default, you can edit signs regardless of whether you are sneaking.
    • Added the simplesignedit.* permission node, which somehow I managed to forget when implementing superperms support.
    • Added more API stuff. I suppose it's unlikely people will use it, but still. Also, the API is now used internally as well.
    • It should now be possible to make signs editable for users who do not have build permission. Whether it actually works may also depend on what plugin you use for anti-build. It still won't affect built-in spawn protection though.
     
    Taranis01, Pompeij and ksevelyar like this.
  2. Offline

    EMOberger

    Could you make this bypass the "build: false" node on permissions? EX:
    Code:
    groups:
        Default:
            default: true
            info:
                prefix: '&3[Golfer]&2'
                suffix: 
                build: false
            permissions:
                - mcdocs.*
                - lottery.buy
                - admincmd.player.list
                - XcraftGate.use.golf2world
                - simplesignedit.edit
                - simplesignedit.setowner
                - simplesignedit.colour.*
    
    that should allow the user to still edit signs, please make that happen :]
     
  3. Offline

    Rabus

    Doesn't work for me - all I can is checking who is the owner..
     
  4. Offline

    Celtic Minstrel

    @EMOberger – I'm not sure if I can do that; it may be possible by changing priority, though. I'll look into it.

    @Rabus – That implies you have a permissions issue. What (if anything) are you using for permissions?
     
  5. Offline

    Rabus

    Permissions 3.1.6, I'm op and headadmin with *.

    My plugins:

    [​IMG]
     
  6. Offline

    Celtic Minstrel

    Hm, interesting; as an op you should be able to do anything. I'll note that this does not work with Permissions 3.1.6, but it doesn't conflict or anything; you should still be able to use it even though it doesn't check with Permissions to determine who can do what; regular users will be able to edit and ops can do anything.

    Perhaps knowing more detail on what you mean by "doesn't work" would help. What happens when you attempt to edit a sign?

    Alright, version 1.6 is released. I finally got around to breaking all my nested (mostly anonymous) classes out into top-level classes, which makes maintenance a little easier especially since some of them have gotten fairly large.

    • Added an option to require that you are sneaking (or not sneaking) in order to edit signs. By default, you can edit signs regardless of whether you are sneaking.
    • Added the simplesignedit.* permission node, which somehow I managed to forget when implementing superperms support.
    • Added more API stuff. I suppose it's unlikely people will use it, but still. Also, the API is now used internally as well.
    • It should now be possible to make signs editable for users who do not have build permission. Whether it actually works may also depend on what plugin you use for anti-build. It still won't affect built-in spawn protection though.

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

    EMOberger

    i updated, and it seems that i still can't edit signs with people that have build:false
     
  8. Offline

    Celtic Minstrel

    Turns out it's because Permissions registers its BLOCK_PLACE at priority high; it would have worked if you were using PermissionsBukkit. I'll upload a quick-fix momentarily.
     
  9. Offline

    Rabus

    Nothing - if something would happen I would write about it :p

    No errors/messages.

    Updating atm, maybe it'll help somehow

    @edit
    Still nothing...
     
  10. Offline

    Celtic Minstrel

    So, you right-click a sign while holding a sign, and nothing at all happens?
     
  11. Offline

    Rabus

    Lol, nevermind.

    Working!
     
  12. Offline

    EMOberger

    Still does not work :[
     
  13. Offline

    Celtic Minstrel

    Hm, I guess I'd better go test it and figure out why.
     
    EMOberger likes this.
  14. Offline

    Rabus

    Ask if they try to use sign - that was my problem. I tought you can edit it just by right clicking.
     
  15. Offline

    Celtic Minstrel

    Good point, but it sounded like he was able to edit signs, but others on the server weren't even though they had the permission, due to the anti-build.
     
  16. Offline

    EMOberger

    Correct
     
  17. Offline

    mooman219

    Tips to make your plugin better (IMO)

    1. Check What block Face is clicked and reference it to the position of the sign, if it is the front of the sign, Let the plugin do what it should and edit the sign, If you clicked one of the sides of the sign, don't let the plugin do anything and let the player place the sign. I was building a train station and I wanted to place a sign on a sign but this plugin stopped me.
    2. To stop signs from stacking in your inventory, Add a simple check to see if your plugin took a sign away from the player before giving them one back.
     
  18. Offline

    Celtic Minstrel

    If you're referring to stacking sign posts, there's already an option to allow that. I don't see any reason to prevent you editing by clicking the bottom edge or the side of a sign, or the top edge of a wall sign.

    Hm, that's an idea. I'll try that.
     
  19. Offline

    Nordic42

    Hi I have Problems with Permissions.
    For debugging purposes i set up a really basic server:
    Craftbukkit version git-Bukkit-0.0.0-945-g73697a4-b1000jnks (MC: 1.7.3)
    Permissions 3.1.6
    SimpleSignEdit 1.6.1
    (no spawn protection)


    first Configuration:
    Nordic42 is not OP
    users.yml of world:
    Code:
    users:
         Nordic42:
             info:
                 build: true
             permissions:
                 - '*'
    
    Here I can not change sign ownership or edit signs which I don't own.


    second Configuration: (I properly reloaded permissions and double checked via perms list command)
    Nordic42 is OP
    users.yml of world:
    Code:
    users:
         Nordic42:
             info:
                 build: true
            permissions:
    
    Here I can change sign ownership or edit signs which I don't own.


    Does your plugin support the "Permissions" permission plugin?
    Did I make an error or is this a bug?
    It would be awesome if I could control the use via permissions rather than OP status on my real server. (I don't use OP status at all)

    Thx and greetings :)
    Nordic
     
  20. Offline

    Celtic Minstrel

    It does not support Permissions nor GroupManager for permissions. It does support PermissionsEx, bPermissions, and PermissionsBukkit. It may also support future versions of Permissions, but I can't promise that.
     
  21. Offline

    Nordic42

    Ok thanks for the reply. :)
    I'm bound to Permissions because of Multiverse.
    Well I think I will just assign some OPs for now.
     
  22. Offline

    Celtic Minstrel

    Not if you upgrade to Multiverse 2.0.
     
  23. Offline

    tickleman

    Hi.

    I've got this since my first 1.5 download, and now with 1.6.1 (bukkit #1000 / #1060) :

    2011-08-16 10:35:33 [SEVERE] Error occurred while disabling SimpleSignEdit v1.6.1 (Is it up to date?): null
    java.lang.NullPointerException
    at ca.celticminstrel.signedit.SignEdit.onDisable(SignEdit.java:147)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:128)
    at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:906)
    at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:294)
    at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:287)
    at org.bukkit.craftbukkit.CraftServer.disablePlugins(CraftServer.java:173)
    at net.minecraft.server.MinecraftServer.stop(MinecraftServer.java:314)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:393)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)

    Could you please fix it ? Not a real problem but not very beautifull in logs...
    Thanks.
     
  24. Offline

    Celtic Minstrel

    I think that's fixed for 1.6.2, which I expect to release in a few minutes.

    Now I look at the code, I remember why I couldn't do that; the code increasing the sign's stack size is in the interact event, which is too early to know. I'm going to try moving it to the end, just after the sign is updated with the new text.

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

    Nordic42

    Thx. I didn't notice, there was a new version. Now a whole bunch of updates are inbound. I will consider switching to another perms plugin.

    Hm, i know this is really off topic... but are there other advantages to the other perm plugins besides more compatibility? I'm not very experienced with regards to bukkit (etc.) and working into Permissions (the plugin) was quite time consuming due to the minimalistic documentation.
     
  26. Offline

    mooman219

    if would post the source, I would gladly take a look
     
  27. Offline

    Celtic Minstrel

    No need, I've just fixed it in the way I mentioned, and the new version is uploaded. Though, the source is on my github, so it's already posted. :p

    Version 1.6.2
    • Added configuration option to allow anyone to break signs that have no owner even if break protection is enabled; it has no effect if break protection is not enabled
    • Fixed a potential NullPointerException that would sometimes occur when disabling; this bug could in theory haved cause loss of owner data
    • Fixed PermissionsBukkit antibuild interfering with the operation of the plugin; now you should be able to edit signs if you have simplesignedit.edit even if you do not have permissions.build
    • Fixed duplication issue that resulted from a conflict with plugins that display an inventory window when right-clicking a sign; any other, similar duplication issues that I'm unaware of should be similarly fixed

    At this point, the main three compatible permissions plugins are PermissionsEx, PermissionsBukkit, and bPermissions; I suggest you simply look at each of their threads and pick the one you prefer.

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

    xGhOsTkiLLeRx

    The bug with onDisable is still present in 1.6.2 :p

    Edit found the solution!
    In SignEdit.java

    look at onEnable at the message.
    There is a line
    PluginDescriptionFile pdfFile = getDescription();
    befor
    logger.info(bla)

    in onDisable this line is missing!
     
  29. Offline

    Celtic Minstrel

    Uh, no, because in onDisable the getDescription() call is embedded in the logger.info call. If you really have the same error message in v1.6.2, please post it; most likely it's slightly different in a way that would help me where the message from the older version wouldn't.
     
  30. Offline

    Don Redhorse

    hmm... the config.yml is empty except of {}

    anyone got a sample file for me?
     
  31. Offline

    Celtic Minstrel

    It should have a couple lines in it; see the config options section in the opening post for an idea of what they might be. It should also have all the signs and their owners.
     

Share This Page