Skip to content

Commit

Permalink
UltraStaffChat BungeeCord - Version 5.1.1
Browse files Browse the repository at this point in the history
UltraStaffChat BungeeCord - Version 5.1.1
  • Loading branch information
LooFifteen authored Jul 10, 2021
2 parents 9cde7dd + a54da03 commit 07c058d
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ If applicable, add screenshots to help explain your problem.

**Environment**
- OS: [e.g. Ubuntu 20.04]
- Proxy Version: [e.g. BungeeCord 1.16.5]
- UltraStaffChat Version: [e.g. 5.0.0]
- Proxy Version: [e.g. BungeeCord 1.17]
- UltraStaffChat Version: [e.g. 5.1.1]

**Advanced Debug Log**
Please provide an advanced debug log, you can get this using the command `/usc debug --a`
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<groupId>dev.hypera</groupId>
<artifactId>UltraStaffChat</artifactId>
<version>5.1.0</version>
<version>5.1.1</version>
<packaging>jar</packaging>

<name>UltraStaffChat</name>
Expand Down Expand Up @@ -97,15 +97,15 @@
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.16-R0.5-SNAPSHOT</version>
<version>1.17-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

<!-- UpdateLib -->
<dependency>
<groupId>dev.hypera</groupId>
<artifactId>UpdateLib</artifactId>
<version>2.1.2</version>
<version>3.1.2</version>
</dependency>

<!-- Reflections for automatic registry -->
Expand All @@ -119,7 +119,7 @@
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId>
<version>4.7.0</version>
<version>4.8.1</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/dev/hypera/ultrastaffchat/UltraStaffChat.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import dev.hypera.ultrastaffchat.utils.Common;
import dev.hypera.ultrastaffchat.utils.Debug;
import dev.hypera.ultrastaffchat.utils.Discord;
import dev.hypera.updatelib.UpdateLib;
import dev.hypera.updatelib.UpdateLibBuilder;
import dev.hypera.updatelib.internal.UpdateLib;
import net.kyori.adventure.platform.bungeecord.BungeeAudiences;
import net.md_5.bungee.api.plugin.Plugin;
import org.bstats.bungeecord.Metrics;
Expand Down Expand Up @@ -65,10 +65,10 @@ public void onEnable() {
}

adventure = BungeeAudiences.create(this);
updateLib = UpdateLibBuilder.create(getDescription().getVersion(), Common.getResourceId()).setConsumer(response -> {
if(response.isUpdateAvailable())
Common.logPrefix("&cAn update is available! " + getDescription().getVersion() + " -> " + updateLib.getLastResponse().getSpigotVersion());
}).build();
updateLib = UpdateLibBuilder.create(getDescription().getVersion(), Common.getResourceId()).setCompleteAction(status -> {
if(status.isAvailable())
Common.logPrefix("&cAn update is available! " + getDescription().getVersion() + " -> " + status.getDistributedVersion());
}).setErrorHandler(error -> {}).build();

ListenerManager.setup();
CommandManager.setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public void onPostJoin(PostLoginEvent event) {
}

if(UltraStaffChat.getConfig().getBoolean("update-enabled") && Common.hasPermission(event.getPlayer(), Common.messageRaw("permission-update"))) {
if(null != UltraStaffChat.getInstance().getUpdateLib().getLastResponse() && UltraStaffChat.getInstance().getUpdateLib().getLastResponse().isUpdateAvailable()) {
UltraStaffChat.getInstance().getAdventure().player(event.getPlayer()).sendMessage(Common.adventurise(Common.messageRaw("update-message").replace("{version}", UltraStaffChat.getInstance().getUpdateLib().getLastResponse().getSpigotVersion()).replace("{current}", UltraStaffChat.getInstance().getDescription().getVersion())));
if(null != UltraStaffChat.getInstance().getUpdateLib().getLastStatus() && UltraStaffChat.getInstance().getUpdateLib().getLastStatus().isAvailable()) {
UltraStaffChat.getInstance().getAdventure().player(event.getPlayer()).sendMessage(Common.adventurise(Common.messageRaw("update-message").replace("{version}", UltraStaffChat.getInstance().getUpdateLib().getLastStatus().getDistributedVersion()).replace("{current}", UltraStaffChat.getInstance().getDescription().getVersion())));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dev/hypera/ultrastaffchat/utils/Discord.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

public class Discord {

private static final String footer = "UltraStaffChat - Bungeecord v" + UltraStaffChat.getInstance().getDescription().getVersion();
private static final String footer = "UltraStaffChat - BungeeCord v" + UltraStaffChat.getInstance().getDescription().getVersion();
private static final String footerUrl = "https://i.hypera.dev/assets/hypera-icon-white.png";
private static boolean enabled = false;
private static String hookURL = "";
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/dev/hypera/ultrastaffchat/utils/MD_.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ private static void parsePart(String part, StringBuilder builder) {
continue;
}
if (isFormat(ChatColor.getByChar(cc.charAt(0)))) {
colorBuilder.append(ChatColor.COLOR_CHAR + cc);
colorBuilder.append(ChatColor.COLOR_CHAR).append(cc);
}
}
builder.append(color + colorBuilder.toString());
builder.append(color).append(colorBuilder);
} else {
colors = parseColours(colorCharacter, builder, colors);
}
Expand All @@ -100,7 +100,7 @@ private static String parseColours(char colorCharacter, StringBuilder builder, S
else if (colorCharacter == 'Q') colors = colors.replace(ChatColor.ITALIC.toString(), "");
else if (colorCharacter == 'M') colors = colors.replace(ChatColor.STRIKETHROUGH.toString(), "");
else if (colorCharacter == 'W') colors = colors.replace(ChatColor.MAGIC.toString(), "");
if (Character.isUpperCase(colorCharacter)) builder.append(ChatColor.RESET + colors);
if (Character.isUpperCase(colorCharacter)) builder.append(ChatColor.RESET).append(colors);
return colors;
}

Expand All @@ -115,7 +115,7 @@ private static String replaceWith(String message, String quot, String pre, Strin
public static List<String> getMatches(String string, String regex) {
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(string);
List<String> matches = new ArrayList<String>();
List<String> matches = new ArrayList<>();
while (matcher.find()) {
matches.add(matcher.group(1));
}
Expand All @@ -138,7 +138,7 @@ private static String getLastColors(String input) {
ChatColor color = ChatColor.getByChar(c);

if (color != null) {
result = color.toString() + result;
result = color + result;

// Once we find a color or reset we can stop searching
if (!isFormat(color) || color.equals(ChatColor.RESET)) {
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
# Helpful Links:
# Support | https://discord.hypera.dev
# Documentation | https://docs.hypera.dev/docs/ultrastaffchat-bungeecord
# Source Code | https://github.com/HyperaOfficial/UltraStaffChat



Expand Down

0 comments on commit 07c058d

Please sign in to comment.