File tree Expand file tree Collapse file tree 4 files changed +23
-4
lines changed
Expand file tree Collapse file tree 4 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ plugins {
77}
88
99group ' codedcosmos'
10- version ' 1.0 '
10+ version ' 1.1 '
1111mainClassName = ' codedcosmos.enderbot.core.EnderBot'
1212
1313sourceCompatibility = 1.8
Original file line number Diff line number Diff line change 11name : EnderBot
2- version : 1.0
2+ version : 1.1
33author : codedcosmos
44main : codedcosmos.enderbot.plugin.MinecraftPlugin
55api-version : 1.15
Original file line number Diff line number Diff line change 1818
1919public class EnderBot {
2020
21- private static final String VERSION = "1.0 " ;
21+ private static final String VERSION = "1.1 " ;
2222 private static boolean runningInSpigot = false ;
2323
2424 public static void load (boolean runningInSpigot ) {
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ public void onAsyncPlayerChat(AsyncPlayerChatEvent event) {
3434 @ EventHandler
3535 public void onPlayerJoin (PlayerJoinEvent event ) {
3636 for (GuildContext context : Guilds .getContexts ()) {
37- context .getInGameChannel ().sendMessage ("`" +event .getPlayer ().getDisplayName ()+" joined the game`" );
37+ context .getInGameChannel ().sendMessage ("`" +event .getPlayer ().getName ()+" joined the game`" );
3838 }
3939 }
4040
@@ -44,4 +44,23 @@ public void onPlayerQuit(PlayerQuitEvent event) {
4444 context .getInGameChannel ().sendMessage ("`" +event .getPlayer ().getDisplayName ()+" left the game`" );
4545 }
4646 }
47+
48+ public String format (String username ) {
49+ String text = "" ;
50+ boolean skipNext = false ;
51+ for (int i = 0 ; i < username .length (); i ++) {
52+ char c = username .charAt (i );
53+
54+ if (c == '§' ) {
55+ skipNext = true ;
56+ } else if (skipNext ) {
57+ skipNext = false ;
58+ continue ;
59+ } else {
60+ text += username .charAt (i );
61+ }
62+ }
63+
64+ return text ;
65+ }
4766}
You can’t perform that action at this time.
0 commit comments