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:
parent
023cff1bbd
commit
2d31e5ac87
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,6 @@ public class EasySQLVelocity {
|
||||
|
||||
@Subscribe
|
||||
public void onInitialize(ProxyInitializeEvent event) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user