package Ġnet . k un mc . lab . discord sign . listener Ċ Ċ import Ġnet . k un mc . lab . discord sign . Channel Type Ċ import Ġnet . k un mc . lab . discord sign . Constants Ċ import Ġnet . k un mc . lab . discord sign . api . Discord Service Ċ import Ġnet . k un mc . lab . discord sign . api . Messenger Ċ import Ġorg . bukkit . event . EventHandler Ċ import Ġorg . bukkit . event . Listener Ċ import Ġorg . bukkit . event . block . Sign ChangeEvent Ċ import Ġorg . bukkit . event . player . Async Player Chat Event Ċ import Ġorg . bukkit . event . player . Player Command Pre process Event Ċ import Ġorg . bukkit . event . player . Player Join Event Ċ import Ġorg . bukkit . event . player . Player Quit Event Ċ import Ġorg . bukkit . plugin . java . Java Plugin Ċ import Ġretrofit 2 . Ret rofit ĊĊ Ċ class ĠDiscord Listener ( private Ġval Ġplugin : ĠJava Plugin ) Ġ: ĠListener Ġ{ ĊĠĠĠ Ġprivate Ġval Ġretrofit Ġ= ĠRet rofit . Builder () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. baseUrl ( Constants . BASE _ URL ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĊĠĠĠ Ġprivate Ġval Ġservice Ġ= Ġretrofit . create ( Discord Service :: class . java ) ĊĊĠĠĠ Ġprivate Ġval Ġmess enger Ġ= ĠMess enger ( service ) ĊĊĠĠĠ Ġ@ EventHandler ĊĠĠĠ Ġfun Ġon Player Join ( event : ĠPlayer Join Event ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġmessage Ġ= Ġ" ãĤµ ãĥ¼ãĥĲãĥ¼ ãģ« ãĥŃãĤ° ãĤ¤ãĥ³ ãģĹãģ¾ãģĹãģŁ " ĊĠĠĠĠĠĠĠ Ġmess enger . send ( event . player , Ġmessage , ĠChannel Type . COMMENT , Ġplugin ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ EventHandler ĊĠĠĠ Ġfun Ġexecute Command ( event : ĠPlayer Command Pre process Event ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġmessage Ġ= Ġ"${ event . message } ĠãĤ³ ãĥŀãĥ³ãĥī ãĤĴå®Łè¡Į ãģĹãģ¾ãģĹãģŁ " ĊĠĠĠĠĠĠĠ Ġmess enger . send ( event . player , Ġmessage , ĠChannel Type . COMMAND , Ġplugin ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ EventHandler ĊĠĠĠ Ġfun Ġtalk Player ( event : ĠAsync Player Chat Event ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġmessage Ġ= Ġ" ãĢĮ ${ event . message } ãĢį " ĊĠĠĠĠĠĠĠ Ġmess enger . send ( event . player , Ġmessage , ĠChannel Type . COMMENT , Ġplugin ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ EventHandler ĊĠĠĠ Ġfun Ġlogout Player ( event : ĠPlayer Quit Event ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġmessage Ġ= Ġ" ãĥŃãĤ° ãĤ¢ ãĤ¦ ãĥĪ ãģĹãģ¾ãģĹãģŁ " ĊĠĠĠĠĠĠĠ Ġmess enger . send ( event . player , Ġmessage , ĠChannel Type . COMMENT , Ġplugin ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ EventHandler ĊĠĠĠ Ġfun Ġon Sign Event ( event : ĠSign ChangeEvent ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġlocation Ġ= Ġevent . block . location ĊĠĠĠĠĠĠĠ Ġval Ġlines Ġ= Ġevent . lines ĊĠĠĠĠĠĠĠ Ġval Ġmessage Ġ= Ġ"${ location . world ?. name } Ġx :${ location . x } Ġy :${ location . y } Ġz :${ location . z } Ġãģ« Ġ${ lines . join ToString (", ")} Ġãģ® çľĭ æĿ¿ ãĤĴ è¨Ń ç½® ãģĹãģ¾ãģĹãģŁ " ĊĠĠĠĠĠĠĠ Ġmess enger . send ( event . player , Ġmessage , ĠChannel Type . SIGN , Ġplugin ) ĊĠĠĠ Ġ} Ċ }