Skip to content

Commit 8d45fb4

Browse files
author
BuildTools
committed
1.1 update
1 parent a1d7fa6 commit 8d45fb4

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77
}
88

99
group 'codedcosmos'
10-
version '1.0'
10+
version '1.1'
1111
mainClassName = 'codedcosmos.enderbot.core.EnderBot'
1212

1313
sourceCompatibility = 1.8

res/plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: EnderBot
2-
version: 1.0
2+
version: 1.1
33
author: codedcosmos
44
main: codedcosmos.enderbot.plugin.MinecraftPlugin
55
api-version: 1.15

src/codedcosmos/enderbot/core/EnderBot.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
public 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) {

src/codedcosmos/enderbot/plugin/MinecraftChatListener.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)