Skip to content

Commit 07c058d

Browse files
authored
UltraStaffChat BungeeCord - Version 5.1.1
UltraStaffChat BungeeCord - Version 5.1.1
2 parents 9cde7dd + a54da03 commit 07c058d

7 files changed

Lines changed: 20 additions & 19 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ If applicable, add screenshots to help explain your problem.
2121

2222
**Environment**
2323
- OS: [e.g. Ubuntu 20.04]
24-
- Proxy Version: [e.g. BungeeCord 1.16.5]
25-
- UltraStaffChat Version: [e.g. 5.0.0]
24+
- Proxy Version: [e.g. BungeeCord 1.17]
25+
- UltraStaffChat Version: [e.g. 5.1.1]
2626

2727
**Advanced Debug Log**
2828
Please provide an advanced debug log, you can get this using the command `/usc debug --a`

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
<groupId>dev.hypera</groupId>
2626
<artifactId>UltraStaffChat</artifactId>
27-
<version>5.1.0</version>
27+
<version>5.1.1</version>
2828
<packaging>jar</packaging>
2929

3030
<name>UltraStaffChat</name>
@@ -97,15 +97,15 @@
9797
<dependency>
9898
<groupId>net.md-5</groupId>
9999
<artifactId>bungeecord-api</artifactId>
100-
<version>1.16-R0.5-SNAPSHOT</version>
100+
<version>1.17-R0.1-SNAPSHOT</version>
101101
<scope>provided</scope>
102102
</dependency>
103103

104104
<!-- UpdateLib -->
105105
<dependency>
106106
<groupId>dev.hypera</groupId>
107107
<artifactId>UpdateLib</artifactId>
108-
<version>2.1.2</version>
108+
<version>3.1.2</version>
109109
</dependency>
110110

111111
<!-- Reflections for automatic registry -->
@@ -119,7 +119,7 @@
119119
<dependency>
120120
<groupId>net.kyori</groupId>
121121
<artifactId>adventure-api</artifactId>
122-
<version>4.7.0</version>
122+
<version>4.8.1</version>
123123
</dependency>
124124
<dependency>
125125
<groupId>net.kyori</groupId>

src/main/java/dev/hypera/ultrastaffchat/UltraStaffChat.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
import dev.hypera.ultrastaffchat.utils.Common;
2626
import dev.hypera.ultrastaffchat.utils.Debug;
2727
import dev.hypera.ultrastaffchat.utils.Discord;
28+
import dev.hypera.updatelib.UpdateLib;
2829
import dev.hypera.updatelib.UpdateLibBuilder;
29-
import dev.hypera.updatelib.internal.UpdateLib;
3030
import net.kyori.adventure.platform.bungeecord.BungeeAudiences;
3131
import net.md_5.bungee.api.plugin.Plugin;
3232
import org.bstats.bungeecord.Metrics;
@@ -65,10 +65,10 @@ public void onEnable() {
6565
}
6666

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

7373
ListenerManager.setup();
7474
CommandManager.setup();

src/main/java/dev/hypera/ultrastaffchat/listeners/impl/JoinLeaveListener.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public void onPostJoin(PostLoginEvent event) {
3939
}
4040

4141
if(UltraStaffChat.getConfig().getBoolean("update-enabled") && Common.hasPermission(event.getPlayer(), Common.messageRaw("permission-update"))) {
42-
if(null != UltraStaffChat.getInstance().getUpdateLib().getLastResponse() && UltraStaffChat.getInstance().getUpdateLib().getLastResponse().isUpdateAvailable()) {
43-
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())));
42+
if(null != UltraStaffChat.getInstance().getUpdateLib().getLastStatus() && UltraStaffChat.getInstance().getUpdateLib().getLastStatus().isAvailable()) {
43+
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())));
4444
}
4545
}
4646

src/main/java/dev/hypera/ultrastaffchat/utils/Discord.java

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

3131
public class Discord {
3232

33-
private static final String footer = "UltraStaffChat - Bungeecord v" + UltraStaffChat.getInstance().getDescription().getVersion();
33+
private static final String footer = "UltraStaffChat - BungeeCord v" + UltraStaffChat.getInstance().getDescription().getVersion();
3434
private static final String footerUrl = "https://i.hypera.dev/assets/hypera-icon-white.png";
3535
private static boolean enabled = false;
3636
private static String hookURL = "";

src/main/java/dev/hypera/ultrastaffchat/utils/MD_.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ private static void parsePart(String part, StringBuilder builder) {
7474
continue;
7575
}
7676
if (isFormat(ChatColor.getByChar(cc.charAt(0)))) {
77-
colorBuilder.append(ChatColor.COLOR_CHAR + cc);
77+
colorBuilder.append(ChatColor.COLOR_CHAR).append(cc);
7878
}
7979
}
80-
builder.append(color + colorBuilder.toString());
80+
builder.append(color).append(colorBuilder);
8181
} else {
8282
colors = parseColours(colorCharacter, builder, colors);
8383
}
@@ -100,7 +100,7 @@ private static String parseColours(char colorCharacter, StringBuilder builder, S
100100
else if (colorCharacter == 'Q') colors = colors.replace(ChatColor.ITALIC.toString(), "");
101101
else if (colorCharacter == 'M') colors = colors.replace(ChatColor.STRIKETHROUGH.toString(), "");
102102
else if (colorCharacter == 'W') colors = colors.replace(ChatColor.MAGIC.toString(), "");
103-
if (Character.isUpperCase(colorCharacter)) builder.append(ChatColor.RESET + colors);
103+
if (Character.isUpperCase(colorCharacter)) builder.append(ChatColor.RESET).append(colors);
104104
return colors;
105105
}
106106

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

140140
if (color != null) {
141-
result = color.toString() + result;
141+
result = color + result;
142142

143143
// Once we find a color or reset we can stop searching
144144
if (!isFormat(color) || color.equals(ChatColor.RESET)) {

src/main/resources/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
# Helpful Links:
2424
# Support | https://discord.hypera.dev
2525
# Documentation | https://docs.hypera.dev/docs/ultrastaffchat-bungeecord
26+
# Source Code | https://github.com/HyperaOfficial/UltraStaffChat
2627

2728

2829

0 commit comments

Comments
 (0)