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 {
7
7
}
8
8
9
9
group ' codedcosmos'
10
- version ' 1.0 '
10
+ version ' 1.1 '
11
11
mainClassName = ' codedcosmos.enderbot.core.EnderBot'
12
12
13
13
sourceCompatibility = 1.8
Original file line number Diff line number Diff line change 1
1
name : EnderBot
2
- version : 1.0
2
+ version : 1.1
3
3
author : codedcosmos
4
4
main : codedcosmos.enderbot.plugin.MinecraftPlugin
5
5
api-version : 1.15
Original file line number Diff line number Diff line change 18
18
19
19
public class EnderBot {
20
20
21
- private static final String VERSION = "1.0 " ;
21
+ private static final String VERSION = "1.1 " ;
22
22
private static boolean runningInSpigot = false ;
23
23
24
24
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) {
34
34
@ EventHandler
35
35
public void onPlayerJoin (PlayerJoinEvent event ) {
36
36
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`" );
38
38
}
39
39
}
40
40
@@ -44,4 +44,23 @@ public void onPlayerQuit(PlayerQuitEvent event) {
44
44
context .getInGameChannel ().sendMessage ("`" +event .getPlayer ().getDisplayName ()+" left the game`" );
45
45
}
46
46
}
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
+ }
47
66
}
You can’t perform that action at this time.
0 commit comments