Skip to content

Commit 29bb6f5

Browse files
committed
refactor: code clean up
1 parent 72add24 commit 29bb6f5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/main/java/cc/happyareabean/sjm/commands/SJMCommand.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import net.kyori.adventure.text.event.ClickEvent;
1010
import net.kyori.adventure.text.format.NamedTextColor;
1111
import net.kyori.adventure.text.format.TextDecoration;
12+
import org.bukkit.permissions.PermissionDefault;
1213
import revxrsal.commands.annotation.Command;
1314
import revxrsal.commands.annotation.Default;
1415
import revxrsal.commands.annotation.DefaultFor;
@@ -36,7 +37,7 @@
3637
@CommandPermission("sjm.admin")
3738
public class SJMCommand {
3839

39-
@DefaultFor({"simplejoinmessage", "sjm"})
40+
@DefaultFor({"~"})
4041
@Description("SimpleJoinMessage commands list")
4142
public void help(BukkitCommandActor actor, CommandHelp<String> helpEntries, @Default("1") int page) {
4243
List<Component> list = new ArrayList<>();

src/main/java/cc/happyareabean/sjm/utils/MessageUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public static void sendMessageDelay(Player player, final List<String> messages,
2424
SJMConfig config = SimpleJoinMessage.getInstance().getSJMConfig();
2525
DateTimeFormatter formatter =
2626
DateTimeFormatter.ofPattern(config.getTimeFormat())
27-
.withZone( ZoneId.systemDefault() );
27+
.withZone(ZoneId.systemDefault());
2828
new BukkitRunnable() {
2929
@Override
3030
public void run() {
@@ -34,6 +34,6 @@ public void run() {
3434
.replace("{time}", formatter.format(Instant.now()))));
3535
aPlayer.sendMessage(SimpleJoinMessage.MINIMESSAGE.deserialize(String.join("\n", (SimpleJoinMessage.getInstance().isPAPISupported() ? PlaceholderAPI.setPlaceholders(player, newMessage) : newMessage))));
3636
}
37-
}.runTaskLater(SimpleJoinMessage.getInstance(), (delayTicks > 0 ? delayTicks : 1L));
37+
}.runTaskLaterAsynchronously(SimpleJoinMessage.getInstance(), (delayTicks > 0 ? delayTicks : 1L));
3838
}
3939
}

0 commit comments

Comments
 (0)