本文整理汇总了Java中fr.evercraft.everapi.exception.PluginDisableException类的典型用法代码示例。如果您正苦于以下问题:Java PluginDisableException类的具体用法?Java PluginDisableException怎么用?Java PluginDisableException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PluginDisableException类属于fr.evercraft.everapi.exception包,在下文中一共展示了PluginDisableException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onFirst
import fr.evercraft.everapi.exception.PluginDisableException; //导入依赖的package包/类
protected void onFirst() throws PluginDisableException, ServerDisableException {
TypeSerializers.getDefaultSerializers().registerType(TypeToken.of(EMessageBuilder.class), new EMessageBuilderSerializer(this));
TypeSerializers.getDefaultSerializers().registerType(TypeToken.of(EFormat.class), new EFormatSerializer());
this.threadAsync = this.getGame().getScheduler().createAsyncExecutor(this);
this.threadSync = this.getGame().getScheduler().createSyncExecutor(this);
this.chat = new EChat(this);
this.configs = new EAConfig(this);
this.messages = new EAMessage(this);
this.server = new EServer(this);
this.managerUtils = new ManagerUtils(this);
this.service = new ManagerService(this);
new ManagerRegister(this);
}
示例2: processExecute
import fr.evercraft.everapi.exception.PluginDisableException; //导入依赖的package包/类
private CommandResult processExecute(final CommandSource source, final String argument) throws CommandException, PluginDisableException, ServerDisableException, EMessageException {
Chronometer chronometer = new Chronometer();
List<String> arguments = this.getArg(argument);
if (source instanceof Player) {
this.processPlayer((Player) source, argument, arguments);
} else {
this.execute(source, arguments)
.exceptionally(e -> {
EAMessages.COMMAND_ERROR.sender()
.prefix(this.plugin.getMessages().getPrefix())
.sendTo(source);
this.plugin.getELogger().warn("CompletableFuture : " + e.getMessage());
e.printStackTrace();
return false;
})
.thenAcceptAsync(result -> this.sources.remove(source.getIdentifier()),
this.plugin.getGame().getScheduler().createSyncExecutor(this.plugin));
}
this.plugin.getELogger().debug("The command '" + this.getName() + "' with arguments '" + argument + "' was to execute in " + chronometer.getMilliseconds().toString() + " ms");
return CommandResult.success();
}
示例3: processPlayer
import fr.evercraft.everapi.exception.PluginDisableException; //导入依赖的package包/类
private void processPlayer(final Player source, final String arg, final List<String> args) throws CommandException, PluginDisableException, ServerDisableException, EMessageException {
EPlayer player = this.plugin.getEServer().getEPlayer(source);
if (player.isDead()) {
EAMessages.COMMAND_ERROR_PLAYER_DEAD.sender()
.prefix(this.plugin.getMessages().getPrefix())
.sendTo(source);
}
if (!this.plugin.getGame().getEventManager().post(ESpongeEventFactory.createCommandEventSend(player, this.getName(), arg, args, Cause.source(this.plugin).build()))) {
this.execute(player, args)
.exceptionally(e -> {
EAMessages.COMMAND_ERROR.sender()
.prefix(this.plugin.getMessages().getPrefix())
.sendTo(source);
this.plugin.getELogger().warn("CompletableFuture : " + e.getMessage());
e.printStackTrace();
return false;
})
.thenAcceptAsync(result -> {
this.sources.remove(player.getIdentifier());
this.plugin.getGame().getEventManager().post(ESpongeEventFactory.createCommandEventResult(player, this.getName(), arg, args, result, Cause.source(this.plugin).build()));
}, this.plugin.getThreadSync());
}
}
示例4: EPPermissionService
import fr.evercraft.everapi.exception.PluginDisableException; //导入依赖的package包/类
public EPPermissionService(final EverPermissions plugin) throws PluginDisableException {
this.plugin = plugin;
// Context
this.context = new EPContextCalculator(this.plugin);
// Collection
this.defaults = new EPUserCollection(this.plugin, PermissionService.SUBJECTS_DEFAULT);
this.groups = new EPGroupCollection(this.plugin);
this.users = new EPUserCollection(this.plugin, PermissionService.SUBJECTS_USER);
this.systems = new EPUserCollection(this.plugin, PermissionService.SUBJECTS_SYSTEM);
this.commandBlocks = new EPCommandBlockCollection(this.plugin, PermissionService.SUBJECTS_COMMAND_BLOCK);
this.descriptions = new ConcurrentHashMap<String, EPPermissionDescription>();
this.collections = new ConcurrentHashMap<String, EPSubjectCollection<?>>();
this.collections.put(PermissionService.SUBJECTS_USER.toLowerCase(), this.users);
this.collections.put(PermissionService.SUBJECTS_GROUP.toLowerCase(), this.groups);
this.collections.put(PermissionService.SUBJECTS_SYSTEM.toLowerCase(), this.systems);
this.collections.put(PermissionService.SUBJECTS_COMMAND_BLOCK.toLowerCase(), this.commandBlocks);
this.collections.put(PermissionService.SUBJECTS_DEFAULT.toLowerCase(), this.defaults);
this.collections.put(PermissionService.SUBJECTS_ROLE_TEMPLATE.toLowerCase(), new EPTransientCollection(this.plugin, PermissionService.SUBJECTS_ROLE_TEMPLATE));
}
示例5: onReload
import fr.evercraft.everapi.exception.PluginDisableException; //导入依赖的package包/类
@Override
protected void onReload() throws PluginDisableException, ServerDisableException {
super.onReload();
this.service.reload();
this.managerUtils.reload();
}
示例6: reload
import fr.evercraft.everapi.exception.PluginDisableException; //导入依赖的package包/类
public void reload() throws PluginDisableException {
this.plugin.getELogger().debug("SQL : PreInitialization...");
// SQLService
if (this.plugin.getGame().getServiceManager().provide(SqlService.class).isPresent()) {
this.sql = this.plugin.getGame().getServiceManager().provide(SqlService.class).get();
// Config
this.enable = this.plugin.getConfigs().get("SQL.enable").getBoolean(false);
this.prefix = this.plugin.getConfigs().get("SQL.prefix").getString(this.plugin.getName().toLowerCase() + "_");
if (this.enable) {
this.url = this.plugin.getConfigs().get("SQL.url").getString("");
if (this.url.isEmpty()) {
this.enable = false;
} else {
this.enable = testConnection();
}
} else if (this.force) {
this.plugin.getELogger().debug("SQL : Default");
this.url = "jdbc:h2:" + this.plugin.getPath().toAbsolutePath() + "/data";
this.enable = testConnection();
}
// Resultat
if (this.enable) {
this.plugin.getELogger().info("SQL : Load complete");
} else {
this.plugin.getELogger().debug("SQL : Error loading");
if (this.force) {
throw new PluginDisableException("This plugin requires a database");
}
}
} else {
this.enable = false;
this.plugin.getELogger().debug("No SqlService");
}
}
示例7: onEnable
import fr.evercraft.everapi.exception.PluginDisableException; //导入依赖的package包/类
@Override
protected void onEnable() throws PluginDisableException {
this.essentials = new EEssentialsService(this);
this.warp = new EWarpService(this); // After EverAPI
this.spawn = new ESpawnService(this);
this.messages = new EEMessage(this, "messages");
this.motd = new EEConfigMotd(this, "motd");
this.rules = new EEConfigRules(this, "rules");
this.register();
}
示例8: onReload
import fr.evercraft.everapi.exception.PluginDisableException; //导入依赖的package包/类
@Override
protected void onReload() throws PluginDisableException, ServerDisableException {
this.scheduler.stop();
super.onReload();
this.databases.reload();
this.essentials.reload();
this.warp.reload();
this.spawn.reload();
this.scheduler.reload();
this.scheduler.start();
}
示例9: onPreEnable
import fr.evercraft.everapi.exception.PluginDisableException; //导入依赖的package包/类
@Override
protected void onPreEnable() throws PluginDisableException, ServerDisableException {
this.config = new EPConfig(this);
this.messages = new EPMessage(this);
this.database = new EPDataBases(this);
this.service = new EPPermissionService(this);
this.service.load();
this.getGame().getServiceManager().setProvider(this, PermissionService.class, this.service);
}
示例10: onPreEnable
import fr.evercraft.everapi.exception.PluginDisableException; //导入依赖的package包/类
@Override
protected void onPreEnable() throws PluginDisableException {
// Configurations
this.configs = new EEConfig(this);
this.messages = new EEMessage(this);
// MySQL
this.databases = new EEDataBase(this);
// Economy
this.service = new EEconomyService(this);
this.getGame().getServiceManager().setProvider(this, EconomyService.class, this.service);
this.getGame().getServiceManager().setProvider(this, TopEconomyService.class, this.service);
}
示例11: onCompleteEnable
import fr.evercraft.everapi.exception.PluginDisableException; //导入依赖的package包/类
@Override
protected void onCompleteEnable() throws PluginDisableException {
// Economy
if (!this.getEverAPI().getManagerService().getEconomy().isPresent()) {
throw new PluginDisableException("Il n'y a pas de système d'économie !");
}
// Commands
EECommand command = new EECommand(this);
command.add(new EEBalance(this));
command.add(new EEBalanceTop(this));
command.add(new EEPay(this));
command.add(new EEReload(this, command));
command.add(new EEGive(this, command));
command.add(new EETake(this, command));
command.add(new EEReset(this, command));
command.add(new EELog(this, command));
// Listerners
this.getGame().getEventManager().registerListeners(this, new EEListener(this));
if (this.getEverAPI().getManagerService().getSign().isPresent()) {
this.getEverAPI().getManagerService().getSign().get().add(new BalanceSign(this));
}
}
示例12: onReload
import fr.evercraft.everapi.exception.PluginDisableException; //导入依赖的package包/类
@Override
protected void onReload() throws PluginDisableException, ServerDisableException{
super.onReload();
this.databases.reload();
// Economy
this.service.reload();
if (!this.getEverAPI().getManagerService().getEconomy().isPresent()){
throw new PluginDisableException("Il n'y a pas de système d'économie !");
}
}
示例13: onPreEnable
import fr.evercraft.everapi.exception.PluginDisableException; //导入依赖的package包/类
@Override
protected void onPreEnable() throws PluginDisableException {
this.configs = new ESConfig(this);
this.messages = new ESMessage(this);
this.database = new ESDataBase(this);
this.events = new ESManagerEvents(this);
}
示例14: onEnable
import fr.evercraft.everapi.exception.PluginDisableException; //导入依赖的package包/类
@Override
protected void onEnable() throws PluginDisableException {
this.ban_service = new EBanService(this);
this.jail_service = new EJailService(this);
this.getGame().getServiceManager().setProvider(this, BanService.class, this.ban_service);
this.getGame().getServiceManager().setProvider(this, SanctionService.class, this.ban_service);
this.getGame().getServiceManager().setProvider(this, JailService.class, this.jail_service);
}
示例15: onReload
import fr.evercraft.everapi.exception.PluginDisableException; //导入依赖的package包/类
protected void onReload() throws PluginDisableException, ServerDisableException {
super.onReload();
this.database.reload();
this.ban_service.reload();
this.jail_service.reload();
}