Making a minecraft mod like Improved Chat

Discussion in 'Miscellaneous' started by d1223m, Mar 11, 2012.

Thread Status:
Not open for further replies.
  1. I lol'd. I am really liking the mod D1! Keep up the great work!
  2. Thanks!
  3. I have got tabs working but there is a problem....

    When the server sends very long chat messages it seems to split them up in a not very usefull way...

    Here I send a very long message to the server ( the line starting with execInput ). Then the server sends me back my chat message. Note how it has split up the message into lines but not all of them start with "?2T " (the green T we see for town chat )
    Code:
    execInput sdfasdfs alskdhfl kjsahdflk jahsdlfkjh alsdfjkhl askjdhfl aksjdhfl akjshdfl ajs kdhlasjkdhf laksjdfhl askjdfhl askjdfhlkajsdfl akjshdfl kajshdfl kajshdfl kasjhdfl akjshdfl kajshdfl kajshdfl kajshdfl kajhsdfl kajdlsfjals jkdfh alskjdflaksjflakjshdfl akjshdfl kajshdfl jadls fkjahsdl fjalsdkjfhalskjlas
    
    handleChat 69 ?2T ?f?2d1223m: ?fsdfasdfs alskdhfl kjsahdflk jahsdlfkjh alsdfjkhl as
    handleChat 49 kjdhfl aksjdhfl akjshdfl ajs kdhlasjkdhf laksjdfh
    handleChat 69 ?2T ?f?2d1223m: ?fl askjdfhl askjdfhlkajsdfl akjshdfl kajshdfl kajshd
    handleChat 49 fl kasjhdfl akjshdfl kajshdfl kajshdfl kajshdfl k
    handleChat 69 ?2T ?f?2d1223m: ?fajhsdfl kajdlsfjals jkdfh alskjdflaksjflakjshdfl ak
    handleChat 49 jshdfl kajshdfl jadls fkjahsdl fjalsdkjfhalskjlas
    
    This is a problem for my tabs because the lines not starting with "?2T " are not getting sent to the correct tab. I dont know at the moment if this is a problem specifc to MC or bukit or EMC.
  4. After a quick test against a vanilla this doesnt seem to happen - so its bukkit or EMC...
  5. It is bukkit I am sure. The ?2T's are separate messages, the normal vanilla client won't do that (with improved chat when the text goes red it is going to split it into more messages).
  6. How do you mean seperate messages? They come in as one chat packet as far as i can see ( the handleChat lines outputed there are printed out at the point where MC recieves them ) - unless I need to dig deeper into the network code...

    Really I think the color codes are just part of the chat message.

    (Thanks for replying :))
  7. is the order of the continuation garunteed? as in, is the message following the one that starts with ?2T garunteed to be a part of that proceeding message?

    If so, could you just store the tab that the last message that started with ?2T and send any following messages to that tab, then change it when the next message that starts with ?2T ?
  8. Yes Im definatly thinking some hack like this is going to be best - dont really want to throw away my tabs because of weirdo behaviour
  9. [usual disclaimer - see previous posts]

    CHAT TABS ARE HERE!

    This is the config Im using:
    Code:
    set chat_tab_fix "true"
    set prompt_auto_close "false"
    set output_max_history "500"
    on -start "Welcome to Empire Minecraft server" exec "print connected; unset tell; set whichchat T; setpromptifnottell"
    on -start "Set focus on Town" exec "set whichchat T; setpromptifnottell"
    on -start "Set focus on Moderators" exec "set whichchat M; setpromptifnottell"
    on -start "Set focus on Local" exec "set whichchat L; setpromptifnottell"
    on -start "Set focus on Supporters" exec "set whichchat S; setpromptifnottell"
    on -start "Started conversation with" exec "set tell 1; set prompt TELL>"
    on -start "Ended your conversation" exec "unset tell; setpromptifnottell"
    on -start "You bought" settab -create  "Shop"
    on -start "You sold" settab -create  "Shop"
    on -regexp "^To (.+?):" settab -create  "\$(1)"
    on -regexp "^From (.+?):" settab -create  "\$(1)"
    on -start "T " settab -create  "Town"
    on -start "L " settab -create  "Local"
    on -start "M " settab -create  "Mod"
    on -start "S " settab -create  "Sup."
    define setpromptifnottell exec -ifnset  "tell" "set" "prompt" "\$(whichchat)>"
    
    The important bit is `set chat_tab_fix true` - this adds a little hack to fix the weird line problem I was having earlier.

    You can switch tabs by either typing the very long `~activetab <tabname>` or by using control + page-up/down after pressing t to chat.

    I think overall its quite pleasant to use. The problem is with switching tabs quickly - Im thinking to make control + 1/2/3/4/5/6/7/8/9 switch to that tab number.

    Oh - to close tabs use `~untab <tabname>` :)

    Attached Files:

  10. please stop being captin obvious. i meant it shows everyone online on all SMP servers.
  11. Stop being oblivious to standard features and I wont have to be "captin obvious" by pointing them out to you.
    We have that, it is the /who feature. :) Next time you are online, try doing /who smp1 (this will show all players on smp1 at that moment in time. You just change smp1 with smp2/smp3/smp4/smp5/smp6/smp7/Utopia).

    To see who is online on the forums, we have a nifty feature for that too:

  12. Anway... the tabs... anyone try them yet? :)
  13. I'm taking a class soon to learn Java, but from what I've seen it is difficult to make mods that cooperate well with server plug-ins
  14. You stole my name! :eek:
  15. I have yet to test the updated version... Sorry, I am on my way to the hospital for a sleep study... I wont be back home until tomorrow afternoon...
  16. Wewt. You have to update your mod for the first time :D
  17. Mojang partially broke your mod. ;)

    Concerning 1.2.4

    Jeb said:
    While I was away at Game Developer’s Conference and a short vacation, the new Minecraft members Dinnerbone, Tahg, Grum and EvilSeph were hard at work fixing multiple bugs in Minecraft 1.2. The patch contains mainly bug fixes, but we also threw in a couple of goodies:
    • Chat history
    • Much better chat editing and controls (you can even mark text!)
    • Some new decoration blocks
    MR2R2M likes this.
  18. Waiting for the MCP guys to do their thing and ill republish it as soon as possible :)
  19. Yea - annoyed that they included chat stuff! Apparently the history is very small tho (according to someone in MCP) and wont include all my features - so hopefully this is still useful...
Thread Status:
Not open for further replies.