[welcomemassage] A Welcome Massage on a sign

Discussion in 'Archived: Plugin Requests' started by TobyTheCool, Feb 26, 2012.

  1. Offline

    TobyTheCool

    Hello Guys,
    WHAT I WANT: A Plugin, which creates a welcome massage on a sign with the ingame name .
    for example: Welcome <player> to this Server
    it would very nice if you answer. :D
     
  2. Offline

    codename_B

    French massage or german massage or swiss massage?

    I prefer japanese massage.
     
    Zeroth likes this.
  3. Offline

    TobyTheCool

    German pls.. :D
     
  4. Offline

    Zeroth

    I don't care what kind of massage it is, as long as it's not deep tissue. Those hurt >.<
     
  5. Offline

    kanda

    So you basically want someone to look at the sign and that it shows his or her name on that sign?
    not entirely sure that can be done :X
     
  6. Offline

    Sanzennin

    Sure it can, and its actually not that hard either.
    How much you want the server to devote resources for it, how foolproof you want it to be, those questions complicate it a bit though.

    Maybe I'll do it if I am not feeling too lazy :p
     
  7. Offline

    turt2live Retired Staff

    It's VERY simple to do.
    The one issue is: What happens when 2+ people login at the same time?
     
  8. Offline

    K_Cin

    This won't be a problem since the server will just order them and the last name will be shown on the sign. If the server wouldn't be able to do this then what would the server log look like?
     
  9. Offline

    turt2live Retired Staff

    True, but it's not a server issue I was mentioning.

    If you didn't see that someone logged in right when you did and you saw a sign with someone else's name on it in front of you, wouldn't you be a bit skeptical about other bugs?
     
  10. How about letting the sign show your name for you, but another name for someone else.
     
  11. Offline

    K_Cin

    Well, that's why most servers put a welcome message in the chat. :p
    Wasn't there some Bukkit method to make the client for example think a block is glowstone whilst all the others and the server think it's dirt?


    EDIT: Too slow. The person above me has the same idea.
     
  12. Offline

    turt2live Retired Staff

    I was also thinking that :p

    I'm working on it now
     
  13. Offline

    K_Cin

    Could you please mention me when you have found the method? It could be useful in the future...
     
  14. Offline

    turt2live Retired Staff

    Will do.

    player.sendBlockChange(Location, Material, byte);

    Location and Material are fairly simple...

    byte is the data, to get the data of a block (as a byte): block.getData().getData(); (yes, 2 getData() calls)

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

    K_Cin

    So in order to make this plugin you'll just have to check the login event plus a sendBlockChange class and you're done.
     
  16. Offline

    turt2live Retired Staff

    Yup, and the enable/disable of which signs to use :p
     
  17. Offline

    K_Cin

    I think you should log a location if a player with the right permission creates a sign with something like "[Welcome]" on it and then on each player login should change those signs. (sendBlockChange)
     
  18. Offline

    Sanzennin

    Mmm, or you could just change the sings text into whoever is looking at it, ya know.
     
  19. Offline

    turt2live Retired Staff

    Then all the signs in the world would say "Welcome <your name>"...

    I was thinking you just beat it with a painting or something
     
  20. Offline

    Sanzennin

    Unless you show different text for regulars, like "[Ohai there], <player>"
     
  21. Offline

    turt2live Retired Staff

    That's what I'm doing >.>

    What I meant is that if you walked by a sign, it would say that instead of it's text. There has to be some sort of system in place to make only specific signs "Welcome" signs.
     
  22. Offline

    Sanzennin

    Yes, ofc you only let it affect the signs found in the database. Basically: 1) Use cmd, add sign with the message for newbies and the message for regulars to the database.
    2) someone looks at a sign
    3) See if the sign is in the database, see if the player is new, fetch the message and modify the sign.
     
  23. Offline

    turt2live Retired Staff

    So do exactly what I already mentioned, just with a command...
     
  24. Offline

    Sanzennin

    You mentioned changing the sign with someone logging in, right?
    Didn't notice ya saying anything about changing the sign on looked at?
     
  25. Offline

    turt2live Retired Staff

    After beating my keyboard for however long I don't think you can do this nicely.

    I've tried sending an updated block, but it doesn't send text.
    I've tried sending a fake packet, but that is also sent to players around the sign.

    So sadly it can't be done with the current API to create a friendly user experience, but it can be done in the sense of faking sign text to NEARBY players.

    There is no event even similar to "Look at sign"

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

    Sanzennin

    Well, what do you think my SNoClip is using?

    Well, I'll take it up, and once have the time to code some, I'll send the results here.

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

    turt2live Retired Staff

    If you want my code, here is the jar (source is compiled in as 'src') http://mc.turt2live.com/plugins/bukkit_not_published/WelcomeSign.jar

    It doesn't have persistence (no config, no saving of the sign list) and it has the bugs I mentioned above.

    It's also hardcoded to use a painting in hand. As well it can be a resource heavy plugin the way I coded it
     
  28. Offline

    Sanzennin

    Thank you, though as I mentioned, I got a project that I can, with a little modification, to copy and use as the base.
    I'll take a look at your code tho, and if it gives me ideas/use some of the code, I'll add you in the credits.

    Wait, do you have the source attached? Or is it just corrupt, since I can't seem to open the source.

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

    turt2live Retired Staff

    It's just placed in the JAR itself,

    WelcomeSign.jar/src/com/turt2live/welcomesign/

    Open it with 7Zip or WinRar
     
  30. Offline

    Sanzennin

    Yeah, I got it now. For some reason, Eclipse just couldn't find the source.
     

Share This Page