Skip to content

Commit

Permalink
1.1 update
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildTools committed Mar 21, 2020
1 parent a1d7fa6 commit 8d45fb4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group 'codedcosmos'
version '1.0'
version '1.1'
mainClassName = 'codedcosmos.enderbot.core.EnderBot'

sourceCompatibility = 1.8
Expand Down
2 changes: 1 addition & 1 deletion res/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: EnderBot
version: 1.0
version: 1.1
author: codedcosmos
main: codedcosmos.enderbot.plugin.MinecraftPlugin
api-version: 1.15
Expand Down
2 changes: 1 addition & 1 deletion src/codedcosmos/enderbot/core/EnderBot.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
21 changes: 20 additions & 1 deletion src/codedcosmos/enderbot/plugin/MinecraftChatListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -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`");
}
}

Expand All @@ -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;
}
}

0 comments on commit 8d45fb4

Please sign in to comment.