当前位置: 首页>>代码示例>>Java>>正文


Java ConfigRuntimeException类代码示例

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


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

示例1: exec

import com.laytonsmith.core.exceptions.ConfigRuntimeException; //导入依赖的package包/类
@Override
public Construct exec(Target t, Environment env, Construct... args) throws CancelCommandException, ConfigRuntimeException {
	Static.checkPlugin("WorldGuard", t);
	World world;

	MCPlayer m = null;

	if (env.getEnv(CommandHelperEnvironment.class).GetCommandSender() instanceof MCPlayer) {
		m = env.getEnv(CommandHelperEnvironment.class).GetPlayer();
	}
	if (args.length == 1) {
		m = Static.GetPlayer(args[0].val(), t);
	}

	if (m == null) {
		throw new CREPlayerOfflineException(this.getName() + " needs a player", t);
	}

	CArray regions = new CArray(t);

	for (String region : getAbstraction().regionsAt(m.getLocation())) {
		regions.push(new CString(region, t), t);
	}

	return regions;
}
 
开发者ID:jb-aero,项目名称:SKCompat,代码行数:27,代码来源:CHWorldGuard.java

示例2: exec

import com.laytonsmith.core.exceptions.ConfigRuntimeException; //导入依赖的package包/类
@Override
public Construct exec(Target t, Environment environment, Construct... args) throws ConfigRuntimeException {
	String username, password, key;
	if (args.length == 1) {
		ConnectSettings settings = CHLilyPadStatic.getConnect(t).getSettings();
		username = settings.getUsername();
		password = settings.getPassword();
		key = args[0].val();
	} else {
		username = args[0].val();
		password = args[1].val();
		key = args[2].val();
	}
	try {
		return CHLilyPadStatic.evaluate(CHLilyPadStatic.getConnect(t).request(new AuthenticateRequest(username, password, key)).awaitUninterruptibly(), t);
	} catch (RequestException ex) {
		throw new ConfigRuntimeException(ex.getMessage(), Exceptions.ExceptionType.PluginInternalException, t);
	}
}
 
开发者ID:King-Fisher,项目名称:CHLilyPad,代码行数:20,代码来源:LilyPadFunctions.java

示例3: exec

import com.laytonsmith.core.exceptions.ConfigRuntimeException; //导入依赖的package包/类
@Override
public Construct exec(Target t, Environment environment, Construct... args) throws ConfigRuntimeException {
	MCDynmapMarker marker = CHDynmapStatic.getMarker(args[0].val(), args[1].val(), t);
	MCLocation[] corners;
	switch (marker.getType()) {
		case AREA:
			corners = ((MCDynmapAreaMarker) marker).getCorners();
			break;
		case POLYLINE:
			corners = ((MCDynmapPolyLineMarker) marker).getCorners();
			break;
		default:
			throw new ConfigRuntimeException("There is no existing area or polyline markers with this id.", ExceptionType.NotFoundException, t);
	}
	CArray cornerArray = new CArray(t);
	for (MCLocation location : corners) {
		cornerArray.push(ObjectGenerator.GetGenerator().location(location));
	}
	return cornerArray;
}
 
开发者ID:Hekta,项目名称:CHDynmap,代码行数:21,代码来源:DynmapMarkers.java

示例4: exec

import com.laytonsmith.core.exceptions.ConfigRuntimeException; //导入依赖的package包/类
@Override
public Construct exec(Target t, Environment environment, Construct... args) throws ConfigRuntimeException {
	MCOfflinePlayer player;
	boolean isVisible;
	if (args.length == 1) {
		MCPlayer psender = environment.getEnv(CommandHelperEnvironment.class).GetPlayer();
		if (psender == null) {
			throw new ConfigRuntimeException("No player was specified!", ExceptionType.PlayerOfflineException, t);
		} else {
			player = psender;
			isVisible = ArgumentValidation.getBoolean(args[0], t);
		}
	} else {
		player = Static.getServer().getOfflinePlayer(args[0].val());
		isVisible = ArgumentValidation.getBoolean(args[1], t);
	}
	CHDynmapStatic.getDynmapAPI(t).setPlayerVisiblity(player, isVisible);
	return CVoid.VOID;
}
 
