1
mirror of https://github.com/CarmJos/MineSQL.git synced 2024-09-19 20:25:45 +00:00

add getSqlManager method

This commit is contained in:
Ghost_chu 2022-02-04 14:06:46 +08:00
parent 023cff1bbd
commit 2d31e5ac87
4 changed files with 34 additions and 1 deletions

View File

@ -1,4 +1,15 @@
package cc.carm.plugin.easysql.api;
import cc.carm.lib.easysql.api.SQLManager;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public interface EasySQLPluginPlatform {
/**
* 获取 SQL 管理器
* @param name 注册键
* @return SQL管理器
*/
@Nullable
SQLManager getSqlManager(@NotNull String name);
}

View File

@ -14,6 +14,7 @@ import org.bukkit.event.server.PluginDisableEvent;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class EasySQLBukkit extends JavaPlugin implements EasySQLPluginPlatform, Listener {
private EasySQLAPI apiImpl;
@ -107,4 +108,14 @@ public class EasySQLBukkit extends JavaPlugin implements EasySQLPluginPlatform,
this.apiImpl.unregisterSQLManagerAll(plugin.getName());
}
/**
* 获取 SQL 管理器
*
* @param name 注册键
* @return SQL管理器
*/
@Override
public @Nullable SQLManager getSqlManager(@NotNull String name) {
return this.apiImpl.getSQLManager(name);
}
}

View File

@ -10,6 +10,7 @@ import net.md_5.bungee.config.Configuration;
import net.md_5.bungee.config.ConfigurationProvider;
import net.md_5.bungee.config.YamlConfiguration;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.io.IOException;
@ -123,4 +124,15 @@ public class EasySQLBungee extends Plugin implements EasySQLPluginPlatform {
public void unregister(@NotNull Plugin plugin){
this.apiImpl.unregisterSQLManagerAll(plugin.getDescription().getName());
}
/**
* 获取 SQL 管理器
*
* @param name 注册键
* @return SQL管理器
*/
@Override
public @Nullable SQLManager getSqlManager(@NotNull String name) {
return this.apiImpl.getSQLManager(name);
}
}

View File

@ -44,7 +44,6 @@ public class EasySQLVelocity {
@Subscribe
public void onInitialize(ProxyInitializeEvent event) {
}
}