Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream #22

Merged
merged 3 commits into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Essentials/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ dependencies {

api 'io.papermc:paperlib:1.0.6'

implementation 'org.spongepowered:configurate-yaml:4.1.2'
implementation 'org.checkerframework:checker-qual:3.21.0'
implementation 'org.spongepowered:configurate-yaml:4.2.0'
implementation 'org.checkerframework:checker-qual:3.49.0'
implementation 'nu.studer:java-ordered-properties:1.0.4'

implementation 'net.kyori:adventure-api:4.18.0'
implementation 'net.kyori:adventure-text-minimessage:4.18.0'
implementation 'net.kyori:adventure-api:4.19.0'
implementation 'net.kyori:adventure-text-minimessage:4.19.0'
implementation 'net.kyori:adventure-platform-bukkit:4.3.4'

// Providers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ public void run() {
playtime = user.getBase().getStatistic(PLAY_ONE_TICK);
}
// Play time in seconds
final long playTimeSecs = playtime / 20;
final long playTimeSecs = Math.max(playtime / 20, 0);

// Checking if player meets the requirements of minimum balance and minimum playtime to be listed in baltop list
if ((ess.getSettings().showZeroBaltop() || balance.compareTo(BigDecimal.ZERO) > 0)
&& balance.compareTo(ess.getSettings().getBaltopMinBalance()) >= 0 &&
playTimeSecs > ess.getSettings().getBaltopMinPlaytime()) {
playTimeSecs >= ess.getSettings().getBaltopMinPlaytime()) {
newCache.getLines().add(AdventureUtil.miniToLegacy(tlLiteral("balanceTopLine", pos, entry.getValue().getDisplayName(), AdventureUtil.parsed(NumberUtil.displayCurrency(balance, ess)))));
}
pos++;
Expand Down
2 changes: 1 addition & 1 deletion EssentialsDiscord/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

dependencies {
compileOnly project(':EssentialsX')
implementation('net.dv8tion:JDA:5.1.2') {
implementation('net.dv8tion:JDA:5.3.0') {
exclude(module: 'opus-java')
}
implementation 'com.github.MinnDevelopment:emoji-java:v6.1.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class PaperChatListener extends PaperChatListenerProvider {
private final JDADiscordService jda;

public PaperChatListener(JDADiscordService jda) {
super(false);
this.jda = jda;
}

Expand Down
2 changes: 1 addition & 1 deletion build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ repositories {

dependencies {
implementation("net.kyori", "indra-common", "3.1.3")
implementation("com.gradleup.shadow", "shadow-gradle-plugin", "8.3.3")
implementation("com.gradleup.shadow", "shadow-gradle-plugin", "8.3.6")
implementation("xyz.jpenilla", "run-task", "2.3.1")
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@
import java.util.Map;

public abstract class PaperChatListenerProvider implements Listener {
private final boolean formatParsing;
private final LegacyComponentSerializer serializer;
private final Map<AsyncChatEvent, PaperChatEvent> eventMap = new IdentityHashMap<>();

public PaperChatListenerProvider() {
this(true);
}

public PaperChatListenerProvider(final boolean formatParsing) {
this.formatParsing = formatParsing;
this.serializer = LegacyComponentSerializer.builder()
.flattener(ComponentFlattener.basic())
.extractUrls(AbstractChatEvent.URL_PATTERN)
Expand Down Expand Up @@ -59,6 +65,10 @@ public final void onHighest(final AsyncChatEvent event) {
return;
}

if (!formatParsing) {
return;
}

final TextComponent format = serializer.deserialize(paperChatEvent.getFormat());
final TextComponent eventMessage = serializer.deserialize(paperChatEvent.getMessage());

Expand Down
Loading