diff --git a/build.gradle b/build.gradle index e38b019..d039f17 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ plugins { } group 'codedcosmos' -version '1.0' +version '1.1' mainClassName = 'codedcosmos.enderbot.core.EnderBot' sourceCompatibility = 1.8 diff --git a/res/plugin.yml b/res/plugin.yml index f5684d7..62b5861 100644 --- a/res/plugin.yml +++ b/res/plugin.yml @@ -1,5 +1,5 @@ name: EnderBot -version: 1.0 +version: 1.1 author: codedcosmos main: codedcosmos.enderbot.plugin.MinecraftPlugin api-version: 1.15 diff --git a/src/codedcosmos/enderbot/core/EnderBot.java b/src/codedcosmos/enderbot/core/EnderBot.java index 0efa159..0f7d701 100644 --- a/src/codedcosmos/enderbot/core/EnderBot.java +++ b/src/codedcosmos/enderbot/core/EnderBot.java @@ -18,7 +18,7 @@ public class EnderBot { - private static final String VERSION = "1.0"; + private static final String VERSION = "1.1"; private static boolean runningInSpigot = false; public static void load(boolean runningInSpigot) { diff --git a/src/codedcosmos/enderbot/plugin/MinecraftChatListener.java b/src/codedcosmos/enderbot/plugin/MinecraftChatListener.java index 04f45c0..42e3399 100644 --- a/src/codedcosmos/enderbot/plugin/MinecraftChatListener.java +++ b/src/codedcosmos/enderbot/plugin/MinecraftChatListener.java @@ -34,7 +34,7 @@ public void onAsyncPlayerChat(AsyncPlayerChatEvent event) { @EventHandler public void onPlayerJoin(PlayerJoinEvent event) { for (GuildContext context : Guilds.getContexts()) { - context.getInGameChannel().sendMessage("`"+event.getPlayer().getDisplayName()+" joined the game`"); + context.getInGameChannel().sendMessage("`"+event.getPlayer().getName()+" joined the game`"); } } @@ -44,4 +44,23 @@ public void onPlayerQuit(PlayerQuitEvent event) { context.getInGameChannel().sendMessage("`"+event.getPlayer().getDisplayName()+" left the game`"); } } + + public String format(String username) { + String text = ""; + boolean skipNext = false; + for (int i = 0; i < username.length(); i++) { + char c = username.charAt(i); + + if (c == 'ยง') { + skipNext = true; + } else if (skipNext) { + skipNext = false; + continue; + } else { + text += username.charAt(i); + } + } + + return text; + } }