Sign Menu

Discussion in 'Plugin Development' started by Tecno_Wizard, Dec 19, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Tecno_Wizard

    Evening,
    Is there a way that I can send a sign menu packet to a player and receive the lines they typed back in the plugin? For example, if I wanted a multi line password, how could I get the sign menu up on the player's screen, have them enter the password they want on each line, and then receive the lines in a string array in the server?
    I've tried looking this up but I have no experience whatsoever with manipulating packets.

    EDIT: I am aware that this is in the wrong section and I have requested it to be moved.
    EDIT2: Fixed.
     
    Last edited: Dec 19, 2014
  2. Offline

    Skionz

    @Tecno_Wizard I doubt you can do this although I may be wrong. I saw someone do something similar to this with an anvil.
     
  3. Offline

    adam753

    [insert self-deprecating comment about how I've never used packets or protocollib before]
    I guess you'd send one of these to the player: http://wiki.vg/Protocol#Sign_Editor_Open
    And then catch this: http://wiki.vg/Protocol#Update_Sign
    As far as I can tell, the only defining characteristic sent to the client is the block location of the sign. So, every time a player wants to do this, you'd have to generate a fake location where there definitely won't be a real sign, then check that location against the one in any future "update sign" packet received by the server.
     
  4. Offline

    Tecno_Wizard

    @adam753, @Skionz, when all else fails, build random signs! But seriously, could I intercept that packet, cancel the change of the sign that doesnt exist (before it throws an error), and just save that array?
    Edit: Yea, heck no. LAAAAAGGGGG. Well, looks like it's floating signs at a configurable location then. Actually, would anyone like me to make this into an API?
     
  5. Offline

    mythbusterma

  6. Offline

    Tecno_Wizard

    @mythbusterma, it would throw an event every time a packet is received... Plus i would have to custom create the event.
     
  7. Offline

    mythbusterma

    @Tecno_Wizard

    Creating and calling an event is not a particularly expensive operation...besides, why would you have to do that? Protocol lib does that for you already.
     
  8. Offline

    Webbeh

  9. Offline

    Tecno_Wizard

    @mythbusterma, yea, while i am not new to Java i'm still fairly new to bukkit. And @Webbeh, i'll go look at that now.
     
  10. Offline

    Webbeh

    Well, apparently he added craftbukkit compatibility but removed his github from that page. I'll see if I can get the link back.
     
  11. Offline

    adam753

    @Tecno_Wizard
    Pretty sure you could intercept the packet without there needing to actually be a sign. I don't see how this would cause a lag issue.
     
  12. Offline

    Tecno_Wizard

    @adam753, that was before someone suggested ProtocalLib, but it will still require a location. I'll probably use the chest's if it allows that.
     
Thread Status:
Not open for further replies.

Share This Page