开发者ID:Hekta,项目名称:CHDynmap,代码行数:20,代码来源:DynmapPlayers.java

示例5: exec

import com.laytonsmith.core.exceptions.ConfigRuntimeException; //导入依赖的package包/类
@Override
public Construct exec(Target t, Environment environment, Construct... args) throws ConfigRuntimeException {
	MCDynmapIcon icon = CHDynmapStatic.getIcon(args[0].val(), t);
	File file = new File(t.file().getParentFile(), args[1].val());
	if (!Security.CheckSecurity(file.getAbsolutePath())) {
		throw new ConfigRuntimeException("You do not have permission to access the file '" + file.getAbsolutePath() + "'", ExceptionType.SecurityException, t);
	}
	FileInputStream image;
	try {
		image = new FileInputStream(file);
	} catch (FileNotFoundException exception) {
		throw new ConfigRuntimeException(exception.getMessage(), ExceptionType.IOException, t);
	}
	icon.setImage(image);
	return CVoid.VOID;
}
 
开发者ID:Hekta,项目名称:CHDynmap,代码行数:17,代码来源:DynmapIcons.java

示例6: exec

import com.laytonsmith.core.exceptions.ConfigRuntimeException; //导入依赖的package包/类
@Override
public Construct exec(Target t, Environment environment, Construct... args) throws ConfigRuntimeException {
	Static.checkPlugin("WorldEdit", t);
	int yaxis = 0,
			xaxis = 0,
			zaxis = 0;
	MCPlayer plyr = null;
	switch (args.length) {
		case 3:
			xaxis = Static.getInt32(args[1], t);
			zaxis = Static.getInt32(args[2], t);
		case 1:
			yaxis = Static.getInt32(args[0], t);
			break;
		case 4:
			xaxis = Static.getInt32(args[2], t);
			zaxis = Static.getInt32(args[3], t);
		case 2:
			yaxis = Static.getInt32(args[1], t);
			plyr = Static.GetPlayer(args[0], t);
			break;
	}
	try {
		ClipboardCommands command = new ClipboardCommands(WorldEdit.getInstance());
		SKCommandSender user = getSKPlayer(plyr, t);
		command.rotate(user, user.getLocalSession(), (double) yaxis, (double) xaxis, (double) zaxis);
	} catch (EmptyClipboardException e) {
		throw new CRENotFoundException("The clipboard is empty, copy something to it first!", t);
	} catch (WorldEditException ex) {
		throw new CREPluginInternalException(ex.getMessage(), t);
	}
	return CVoid.VOID;
}
 
开发者ID:jb-aero,项目名称:SKCompat,代码行数:34,代码来源:CHWorldEdit.java

示例7: getConnect

import com.laytonsmith.core.exceptions.ConfigRuntimeException; //导入依赖的package包/类
public static Connect getConnect(Target target) {
	Connect conncect = CHLilyPad.getConnect();
	if (conncect != null) {
		return conncect;
	} else {
		throw new ConfigRuntimeException("Needed plugin Bukkit-Connect not found.", Exceptions.ExceptionType.InvalidPluginException, target);
	}
}
 
开发者ID:King-Fisher,项目名称:CHLilyPad,代码行数:9,代码来源:CHLilyPadStatic.java

示例8: getMarkerSet

import com.laytonsmith.core.exceptions.ConfigRuntimeException; //导入依赖的package包/类
public static MCDynmapMarkerSet getMarkerSet(String setID, Target t) {
	MCDynmapMarkerSet set = getMarkerAPI(t).getMarkerSet(setID);
	if (set != null) {
		return set;
	} else {
		throw new ConfigRuntimeException("\"" + setID + "\" is not an existing markerset.", ExceptionType.NotFoundException, t);
	}
}
 
开发者ID:Hekta,项目名称:CHDynmap,代码行数:9,代码来源:CHDynmapStatic.java

示例9: getMarker

import com.laytonsmith.core.exceptions.ConfigRuntimeException; //导入依赖的package包/类
public static MCDynmapMarker getMarker(String setID, String markerID, Target t) {
	MCDynmapMarker marker = getMarkerSet(setID, t).getMarker(markerID);
	if (marker != null) {
		return marker;
	} else {
		throw new ConfigRuntimeException("\"" + markerID + "\" is not an existing marker.", ExceptionType.NotFoundException, t);
	}
}
 
