Per-World-Chat Plugin (Need new plugin)

Discussion in 'Plugin Requests' started by UnseenMC, Oct 16, 2015.

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

    UnseenMC

    Plugin category: Chat

    Suggested name: FullPerWorldChat

    What I want: I'd like a better per world chat plugin! Currently I use PerWorldChat and it does a good job but when I toggle it off it changes the chat format to something I don't desire. Another problem with it is, it doesn't hide the /me or /say. I would like a plugin that is truly PerWorld.

    Ideas for commands: chat toggle

    Ideas for permissions: chat.toggle

    When I'd like it by: Any Time :)
     
  2. Offline

    Scimiguy

  3. Offline

    UnseenMC

    Thank You! :D
    If you need any details msg me in a conversation. Thanks :)
     
  4. Offline

    Scimiguy

    @UnseenMC

    Sorry, would have been finished earlier but I kept forgetting things

    http://www.claytonia.net/tslat/Hosting/RandomPlugins/TalkToTheWorld.jar

    Built to Minecraft 1.8.8 -- Java 1.8

    Code:
    commands:
      tttw:
        description: Toggle talking to the world
        permission: tttw.command
    permissions:
      tttw.command:
        description: Allows usage of the tttw command
        default: op

    Don't forget to mark this thread as filled if this satisfies you, and liking my post would be nice too ;)

    @UnseenMC
    Oh... oops
    I forgot to tell you, but you can use /tttw check to see if you're talking per-world, or globally

    EDIT by Timtower: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 19, 2015
  5. Offline

    UnseenMC

    Thank You! But when I install the plugin it doesn't seem to generate anything? Help? It shows up double text! :(
     
  6. Offline

    Scimiguy

    @UnseenMC
    Double text? In that chat?

    What do you mean generate anything?

    Worked completely fine for me
     
  7. The chat is popping up like this:

    [Owner] Brett: Hello!
    Brett: Hello!
     
  8. Offline

    Scimiguy

    Sounds like another plugin handling the chat events itself, not sure there's anything I can do
     
    Firestar311 and timtower like this.
  9. Offline

    LordOfPex

    @UnseenMC
    It's probably happening because you have another chat plugin.

    If you're using another chat plugin, Such as EssentialsChat/ChatEx/HeroChat or any other chat manager, Remove it. It's probably the cause :)
     
  10. EssentialsChat is what I have. I am about to try it again.
     
  11. Offline

    Mrs. bwfctower

    Well in your plugin, I assume you're using Player#sendMessage() with the formatted message? Instead, you should use AsyncPlayerChatEvent#setFormat(). This would help to remove any collisions with other plugins.
     
  12. Offline

    Scimiguy

  13. Offline

    Mrs. bwfctower

    When you do it like this, you would put two variables into the format (%s), which will be replaced with the player name and the message. Other plugins get the same AsyncPlayerChatEvent, so if they change it as well still only one message will be sent.

    For example, in your event method:
    Code:
    event.setFormat("<{(%s)}>: %s");
    This would become, say, '<{(mrsbwfctower)}>: Hello!'.

    And if many plugins are changing the format, it would simply use the last one, which would generally be EventPriority.HIGHEST.
     
    Last edited: Nov 6, 2015
  14. omg, it works when I do /tttw but I have 3 requests? :)
    1. Have it automatically enabled when a person joins the server.
    2. Have a config file with the chat format in there
    3. Permissions!
    Amazing otherwise!
     
  15. Offline

    Scimiguy

    @Mrs. bwfctower
    My plugin is already highest priority
    And if another plugin is interfering with the chat, its going to negate this plugin anyway, and so one of them shouldn't be used


    @UnseenMC Network
    I'll add two of those when i can
     
  16. Offline

    Mrs. bwfctower

    Yes but regardless of the priority it will do send two messages, and is better to set the format instead.
     
  17. Offline

    Scimiguy

    Sending two messages allows the user to clearly see there's an issue, rather than it looking like it's working fine, but they're really talking in public.

    If another plugin is handling the chat, then either that plugin should be disabling that functionality, or mine should be removed.

    No need to have both
     
  18. Offline

    shades161

  19. Offline

    Firestar311

    I use AsyncPlayerChat event as well, and what I use to not get double messages in chat with essentials chat install is
    Code:
    event.setCanceled(true);
    This cancels the event and allows you to set the format. Then you can use any checks for the world and send the message.

    I hope this helped!
    If you need any help just ask!
    I know I don't have many public plugins, but I have a custom one that I will be splitting soon!
     
  20. Offline

    timtower Administrator Administrator Moderator

    @Jayfeather311 You don't need to cancel it in order to set the format...
    There even is a setFormat method
     
    Mrs. bwfctower likes this.
  21. Offline

    Firestar311

    @timtower
    I know that, however, it prevents anything else from formatting the chat, therefore no dual messages. It is what I use, again every programmer has their own way.
     
  22. Offline

    timtower Administrator Administrator Moderator

    @Jayfeather311 And nobody is able to modify anything else about the message, spam filters: won't work, formatters: won't work, custom display name: won't always work.
     
    Mrs. bwfctower likes this.
  23. Offline

    Firestar311

    @timtower
    Then again, I use my own spam/word filters and display names, I can use from group manager, those still work if I use the player.getDisplayName() method...

    We should probably stick to the topic at hand, and move this to a private conversation
     
  24. Offline

    timtower Administrator Administrator Moderator

    Keep in mind that you are throwing code into the unknown which could be used to make plugins that aren't that aware of the stuff discussed.
     
  25. Offline

    Firestar311

    @timtower
    As I suggested, we should take this to a private conversation, As this is not part of this Per world chat plugin...

    People coding plugins should be aware of what methods do before using them. And what they are aware of.
     
  26. Offline

    Scimiguy

    I'm aware of what the methods do, and I am not going to use them.
     
  27. Offline

    Firestar311

    @Scimiguy That is your choice, and as I said above, every programmer has their own way of doing things. I too am aware of what the methods do, but with the ones stated above, I find nothing wrong with them, from the posts of you and @timtower it seems that you think they are wrong.
    Correct me if I am wrong on that observation
     
  28. Offline

    Scimiguy

    Im not claiming theyre wrong, im saying that its not an approach i agree with for this instance, and not something i am going to do

    Can we agree todisagree and drop this here?
    Im very much aware of how bukkit works (coincidentally, thats why im helping out here on these forums), and i have no intention of using those particular options for thos case
     
  29. Offline

    Mrs. bwfctower

    Sure. But some programmers have the wrong way of doing things. It's a fine line, and I believe it's crossed if you block out other plugins from doing something when you could use a method that's meant for what you're doing.
    @Scimiguy
     
  30. Offline

    eyamaz

    This thread has gone far from its purpose. If you want to discuss this further, start a new thread in the appropriate section. This thread is now locked.
     
Thread Status:
Not open for further replies.

Share This Page