[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

    Celtic Minstrel

    Are you holding a sign when you right-click?
     
  3. Offline

    veN1337

    "simplesignedit.edit.all" wont work for my players.
    Edit only works if the owner is "everyone" or the player himself.
    It doesnt work if the owner is any other player or "no-one" :(
    "simplesignedit.*" doesnt work too.
     
  4. Offline

    winter4w

    when i right press the sign i cant edit it
     
  5. Did you have a sign in hand? If not try again with a sign!
     
  6. Offline

    Celtic Minstrel

    Released 1.7, which now uses a database to store who owns each sign. If you don't want to use SQLite, make sure you edit your config before installing!

    What permissions system?

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

    veN1337

    Permissions 3.1.6 by Yeti
     
  8. Offline

    Celtic Minstrel

    That's probably why; I don't support Yeti permissions anymore. If you don't want to switch permissions systems (PermissionsEx, bPermissions, and PermissionsBukkit are the ones I know of to choose from) and want everyone to be able to edit all signs, you can add the following to the permissions.yml file in the main server folder:
    Code:
    server.simplesignedit:
      default: true
      children:
        simplesignedit.edit.all: true
    You can add other SimpleSignEdit permissions there as well. By default, only ops are allowed to edit all signs, but the above code will change the default to allow everyone to edit all signs.
     
    veN1337 likes this.
  9. Offline

    veN1337

    Changed to Permissions Ex ;)
    Thanks :)
     
  10. Offline

    Pim1234

    when you place a sign, are you then automatically the owner?
     
  11. Offline

    Celtic Minstrel

    Yes.

    By the way, I released a 1.7.1 version that fixes some database issues.
     
  12. Offline

    Kiste

    Im looking for something that allows me to "physically" password protect something and this seems to be the plugin closest to what i want:
    What about letting signs changed to a specific text power redstone?

    For example:
    Write on the first line: "[set password]"
    Second line: secret
    This would place an empty sign with power off

    Now if you edit the text on the first line to: "secret"

    its still empty but it will power redstone near to it(like a redstone torch) for a few seconds, maybe determine the time on the 3. lane? It would be awesome!

    Also "entering the password" should be allowed to anyone by default.

    PS:
    I hope this text is readable and you can understand it.
    Im german and i'm tired(because it's late, well in fact it's early but i haven't slept yet.:p)
     
  13. Offline

    Warby579

  14. Offline

    Celtic Minstrel

    @Kiste – That's a nice idea, but not within the scope of this plugin.

    @Warby579 – Thanks!
     
  15. Offline

    cuco

    Hi

    I am now using your plugin with MySQL. And now I got this error:
    Code:
    22:17:36 [SCHWERWIEGEND] com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 41.791.027 milliseconds ago.  The last packet sent successfully to the server was 41.791.027 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
    22:17:36 [SCHWERWIEGEND]        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    22:17:36 [SCHWERWIEGEND]        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    22:17:36 [SCHWERWIEGEND]        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    22:17:36 [SCHWERWIEGEND]        at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
    22:17:36 [SCHWERWIEGEND]        at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
    22:17:36 [SCHWERWIEGEND]        at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116)
    22:17:36 [SCHWERWIEGEND]        at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3348)
    22:17:36 [SCHWERWIEGEND]        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1967)
    22:17:36 [SCHWERWIEGEND]        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
    22:17:36 [SCHWERWIEGEND]        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626)
    22:17:36 [SCHWERWIEGEND]        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2111)
    22:17:36 [SCHWERWIEGEND]        at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1362)
    22:17:36 [SCHWERWIEGEND]        at ca.celticminstrel.signedit.SignsMap.containsKey(SignsMap.java:143)
    22:17:36 [SCHWERWIEGEND]        at ca.celticminstrel.signedit.SignEdit.getSignOwner(SignEdit.java:85)
    22:17:36 [SCHWERWIEGEND]        at ca.celticminstrel.signedit.SignEdit.isSignOwned(SignEdit.java:106)
    22:17:36 [SCHWERWIEGEND]        at ca.celticminstrel.signedit.SignBlockListener.onSignChange(SignBlockListener.java:30)
    22:17:36 [SCHWERWIEGEND]        at org.bukkit.plugin.java.JavaPluginLoader$33.execute(JavaPluginLoader.java:469)
    22:17:36 [SCHWERWIEGEND]        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    22:17:36 [SCHWERWIEGEND]        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:338)
    22:17:36 [SCHWERWIEGEND]        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:993)
    22:17:36 [SCHWERWIEGEND]        at net.minecraft.server.Packet130UpdateSign.a(SourceFile:41)
    22:17:36 [SCHWERWIEGEND]        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    22:17:36 [SCHWERWIEGEND]        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:89)
    22:17:36 [SCHWERWIEGEND]        at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:478)
    22:17:36 [SCHWERWIEGEND]        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
    22:17:36 [SCHWERWIEGEND]        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:453)
    22:17:36 [SCHWERWIEGEND]        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:363)
    22:17:36 [SCHWERWIEGEND]        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    22:17:36 [SCHWERWIEGEND] Caused by: java.net.SocketException: Broken pipe
    22:17:36 [SCHWERWIEGEND]        at java.net.SocketOutputStream.socketWrite0(Native Method)
    22:17:36 [SCHWERWIEGEND]        at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
    22:17:36 [SCHWERWIEGEND]        at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
    22:17:36 [SCHWERWIEGEND]        at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    22:17:36 [SCHWERWIEGEND]        at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    22:17:36 [SCHWERWIEGEND]        at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3329)
    22:17:36 [SCHWERWIEGEND]        ... 21 more
    22:17:36 [SCHWERWIEGEND] An SQL error has occurred:
    22:17:36 [SCHWERWIEGEND] --> No operations allowed after statement closed.
    22:17:36 [WARNUNG] This may indicate a loss of sign ownership data!
    
     
  16. Offline

    Celtic Minstrel

    Not a bug; for some reason the connection to the MySQL server was lost. The error message gives you a hint at how to fix it:
    I assume you set autoReconnect to true somewhere. You could try adding "autoReconnect: true" to the database options section in your config; I don't know if that'll do it, but it's worth a try, right?
     
  17. Offline

    cuco

    I think it has to be set inside the plugin?

    //EDIT: both possible. Inside the plugin and inside the database-adress:
    url="jdbc:mysql://localhost:3306/DBNAME?autoReconnect=true"
    I think it is better to add the substring at the end inside the plugin instead of adding this in the config.
     
  18. Offline

    veN1337

    Same error again, also the color.* wont work :(
    Latest CB, PermissionsEx and SimpleSignEdit version.
    I used the permission.yml in the root for now, so everyone can use it.
    But this doesnt make me happy at all, i want to use PEX only.
     
  19. Offline

    Celtic Minstrel

    Um, no idea why that won't work if you're on PermissionsEx. It should work.
     
  20. Offline

    Oozziizz

    Do we NEED to have permissions? For im trying, without, but it wont work .. :( For i cant config the Permissions too..
     
  21. Offline

    Celtic Minstrel

    You can use it without permissions; if you don't have permissions, everyone will be able to edit their own signs and check who owns a sign, but only ops will be able to edit other people's signs, use colours (I think), and change who owns a sign.

    (This is also the default if you have a permissions system but don't assign or revoke SSE permissions to/from anyone.)
     
  22. Offline

    halley

    Suggestion: right-clicking sign AGAIN with the set-owner item, while waiting for an owner punch/name/symbol, sets the ownership to yourself. Very handy when you are setting up a whole signboard and have dozens of signs to mark ownership.

    I don't like the whole typing-after-clicking thing... it should be an argument to an /ownsign command instead.

    /ownsign [player]
    *click*

    or grab feather,
    *click* *click*

    You need to offer a sample config.yml in your download, or have a COMPLETE sample configuration generated on first load. Use comment lines liberally in the starter. The best default database option is one that works without configuration, so default to YAML database if they didn't have a config.yml to start off with. Show how to mark database options for sqlite, and how to do it for mysql, in commented-out lines.

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

    Celtic Minstrel

    Excellent idea. I'll go do that.

    Also, the default of SQLite does work without configuration, so I don't see a need to change it. I understand that having a sample config is useful, but there aren't that many options and they're all clearly documented on the wiki page.
     
  24. Offline

    Samuel Greaves

    How do you get to the configuration? there doesn't seem to be anything except the jar in the plugins folder.
     
  25. Offline

    Celtic Minstrel

    It's in the SimpleSignEdit folder.

    Also, version 1.8 is available with halley's suggestion and a bugfix.
     
  26. Offline

    Revenger

    Installed sign on RB 1240 and get this non error message.

    Code:
    2011-10-06 02:02:23 [INFO] SimpleSignEdit v1.8 enabled.
    
    Rclick on any sign and nothing happens even after creating one and adding some text.
    Also get this message when editing signs.

    Code:
    02:17:05 [SEVERE] Could not pass event SIGN_CHANGE to HawkEye
    java.lang.ClassCastException: org.bukkit.craftbukkit.block.CraftBlockState cannot be cast to org.bukkit.block.Sign
            at uk.co.oliwali.HawkEye.entry.SignEntry.interpretSignBlock(SignEntry.java:47)
            at uk.co.oliwali.HawkEye.entry.SignEntry.<init>(SignEntry.java:33)
            at uk.co.oliwali.HawkEye.listeners.MonitorBlockListener.onSignChange(MonitorBlockListener.java:59)
            at org.bukkit.plugin.java.JavaPluginLoader$36.execute(JavaPluginLoader.java:490)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:1046)
            at net.minecraft.server.Packet130UpdateSign.a(SourceFile:41)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
            at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:500)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    >
    
     
  27. Offline

    snikkers

    Looks like an hawkeye compatibility problem
     
  28. Offline

    Celtic Minstrel

    My guess for the HawkEye issue is that you've tried to edit a sign but SimpleSignEdit has disallowed it... which leads to the first issue. Is it just editing that's not working? Can you place a sign and put some text on it, but then you can't edit it? If so, what permissions are assigned, and what's your permissions system?
     
  29. Offline

    Revenger

    Permissions is PEX.

    I'll do some extended testing but I got the edit box up with a blank sign to edit the sign it was when I finished editing and the blank sign was given back to me this error happens even on new signs edited Its the same.

    It does finish the edit properly though shows the error.
     
  30. Offline

    Celtic Minstrel

    Okay, so my plugin works but you get an error from HawkEye; is that correct? (By the way, the edit box shouldn't be blank; it should have the old sign text.)
     
  31. Offline

    Revenger

    Oh edit box does have the old sign text in it and updating of signs work.

    From Hawkeye dev as I've posted on both threads.

    Making a sign normally works fine and no error in console its after I update a sign and the point where it gives the sign back to me it generates the error in console every time the sign updates fine also.

    And he is kinda right in that its a compatibility issue only when updating signs.
     

Share This Page