本文整理汇总了Java中com.laytonsmith.core.Static类的典型用法代码示例。如果您正苦于以下问题:Java Static类的具体用法?Java Static怎么用?Java Static使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Static类属于com.laytonsmith.core包,在下文中一共展示了Static类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: generateBlockPattern
import com.laytonsmith.core.Static; //导入依赖的package包/类
public static WeightedBlockPattern generateBlockPattern(Construct source, Target t) {
CArray src = Static.getArray(source, t);
if (src.containsKey("name")) {
int data = 0;
double weight = 1D;
if (src.containsKey("data")) {
data = Static.getInt32(src.get("data", t), t);
}
if (src.containsKey("weight")) {
weight = Static.getDouble(src.get("weight", t), t);
}
BlockType type = BlockType.lookup(src.get("name", t).val());
if (type == null) {
throw new CRENotFoundException("Could not determine blocktype from " + src.get("name", t).val(), t);
} else {
return new WeightedBlockPattern(new BaseBlock(type.getID(), data), weight);
}
} else {
throw new CREFormatException("Block name required", t);
}
}
开发者ID:jb-aero,项目名称:SKCompat,代码行数:23,代码来源:CHWorldEdit.java
示例2: exec
import com.laytonsmith.core.Static; //导入依赖的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
示例3: exec
import com.laytonsmith.core.Static; //导入依赖的package包/类
@Override
public Construct exec(Target t, Environment environment, Construct... args) throws ConfigRuntimeException {
String player, server;
if (args.length == 1) {
player = Static.getPlayer(environment, t).getName();
server = args[0].val();
} else {
player = args[0].val();
server = args[1].val();
}
try {
return CHLilyPadStatic.evaluate(CHLilyPadStatic.getConnect(t).request(new RedirectRequest(server, player)).awaitUninterruptibly(), t);
} catch (RequestException ex) {
throw new ConfigRuntimeException(ex.getMessage(), Exceptions.ExceptionType.PluginInternalException, t);
}
}
开发者ID:King-Fisher,项目名称:CHLilyPad,代码行数:17,代码来源:LilyPadFunctions.java
示例4: exec
import com.laytonsmith.core.Static; //导入依赖的package包/类
@Override
public Construct exec(Target t, Environment environment, Construct... args) throws ConfigRuntimeException {
MCDynmapMarkerSet set = CHDynmapStatic.getMarkerSet(args[0].val(), t);
if (set.getAllowedIcons() == null) {
throw new ConfigRuntimeException("The markerset is not restricted.", ExceptionType.PluginInternalException, t);
}
MCDynmapIcon icon = CHDynmapStatic.getIcon(args[1].val(), t);
if (Static.getBoolean(args[2])) {
if (set.iconIsAllowed(icon)) {
throw new ConfigRuntimeException("The icon is already allowed for the marketset.", ExceptionType.PluginInternalException, t);
}
set.addAllowedIcon(icon);
} else {
if (!set.iconIsAllowed(icon)) {
throw new ConfigRuntimeException("The icon is already not allowed for the marketset.", ExceptionType.PluginInternalException, t);
}
set.removeAllowedIcon(icon);
}
return CVoid.VOID;
}
开发者ID:Hekta,项目名称:CHDynmap,代码行数:21,代码来源:DynmapMarkerSets.java
示例5: exec
import com.laytonsmith.core.Static; //导入依赖的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
示例6: myGetPlayer
import com.laytonsmith.core.Static; //导入依赖的package包/类
public static MCCommandSender myGetPlayer(Construct arg, Target t) {
if (arg == null || Static.getConsoleName().equals(arg.val())) {
return Static.getServer().getConsole();
} else {
return Static.GetPlayer(arg, t);
}
}
开发者ID:jb-aero,项目名称:SKCompat,代码行数:8,代码来源:SKCompat.java
示例7: exec
import com.laytonsmith.core.Static; //导入依赖的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
示例8: onStartup
import com.laytonsmith.core.Static; //导入依赖的package包/类
@Override
public void onStartup() {
_connect = CHLilyPadStaticLayer.getConnect();
if (_connect != null) {
CHLilyPadStaticLayer.startup();
Static.getLogger().info(String.format("%s enabled.", getName()));
} else {
Static.getLogger().severe(String.format("Plugin %s seems to be missing, none of the %s functions will work.", "Bukkit-Connect", getName()));
}
}
开发者ID:King-Fisher,项目名称:CHLilyPad,代码行数:11,代码来源:CHLilyPad.java
示例9: onShutdown
import com.laytonsmith.core.Static; //导入依赖的package包/类
@Override
public void onShutdown() {
if (_connect != null) {
CHLilyPadStaticLayer.shutdown();
_connect = null;
Static.getLogger().info(String.format("%s disabled.", getName()));
}
}
开发者ID:King-Fisher,项目名称:CHLilyPad,代码行数:9,代码来源:CHLilyPad.java
示例10: onStartup
import com.laytonsmith.core.Static; //导入依赖的package包/类
@Override
public void onStartup() {
_dynmap = CHDynmapStaticLayer.getDynmap();
if (_dynmap != null) {
BukkitDynmapListener.register();
Static.getLogger().info(String.format("%s %s enabled.", getName(), VERSION));
} else {
Static.getLogger().severe(String.format("Plugin %s seems to be missing, none of the %s functions will work.", DYNMAP_NAME, getName()));
}
}
开发者ID:Hekta,项目名称:CHDynmap,代码行数:11,代码来源:CHDynmap.java
示例11: onShutdown
import com.laytonsmith.core.Static; //导入依赖的package包/类
@Override
public void onShutdown() {
if (_dynmap != null) {
BukkitDynmapListener.unregister();
Static.getLogger().info(String.format("%s unloaded.", getName()));
}
}
开发者ID:Hekta,项目名称:CHDynmap,代码行数:8,代码来源:CHDynmap.java
示例12: exec
import com.laytonsmith.core.Static; //导入依赖的package包/类
@Override
public Construct exec(Target t, Environment environment, Construct... args) throws ConfigRuntimeException {
CArray givenPlayers = ArgumentValidation.getArray(args[1], t);
if (givenPlayers.inAssociativeMode()) {
throw new ConfigRuntimeException("The array must not be associative.", ExceptionType.CastException, t);
}
MCOfflinePlayer[] players = new MCOfflinePlayer[(int) givenPlayers.size()];
int i = 0;
for (Construct player : givenPlayers.asList()) {
players[i] = Static.getServer().getOfflinePlayer(player.val());
i++;
}
CHDynmapStatic.getPlayerSet(args[0].val(), t).setPlayers(players);
return CVoid.VOID;
}
开发者ID:Hekta,项目名称:CHDynmap,代码行数:16,代码来源:DynmapPlayerSets.java
示例13: exec
import com.laytonsmith.core.Static; //导入依赖的package包/类
public Construct exec(Target t, Environment environment, Construct... args) throws ConfigRuntimeException {
long givenPosition = Static.getInt(args[1], t);
if (givenPosition > CHMIDISequencerManager.getSequencer(args[0].val(), t).getMIDISequencer().getMicrosecondLength()) {
throw new ConfigRuntimeException("You depassed the length of the MIDI sequence.", ExceptionType.RangeException, t);
} else {
CHMIDISequencerManager.getSequencer(args[0].val(), t).getMIDISequencer().setMicrosecondPosition(givenPosition);
}
return new CVoid(t);
}
开发者ID:Hekta,项目名称:CHMIDI,代码行数:10,代码来源:MIDIFunctions.java
示例14: SKConsole
import com.laytonsmith.core.Static; //导入依赖的package包/类
public SKConsole() {
console = Static.getServer().getConsole();
setLocation(Static.getServer().getWorlds().get(0).getSpawnLocation());
}
开发者ID:jb-aero,项目名称:SKCompat,代码行数:5,代码来源:SKConsole.java
注:本文中的com.laytonsmith.core.Static类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论