本文整理匯總了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 };
}