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

Java PluginDisableException类代码示例

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

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



PluginDisableException类属于fr.evercraft.everapi.exception包,在下文中一共展示了PluginDisableException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:17,代码来源:EverAPI.java


示例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();
}
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:24,代码来源:ECommand.java


示例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());
	}
}
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:25,代码来源:ECommand.java


示例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));
}
 
开发者ID:EverCraft,项目名称:EverPermissions,代码行数:24,代码来源:EPPermissionService.java


示例5: onReload

import fr.evercraft.everapi.exception.PluginDisableException; //导入依赖的package包/类
@Override
protected void onReload() throws PluginDisableException, ServerDisableException {
	super.onReload();
	
	this.service.reload();
	this.managerUtils.reload();
}
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:8,代码来源:EverAPI.java


示例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");
	}
}
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:40,代码来源:EDataBase.java


示例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();
}
 
开发者ID:EverCraft,项目名称:EverEssentials,代码行数:13,代码来源:EverEssentials.java


示例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();
}
 
开发者ID:EverCraft,项目名称:EverEssentials,代码行数:16,代码来源:EverEssentials.java


示例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);
}
 
开发者ID:EverCraft,项目名称:EverPermissions,代码行数:12,代码来源:EverPermissions.java


示例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);
}
 
开发者ID:EverCraft,项目名称:EverEconomy,代码行数:15,代码来源:EverEconomy.java


示例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));
	}
}
 
开发者ID:EverCraft,项目名称:EverEconomy,代码行数:28,代码来源:EverEconomy.java


示例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 !");
	}
}
 
开发者ID:EverCraft,项目名称:EverEconomy,代码行数:14,代码来源:EverEconomy.java


示例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);
}
 
开发者ID:EverCraft,项目名称:EverSanctions,代码行数:9,代码来源:EverSanctions.java


示例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);
}
 
开发者ID:EverCraft,项目名称:EverSanctions,代码行数:10,代码来源:EverSanctions.java


示例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();
}
 
开发者ID:EverCraft,项目名称:EverSanctions,代码行数:8,代码来源:EverSanctions.java


示例16: onReload

import fr.evercraft.everapi.exception.PluginDisableException; //导入依赖的package包/类
protected void onReload() throws PluginDisableException, ServerDisableException {
	super.onReload();
}
 
开发者ID:EverCraft,项目名称:EverKits,代码行数:4,代码来源:EverKits.java


示例17: EDataBase

import fr.evercraft.everapi.exception.PluginDisableException; //导入依赖的package包/类
public EDataBase(final T plugin) throws PluginDisableException {
	this(plugin, false, "");
}
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:4,代码来源:EDataBase.java


示例18: onReload

import fr.evercraft.everapi.exception.PluginDisableException; //导入依赖的package包/类
protected void onReload() throws PluginDisableException, ServerDisableException {
	this.reloadConfigurations();
	this.reloadCommands();
}
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:5,代码来源:EPlugin.java


示例19: processSelector

import fr.evercraft.everapi.exception.PluginDisableException; //导入依赖的package包/类
@SuppressWarnings("unused")
private boolean processSelector(final CommandSource source, final String argument) throws CommandException, PluginDisableException, ServerDisableException, EMessageException {
	int start = -1;
	int cpt = -1;
	int open = 0;
	boolean type = false;
	
	for (char c : argument.toCharArray()) {
		cpt++;
		
		if (start == -1) {
			if (c != '@') continue;
			if (cpt != 0 && argument.charAt(cpt-1) != ' ') continue;
			start = cpt;
		} else if (cpt == start + 1) {
			if (this.plugin.getGame().getRegistry().getAllOf(SelectorType.class).stream().filter(t -> t.getName().equals(String.valueOf(c))).findAny().isPresent()) {
				type = true;
			} else {
				start = -1;
			}
		} else if (cpt == start + 2) {
			if (c == ' ') {
				cpt--;
				break;
			}
			if (c == '[') {
				open = 1;
			} else {
				start = -1;
				type = false;
			}
		} else {
			if (c == '[') {
				open++;
			} else if (c == ']') {
				open--;
				if (open == 0) {
					break;
				}
			}
		}
	}
	
	if (start != -1 && open == 0 && type) {
		String stringSelector = argument.substring(start, cpt+1);
		String first = (start == 0) ? "" : argument.substring(0, start);
		String last = (cpt+1 == argument.length()) ? "" : argument.substring(cpt+1, argument.length());
		
		try {
			List<Entity> players = new ArrayList<Entity>(Selector.parse(stringSelector).resolve(source));
			players.removeIf(entity -> !(entity instanceof Player));
			
			if (players.isEmpty()) return false;
			
			for (Entity player : players) {
				this.processExecute(source, first + ((Player) player).getName() + last);
			}
			return true;
		} catch (IllegalArgumentException e) {}
	}
	return false;
}
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:63,代码来源:ECommand.java


示例20: onPreEnable

import fr.evercraft.everapi.exception.PluginDisableException; //导入依赖的package包/类
@Override
protected void onPreEnable() throws PluginDisableException {
	// Configurations
	this.config = new EEConfig(this);
	this.databases = new EEDataBase(this);
}
 
开发者ID:EverCraft,项目名称:EverEssentials,代码行数:7,代码来源:EverEssentials.java



注:本文中的fr.evercraft.everapi.exception.PluginDisableException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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