本文整理汇总了Java中com.mengcraft.simpleorm.EbeanManager类的典型用法代码示例。如果您正苦于以下问题:Java EbeanManager类的具体用法?Java EbeanManager怎么用?Java EbeanManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EbeanManager类属于com.mengcraft.simpleorm包,在下文中一共展示了EbeanManager类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onEnable
import com.mengcraft.simpleorm.EbeanManager; //导入依赖的package包/类
@Override
public void onEnable() {
val db = EbeanManager.DEFAULT.getHandler(this);
if (db.isNotInitialized()) {
db.define(Log.class);
db.define(PP.class);
db.define(PointRanking.class);
try {
db.initialize();
} catch (DatabaseException e) {
throw new RuntimeException(e);
}
db.install();
db.reflect();
}
database = db.getServer();
PlayerPointsAPI.init(this, database);
}
开发者ID:caoli5288,项目名称:economy,代码行数:19,代码来源:PlayerPoints.java
示例2: onEnable
import com.mengcraft.simpleorm.EbeanManager; //导入依赖的package包/类
@Override
@SneakyThrows
public void onEnable() {
EbeanHandler db = EbeanManager.DEFAULT.getHandler(this);
if (db.isNotInitialized()) {
db.define(Bean.class);
db.initialize();
db.install();
}
database = db.getServer();
hook = new MyHook();
hook.hook();
PluginHelper.addExecutor(this, "i5chatcolor", "i5chatcolor.admin", this::execute);
}
开发者ID:caoli5288,项目名称:chatcolor,代码行数:16,代码来源:Main.java
示例3: onEnable
import com.mengcraft.simpleorm.EbeanManager; //导入依赖的package包/类
@Override
public void onEnable() {
getConfig().options().copyDefaults(true);
saveDefaultConfig();
itemUtil = new ItemUtilHandler(this).handle();
EbeanManager manager = getServer().getServicesManager()
.getRegistration(EbeanManager.class)
.getProvider();
EbeanHandler handler = manager.getHandler(this);
if (!handler.isInitialized()) {
handler.define(EnderChest.class);
handler.define(EnderChestStack.class);
try {
handler.initialize();
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
}
}
handler.install(true);
handler.reflect();
database = handler.getServer();
String[] strings = {
ChatColor.GREEN + "梦梦家高性能服务器出租店",
ChatColor.GREEN + "shop105595113.taobao.com"
};
getServer().getConsoleSender().sendMessage(strings);
MainListener.bind(this);
Bukkit.getOnlinePlayers().forEach(p -> MainListener.INSTANCE.join(p));
PluginHelper.addExecutor(this, "ecadm", "enderchest.admin", this::admin);
}
开发者ID:caoli5288,项目名称:EnderChest,代码行数:39,代码来源:Main.java
示例4: onEnable
import com.mengcraft.simpleorm.EbeanManager; //导入依赖的package包/类
@Override
public void onEnable() {
saveDefaultConfig();
EbeanHandler db = EbeanManager.DEFAULT.getHandler(this);
if (db.isNotInitialized()) {
db.define(Kit.class);
db.define(KitOrder.class);
try {
db.initialize();
} catch (DatabaseException e) {
throw new RuntimeException("db");
}
}
db.install(true);
// db.reflect();
dataSource = db.getServer();
messenger = new Messenger(this);
exec(() -> new Metrics(this).start());
KitCommand command = new KitCommand(this);
getCommand("xkit").setExecutor(command);
if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
KitPlaceholderHook hook = new KitPlaceholderHook(this);
hook.hook();
}
getServer().getPluginManager().registerEvents(new KitListener(this, command), this);
}
开发者ID:caoli5288,项目名称:xKit,代码行数:32,代码来源:Main.java
示例5: onEnable
import com.mengcraft.simpleorm.EbeanManager; //导入依赖的package包/类
@SneakyThrows
@Override
public void onEnable() {
getConfig().options().copyDefaults(true);
saveDefaultConfig();
loadLibrary(this);
EbeanHandler db = EbeanManager.DEFAULT.getHandler(this);
if (!db.isInitialized()) {
db.define(PP.class);
db.define(PointRanking.class);
db.define(Log.class);
db.define(User.class);
try {
db.initialize();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
db.install();
db.reflect();
database = db.getServer();
plural = getConfig().getString("vault.unit.plural");
singular = getConfig().getString("vault.unit.singular");
getCommand("money").setExecutor(new Executor(this, manager));
manager.hookQuit();
if (getConfig().getBoolean("pp.replace") && nil(getServer().getPluginManager().getPlugin("PlayerPoints"))) {
val description = new PluginDescriptionFile(getResource("p.yml"));
val p = new PlayerPoints();
p.setDatabase(database);
SubPluginLoader.of(this).loadPlugin(p, description);
}
getLogger().info("梦梦家高性能服务器出租店");
getLogger().info("shop105595113.taobao.com");
}
开发者ID:caoli5288,项目名称:economy,代码行数:42,代码来源:Main.java
示例6: onEnable
import com.mengcraft.simpleorm.EbeanManager; //导入依赖的package包/类
@Override
public void onEnable() {
plugin = this;
getConfig().options().copyDefaults(true);
saveDefaultConfig();
EbeanHandler db = EbeanManager.DEFAULT.getHandler(this);
if (db.isNotInitialized()) {
db.define(Nick.class);
try {
db.initialize();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
db.install();
database = db.getServer();
coloured = getConfig().getBoolean("nick.coloured");
prefix = getConfig().getString("prefix", "#");
pattern = Pattern.compile(getConfig().getString("nick.allow", "[\\u4E00-\\u9FA5]+"));
blockList = getConfig().getStringList("nick.block");
Plugin vault = getServer().getPluginManager().getPlugin("Vault");
if (!nil(vault)) {
val provider = getServer().getServicesManager().getRegistration(Chat.class);
if (!nil(provider)) VaultP.bind(provider.getProvider());
}
Plugin tag = getServer().getPluginManager().getPlugin("TagAPI");
if (!nil(tag) && getConfig().getBoolean("modify.tag")) {
getServer().getPluginManager().registerEvents(TagExecutor.inst(), this);
}
if (getConfig().getBoolean("set.buy")) {
Plugin p = getServer().getPluginManager().getPlugin("PlayerPoints");
if (!nil(p)) {
PlayerPointsAPI api = ((PlayerPoints) p).getAPI();
point = new IPoint.PP(api);
getLogger().log(Level.INFO, "关联到点券插件");
}
}
getServer().getPluginManager().registerEvents(new Executor(this), this);
getCommand("nick").setExecutor(new Commander(this));
getServer().getConsoleSender().sendMessage(new String[]{
ChatColor.GREEN + "梦梦家高性能服务器出租店",
ChatColor.GREEN + "shop105595113.taobao.com"
});
getServer().getServicesManager().register(NickManager.class,
this,
this,
ServicePriority.Normal);
new MLite(this).start();
}
开发者ID:caoli5288,项目名称:nick,代码行数:60,代码来源:NickPlugin.java
示例7: onEnable
import com.mengcraft.simpleorm.EbeanManager; //导入依赖的package包/类
@SneakyThrows
public void onEnable() {
plugin = this;
getConfig().options().copyDefaults(true);
saveConfig();
messenger = new Messenger(this);
ItemUtil itemUtil = new ItemUtilHandler(this).handle();
ExpUtil expUtil = new ExpUtilHandler(this).handle();
ORM.loadLibrary(this);
EbeanHandler db = EbeanManager.DEFAULT.getHandler(this);
if (db.isNotInitialized()) {
db.define(PlayerData.class);
db.setMaxSize(getConfig().getInt("plugin.max-db-connection"));
db.initialize();
}
db.install();
if (Config.TRANSFER_ORIGIN) {
EbeanHandler b = new EbeanHandler(this);
b.setUrl("jdbc:sqlite:" + new File(getDataFolder(), "local_transfer.sqlite"));
b.setMaxSize(1);
b.setUserName("i7mc");
b.setPassword("i7mc");
b.define(LocalData.class);
b.initialize();
b.install();
LocalDataMgr.INSTANCE.db = b;
LocalDataMgr.INSTANCE.itemUtil = itemUtil;
PluginHelper.addExecutor(this, "psqltrans", this::trans);
}
UserManager manager = UserManager.INSTANCE;
manager.setMain(this);
manager.setItemUtil(itemUtil);
manager.setExpUtil(expUtil);
manager.setDb(db);
EventExecutor executor = new EventExecutor();
executor.setMain(this);
executor.setManager(manager);
getServer().getPluginManager().registerEvents(executor, this);
try {
getServer().getPluginManager().registerEvents(new ExtendEventExecutor(manager), this);
} catch (Exception ignore) {
}// There is some event since 1.8.
Metrics.start(this);
}
开发者ID:caoli5288,项目名称:PlayerSQL,代码行数:61,代码来源:PluginMain.java
注:本文中的com.mengcraft.simpleorm.EbeanManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论