开发者ID:Hekta,项目名称:CHDynmap,代码行数:9,代码来源:CHDynmapStatic.java

示例10: getAreaMarker

import com.laytonsmith.core.exceptions.ConfigRuntimeException; //导入依赖的package包/类
public static MCDynmapAreaMarker getAreaMarker(String setID, String markerID, Target t) {
	MCDynmapAreaMarker marker = getMarkerSet(setID, t).getAreaMarker(markerID);
	if (marker != null) {
		return marker;
	} else {
		throw new ConfigRuntimeException("\"" + markerID + "\" is not an existing area marker.", ExceptionType.NotFoundException, t);
	}
}
 
开发者ID:Hekta,项目名称:CHDynmap,代码行数:9,代码来源:CHDynmapStatic.java

示例11: getCircleMarker

import com.laytonsmith.core.exceptions.ConfigRuntimeException; //导入依赖的package包/类
public static MCDynmapCircleMarker getCircleMarker(String setID, String markerID, Target t) {
	MCDynmapCircleMarker marker = getMarkerSet(setID, t).getCircleMarker(markerID);
	if (marker != null) {
		return marker;
	} else {
		throw new ConfigRuntimeException("\"" + markerID + "\" is not an existing circle marker.", ExceptionType.NotFoundException, t);
	}
}
 
开发者ID:Hekta,项目名称:CHDynmap,代码行数:9,代码来源:CHDynmapStatic.java

示例12: getIconMarker

import com.laytonsmith.core.exceptions.ConfigRuntimeException; //导入依赖的package包/类
public static MCDynmapIconMarker getIconMarker(String setID, String markerID, Target t) {
	MCDynmapIconMarker marker = getMarkerSet(setID, t).getIconMarker(markerID);
	if (marker != null) {
		return marker;
	} else {
		throw new ConfigRuntimeException("\"" + markerID + "\" is not an existing icon marker.", ExceptionType.NotFoundException, t);
	}
}
 
开发者ID:Hekta,项目名称:CHDynmap,代码行数:9,代码来源:CHDynmapStatic.java

示例13: getPolyLineMarker

import com.laytonsmith.core.exceptions.ConfigRuntimeException; //导入依赖的package包/类
public static MCDynmapPolyLineMarker getPolyLineMarker(String setID, String markerID, Target t) {
	MCDynmapPolyLineMarker marker = getMarkerSet(setID, t).getPolyLineMarker(markerID);
	if (marker != null) {
		return marker;
	} else {
		throw new ConfigRuntimeException("\"" + markerID + "\" is not an existing polyline marker.", ExceptionType.NotFoundException, t);
	}
}
 
开发者ID:Hekta,项目名称:CHDynmap,代码行数:9,代码来源:CHDynmapStatic.java

示例14: getIcon

import com.laytonsmith.core.exceptions.ConfigRuntimeException; //导入依赖的package包/类
public static MCDynmapIcon getIcon(String iconID, Target t) {
	MCDynmapIcon icon = getMarkerAPI(t).getIcon(iconID);
	if (icon != null) {
		return icon;
	} else {
		throw new ConfigRuntimeException("\"" + iconID + "\" is not an existing icon.", ExceptionType.NotFoundException, t);
	}
}
 
开发者ID:Hekta,项目名称:CHDynmap,代码行数:9,代码来源:CHDynmapStatic.java

示例15: getPlayerSet

import com.laytonsmith.core.exceptions.ConfigRuntimeException; //导入依赖的package包/类
public static MCDynmapPlayerSet getPlayerSet(String setID, Target t) {
	MCDynmapPlayerSet set = getMarkerAPI(t).getPlayerSet(setID);
	if (set != null) {
		return set;
	} else {
		throw new ConfigRuntimeException("\"" + setID + "\" is not an existing playerset.", ExceptionType.NotFoundException, t);
	}
}
 
开发者ID:Hekta,项目名称:CHDynmap,代码行数:9,代码来源:CHDynmapStatic.java


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