Sign Interface. Bring up a sign for players to type

Discussion in 'Plugin Development' started by Matthew Broomfield, Dec 15, 2012.

Thread Status:
Not open for further replies.
  1. Hey there,

    So, I'm in the middle of developing a plugin, and all you need to know is the following:
    • I want to be able to open the sign GUI (the GUI that opens when u place a sign) when a player does something
    • I want to be able to open this GUI just like I can an inventory
    1. This is not a bug, or error.
    2. Don't ask to see my source code. There's 2000+ lines in there, and it would take you forever to comprehend it.
    3. I don't care about Spout.
    I'm not sure this is possible, as I've looked around the Bukkit Javadocs and not seen anything. If anyone knows how to do this, or has seen examples, please let me know.

    Thanks :)
     
  2. Offline

    gomeow

    I believe that is client-side and only appears after a client places a sign.
     
  3. Not to argue, because I figured such was the case, but I always feel like "client-side" is used to explain things that are client-side or, just not implemented yet.

    I mean, this would have to be a part of Bukkit itself, but there's really no way to trick the player into playing down a sign?
     
  4. Offline

    Dreeass

    I'm not sure, but aren't there any plugins out there to edit signs and don't they open the interface with the values in it? If so, check those plugins. I'm definitely not sure because I've never used one.
     
  5. I'm not trying to edit signs, im trying to use the sign interface for other purposes.

    What about this, just for theoretical purposes:
    1. Player clicks a block
    2. Listener catches the event. Makes player place a sign.
    3. Block is changed back, either while the player is using the sign interface, or after the player is done.
    The first problem is making the player place a block.
    If you have to wait until the player is done, then you have to have a signEditFinish event, which is imporrible because there are no such events for signs, only inventories.
     
  6. Offline

    Dreeass

    It doesn't matter, if they can trigger it. So will you.
     
    MrBluebear3 likes this.
  7. Offline

    fireblast709

    This would be possible by letting the user place a sign, and removing that sign when the SignChangeEvent is called (also, this is where you get the lines the player typed)
     
  8. Offline

    ZeusAllMighty11 Retired Staff

    Sign menu IS client-side. Have you ever placed a sign somewhere it couldn't go, and it disappeared but the GUI stayed up?

    Yep.


    You can't force that GUI open, at least not in this current version of Bukkit. I have looked into similar things, such as forcing a link menu open (the yes or no to continue thing)
     
  9. Yeah I figured as much. Bukkit would have to be updated to allow such nonsense.
     
  10. Offline

    fireblast709

    The reason Bukkit does not let you do this, is because minecraft does not let you do this ;3
     
    MrBluebear3 likes this.
  11. I refuse to accept that I cannot do anything
     
  12. Offline

    fireblast709

    Just accept it already >->
     
    MrBluebear3 likes this.
  13. Offline

    Hoolean Retired Staff

    It is not possible.

    It is client-side and that is something only Mojang could change, not Bukkit.

    All sign-editing plugins don't even bring up the GUI, they use the chat.
     
  14. Offline

    fireblast709

    Nope, some use the sign as tool (to get the GUI) and the SignChangeEvent (the get the lines and remove the sign)
     
    MrBluebear3 likes this.
  15. Offline

    Hoolean Retired Staff

    My bad :p

    EDIT: You haz 200 likes
     
  16. Offline

    fireblast709

    MrBluebear3 likes this.
  17. You say its not possible, but we can listen for a sign changing? We can listen for a sign being placed. And I'm supposed to believe we can't pretend somehow to get the sign interface to open?

    I'm too stubborn.
     
  18. Offline

    Barinade

    The client sends data based on what they wrote in the client-sided interface, there is no reason for the server to handle whether or not this interface is shown. If it was added it would be for mods only, and I'm sure Mojang could give a crap less about adding new features solely for server mods.

    Just wait for Mod API to finally get released.
     
  19. Right, so the goal should be for the server to trick the client into thinking it set a sign
     
  20. Offline

    bergerkiller

    Sorry to bust you bubble. I had a nice sign-editing system in SignLink as others have described, but this broke since 1.2.

    • You can only bring up the sign interface by letting a player right-click a block while holding a sign
    • You can not change the text displayed on the sign interface while it is being shown
    • You can only let the users 'edit' signs by letting them re-type everything after clicking
    • For sign editing, this is pointless; the user can just destroy the old sign and place a new one
    You can not trigger the sign interface to show using the server, at least, you can't thus far. It is up to Mojang to add support for this again.
     
    MrBluebear3 likes this.
  21. Well lets just think for a moment. Say you can force a player to place a block. If you make the block a sign, then you just forced the player to place a sign, thus bringing up the sign interface. You could then remove the block which was just placed, and tada!

    Also bringing the interface up is all I care about. I'm not concerned with editing issues once its opened.

    So, how to get a player to place a block? This is completely client side blah blah. There's got to be a way.
    I know creating a new event won't work. That doesn't force the action, but instead collects the information of what happened.

    So then...
     
  22. Offline

    bergerkiller

    In onSignChange, schedule a tick task for the next tick that hides the sign block. Then the sign will disappear. You can use block.sendBlockChange for it. (or player.sendBlockChange, either.)
     
Thread Status:
Not open for further replies.

Share This Page