Skip to content

Commit

Permalink
cube's in my walls wtf (code cleanup)
Browse files Browse the repository at this point in the history
  • Loading branch information
DoggySazHi committed May 23, 2024
1 parent ea35fd4 commit 8e932ba
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ public int hashCode() {
}
}

public static record User(UUID uuid, String lastKnownName, String defaultLanguage, TranslationMode translationMode) {}
public record User(UUID uuid, String lastKnownName, String defaultLanguage, TranslationMode translationMode) {}

public static enum TranslationMode {
public enum TranslationMode {
OFF(0), ON(1), FORCE(2);
private final int value;

private TranslationMode(int value) {
TranslationMode(int value) {
this.value = value;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package net.gensokyoreimagined.motoori;

import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.event.ClickEvent;
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
import org.bukkit.entity.Player;
Expand Down Expand Up @@ -108,11 +107,9 @@ public Component removeUnwantedSyntax(Component message) {
private final Pattern URL_PATTERN = Pattern.compile(URL_REGEX);

public Component makeLinksClickable(Component message) {
return message.replaceText((text) -> {
text.match(URL_PATTERN).replacement((match) -> {
var url = match.content();
return Component.text(url).clickEvent(ClickEvent.openUrl(url));
});
});
return message.replaceText((text) -> text.match(URL_PATTERN).replacement((match) -> {
var url = match.content();
return Component.text(url).clickEvent(ClickEvent.openUrl(url));
}));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,7 @@ public UUID addMessage(@NotNull String json, @NotNull String message) {
UUID uuid = UUID.randomUUID();

// Invoke addMessageSQL asynchronously
kosuzu.getServer().getScheduler().runTaskAsynchronously(kosuzu, () -> {
addMessageSQL(uuid, json, message);
});
kosuzu.getServer().getScheduler().runTaskAsynchronously(kosuzu, () -> addMessageSQL(uuid, json, message));

return uuid;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ public static class DeepLMobileParams {
DeepLMobileLanguage lang;
@SerializedName("timestamp")
long timestamp;
// @SerializedName("commonJobParams")
// DeepLMobileCommonJobParams commonJobParams;

DeepLMobileParams(String input, String targetLanguage) {
texts = List.of(new DeepLMobileText(input));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.Objects;
import java.util.logging.Logger;

@SuppressWarnings("UnstableApiUsage")
public class KosuzuUnderstandsEverything implements Listener {
private final Logger logger;
private final KosuzuRemembersEverything database;
Expand Down

0 comments on commit 8e932ba

Please sign in to comment.