From 8d45fb453025540a7dfcd524102ec2f78a7183e1 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Sun, 22 Mar 2020 07:31:34 +1000 Subject: [PATCH] 1.1 update --- build.gradle | 2 +- res/plugin.yml | 2 +- src/codedcosmos/enderbot/core/EnderBot.java | 2 +- .../plugin/MinecraftChatListener.java | 21 ++++++++++++++++++- 4 files changed, 23 insertions(+), 4 deletions(-) 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; + } }