Skip to content

Commit

Permalink
refactor: code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
HappyAreaBean committed Dec 4, 2023
1 parent 72add24 commit 29bb6f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/main/java/cc/happyareabean/sjm/commands/SJMCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import net.kyori.adventure.text.event.ClickEvent;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.TextDecoration;
import org.bukkit.permissions.PermissionDefault;
import revxrsal.commands.annotation.Command;
import revxrsal.commands.annotation.Default;
import revxrsal.commands.annotation.DefaultFor;
Expand Down Expand Up @@ -36,7 +37,7 @@
@CommandPermission("sjm.admin")
public class SJMCommand {

@DefaultFor({"simplejoinmessage", "sjm"})
@DefaultFor({"~"})
@Description("SimpleJoinMessage commands list")
public void help(BukkitCommandActor actor, CommandHelp<String> helpEntries, @Default("1") int page) {
List<Component> list = new ArrayList<>();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/cc/happyareabean/sjm/utils/MessageUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static void sendMessageDelay(Player player, final List<String> messages,
SJMConfig config = SimpleJoinMessage.getInstance().getSJMConfig();
DateTimeFormatter formatter =
DateTimeFormatter.ofPattern(config.getTimeFormat())
.withZone( ZoneId.systemDefault() );
.withZone(ZoneId.systemDefault());
new BukkitRunnable() {
@Override
public void run() {
Expand All @@ -34,6 +34,6 @@ public void run() {
.replace("{time}", formatter.format(Instant.now()))));
aPlayer.sendMessage(SimpleJoinMessage.MINIMESSAGE.deserialize(String.join("\n", (SimpleJoinMessage.getInstance().isPAPISupported() ? PlaceholderAPI.setPlaceholders(player, newMessage) : newMessage))));
}
}.runTaskLater(SimpleJoinMessage.getInstance(), (delayTicks > 0 ? delayTicks : 1L));
}.runTaskLaterAsynchronously(SimpleJoinMessage.getInstance(), (delayTicks > 0 ? delayTicks : 1L));
}
}

0 comments on commit 29bb6f5

Please sign in to comment.