perf: 优化代码

This commit is contained in:
2022-10-24 02:12:54 +08:00
parent 9867bf9da9
commit f795289526
4 changed files with 12 additions and 6 deletions

View File

@@ -11,11 +11,11 @@ import org.bukkit.configuration.file.FileConfiguration;
import org.jetbrains.annotations.NotNull;
@SuppressWarnings("unused")
public class CoreBukkitAPI extends CoreAPI {
public final class CoreBukkitAPI extends CoreAPI {
private final BukkitAudiences audienceProvider;
private final HikariDataSource datasource;
public CoreBukkitAPI() {
private CoreBukkitAPI() {
HamsterCorePlugin plugin = HamsterCorePlugin.getInstance();
audienceProvider = BukkitAudiences.create(plugin);
@@ -40,6 +40,9 @@ public class CoreBukkitAPI extends CoreAPI {
}
public static void init() {
if (instance != null) {
return;
}
instance = new CoreBukkitAPI();
}

View File

@@ -8,7 +8,7 @@ import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class ParentLoreCommand extends ParentCommand {
public final class ParentLoreCommand extends ParentCommand {
public static final ParentLoreCommand INSTANCE = new ParentLoreCommand("lore", HamsterCorePlugin.COMMAND_EXECUTOR);
private ParentLoreCommand(@NotNull String name, @Nullable ParentCommand parent) {