本文整理汇总了Java中com.sk89q.worldguard.protection.flags.DoubleFlag类的典型用法代码示例。如果您正苦于以下问题:Java DoubleFlag类的具体用法?Java DoubleFlag怎么用?Java DoubleFlag使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DoubleFlag类属于com.sk89q.worldguard.protection.flags包,在下文中一共展示了DoubleFlag类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: get
import com.sk89q.worldguard.protection.flags.DoubleFlag; //导入依赖的package包/类
@Override
@Nullable
protected String[] get(Event e) {
WorldGuardPlugin wg = (WorldGuardPlugin) Bukkit.getServer().getPluginManager().getPlugin("WorldGuard");
RegionManager set = wg.getRegionManager(world.getSingle(e));
ProtectedRegion pr = null;
String finalv = null;
for (Entry<String, ProtectedRegion> a : set.getRegions().entrySet()) {
if (a.getKey().equals(region.getSingle(e))) {
pr = a.getValue();
}
try {
for (Entry<Flag<?>, Object> b : pr.getFlags().entrySet()) {
if (b.getKey().getName().equalsIgnoreCase(flag.getSingle(e))) {
if (b.getKey() instanceof StateFlag) {
if (b.getValue() == StateFlag.State.ALLOW) {
finalv = "ALLOW";
} else if (b.getValue() == StateFlag.State.DENY) {
finalv = "DENY";
} else {
return new String[] {};
}
} else if (b.getKey() instanceof StringFlag) {
finalv = (String) b.getKey().getDefault();
} else if (b.getKey() instanceof IntegerFlag) {
finalv = (String) b.getKey().getDefault();
} else if (b.getKey() instanceof DoubleFlag) {
finalv = (String) b.getKey().getDefault();
}
break;
}
}
} catch (NullPointerException ex) {
return new String[] {};
}
}
return new String[] { finalv };
}