• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java EbeanHandler类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.mengcraft.simpleorm.EbeanHandler的典型用法代码示例。如果您正苦于以下问题:Java EbeanHandler类的具体用法?Java EbeanHandler怎么用?Java EbeanHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EbeanHandler类属于com.mengcraft.simpleorm包,在下文中一共展示了EbeanHandler类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onEnable

import com.mengcraft.simpleorm.EbeanHandler; //导入依赖的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


示例2: onEnable

import com.mengcraft.simpleorm.EbeanHandler; //导入依赖的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


示例3: onEnable

import com.mengcraft.simpleorm.EbeanHandler; //导入依赖的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


示例4: Executor

import com.mengcraft.simpleorm.EbeanHandler; //导入依赖的package包/类
public Executor(Main main, EbeanHandler db) {
    this.playerCache = PrefixManager.INSTANCE.getPlayerCache();
    this.playerDefaultCache = PrefixManager.INSTANCE.getPlayerDefaultCache();
    this.chat = main.getServer().getServicesManager().getRegistration(Chat.class).getProvider();
    this.main = main;
    this.db = db;
    this.coolTime = main.getConfig().getInt("coolDown", 1) * 60000L;
    all = db.find(PrefixDefine.class).findList();
}
 
开发者ID:caoli5288,项目名称:prefixbox,代码行数:10,代码来源:Executor.java


示例5: onEnable

import com.mengcraft.simpleorm.EbeanHandler; //导入依赖的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.EbeanHandler; //导入依赖的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: update

import com.mengcraft.simpleorm.EbeanHandler; //导入依赖的package包/类
public void update(EbeanHandler db) {
    db.save(this);
}
 
开发者ID:caoli5288,项目名称:prefixbox,代码行数:4,代码来源:PrefixPlayerDefault.java


示例8: onEnable

import com.mengcraft.simpleorm.EbeanHandler; //导入依赖的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.EbeanHandler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GraphType类代码示例发布时间:2022-05-22
下一篇:
Java SignalServiceAccountManager类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap