[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. 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

    saberman146

    Nice, I Would Like colours... Good Idea.:)
     
  3. Offline

    Nijikokun

    Permissions :p
     
  4. Version 0.2 adds permissions support, and the person editing the sign can now see their handiwork without re-logging. If it can't find Permissions, then only ops can now edit signs, instead of just everyone.

    I suspect that a player watching when someone edits a sign would still not see the update.
     
  5. Offline

    Luong

    Is it possible to have a combo click to do edit? Reason being is because I have two sign plugin that uses the sign to be a teleporter, an elevator, a lock, etc.
     
  6. Unfortunately not, sorry. Which other plugins are you using?
     
  7. Offline

    MineralMC

    Been looking for this for a while, surprised it took me this long to find! Is a REC602 update in the works? I'd like to implement this with this month's server refresh! :)
     
  8. Offline

    Luong

    For the players, I have SignLift, MyWarp, and ColorSign which also might conflict too. As for Mods, we use command line features instead.

     
  9. It's actually done, I just was holding off on releasing it until the recommended build changed. I guess now would be a good time for that!

    @Luong - This plugin doesn't define any commands, so the only conflict would be that you may not be able to edit signs with magic "special features" such as a MyWarp warp sign. It's possible that you might be able to edit them, but I can't make any guarantees since it depends on the behaviour of the other plugin. If you can, what would probably happen is that you right-click the sign with a sign in hand, get teleported, but still get the edit sign window where you can replace lines.

    By the way, you seem to be linking to a hosting service or something rather than the plugin threads. Perhaps you should edit your post to fix that?
     
  10. Offline

    Acru

    There are some public but undocumented functions in Lockette, for when you are ready to make it compatible. :3 I need to document them soon~

    Mind you, Lockette already stops people from placing signs on protected signs, but I can't prevent you from changing the text of a Lockette sign.
     
  11. Alright, 1.0 uploaded for CraftBukkit 602. It adds colours, and the edited sign will now update for all users instead of just the person editing.

    That would block this plugin, since placing a sign on a sign is the event it hijacks for the editing.
     
  12. Offline

    Acru

    It depends what order the two plugins are called.
    As I use Event.Priority.Highest for item/interact, your plugin probably gets the event first.
     
  13. Offline

    Luong

    Sorry about that, didn't know there was a link on it, I removed it.

    I personally don't mind about not being able to edit lockette sign, since it is for security reason which is fine by me. It's mostly the warp tool that really concerns me, or I can replace the warp tools with the stargate portal plugin. who knows, server environment is still in development, so removing/switching plugins is not a big issue at this point for me. But I figure it was something worth bringing up since this would definitively be a handy tool.
     
  14. I don't think it would matter what the priority is. If the placement of the sign is ultimately cancelled, the edit via this plugin will fail because Bukkit only reports a sign changed event to a plugin if there is a sign on the location. Someone watching the edit in progress would probably see a temp-sign that disappears when they finish editing.

    When MyWarp is updated, I'll try it and see how they interact.
     
  15. Offline

    emoknight

    do u have old v of the plugin at work with CB 556?

    Edit: oh i find link to it :)
     
  16. Offline

    Kahl

    Could you make this happen if right clicked with anything, not just a sign? Also making sure to not place the block
     
  17. Yes.


    I'm afraid it's not possible since there is no way for the server to tell the client to show the sign window. Sorry.

    If that ever becomes possible, I'll definitely let you choose what you want to right-click with.
     
  18. Offline

    Acru

    I'll give it a test later just to be sure.
    Would be nice if it turned out to be compatible without having to add anything extra. :3
     
  19. Offline

    emoknight

    Code:
    2011-03-31 16:28:44 [SEVERE] Could not pass event PLAYER_ITEM to SimpleSignEdit
    java.lang.NullPointerException
        at ca.celticminstrel.signedit.SignEdit$2.onPlayerItem(SignEdit.java:89)
        at org.bukkit.plugin.java.JavaPluginLoader$9.execute(JavaPluginLoader.java:202)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:255)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:457)
        at net.minecraft.server.Packet15Place.a(SourceFile:57)
        at net.minecraft.server.NetworkManager.a(SourceFile:230)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:76)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    
    this is from 0.2
    this pop ervrytime i use a sign
    im also using ColoredSigns
     
  20. I will look briefly when I get home, but since you're not using 1.0 it's entirely possible that your error message is useless to me.

    That said, don't update to 1.0 yet since it's incompatible with your CraftBukkit.
     
  21. Offline

    Wolfy9247

    Heh thanks for making this, I've always just wanted a simple way to edit it without a long string of text like /se set 1"text" 4"text" (etc...)
     
  22. @emoknight - As expected, the line number in that error message is no longer useful to me since I've made significant changes in 1.0. However, if you still get the error when you eventually upgrade, do let me know. (Or if anyone else gets the error in 1.0!)
     
  23. Offline

    Benie

    The title of the plugin sold me. Tried it out. Works perfectly.
    But if I may make a suggestion;

    Have it where it will show what you're editing. Say I accidentally type in a character I didn't want and save it to the sign before I realize. I cannot remove said character without removing the sign.
     
  24. I don't quite understand what you mean, but if it's showing the current content of the sign while editing, that's currently impossible since that window is handled entirely by the client.
     
  25. Offline

    Luong

    I think he wants a text cursor to show the position of what character he is editing in short. basically like in any text editor has a word cursor.
     
  26. Offline

    jedimaster0

    CbutD could not download your file. FYI.
     
  27. Offline

    Jessicadawn

    Does this work with 617?

    Can you also make it so signs can be protected?
     
  28. Offline

    ksevelyar

    Yep.
     
  29. Could you give more information? Did it give an error?

    Can you give a little more detail of what you're looking for? Like, do you want people to only be able to edit signs that they themselves placed, or do you want to be able to "lock" signs so that no-one can edit them, or something else?
     
  30. Offline

    Jessicadawn

    Id like that people can only edit their own signs they have placed.
     

Share This Page