本文整理汇总了Java中com.sk89q.worldguard.protection.flags.RegionGroup类的典型用法代码示例。如果您正苦于以下问题:Java RegionGroup类的具体用法?Java RegionGroup怎么用?Java RegionGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RegionGroup类属于com.sk89q.worldguard.protection.flags包,在下文中一共展示了RegionGroup类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setFlag
import com.sk89q.worldguard.protection.flags.RegionGroup; //导入依赖的package包/类
public static <T> void setFlag(ProtectedRegion region, Flag<T> flag, String value) throws CommandException, InvalidFlagFormat {
CommandContext ccontext = new CommandContext("rg "+value, valueFlags);
region.setFlag(flag, flag.parseInput(WGBukkit.getPlugin(), Bukkit.getConsoleSender(), ccontext.getRemainingString(0)));
if (ccontext.hasFlag('g')) {
String group = ccontext.getFlag('g');
RegionGroupFlag groupFlag = flag.getRegionGroupFlag();
if (groupFlag == null) {
return;
}
RegionGroup groupValue = groupFlag.parseInput(WGBukkit.getPlugin(), Bukkit.getConsoleSender(), group);
if (groupValue == groupFlag.getDefault()) {
region.setFlag(groupFlag, null);
} else {
region.setFlag(groupFlag, groupValue);
}
}
}
示例2: enablePacket
import com.sk89q.worldguard.protection.flags.RegionGroup; //导入依赖的package包/类
@Override
public RegionData enablePacket(RegionData regionData) {
RegionGroupFlag groupFlag = DefaultFlag.USE.getRegionGroupFlag();
regionData.praseWGRegion().setFlag(groupFlag, RegionGroup.NON_MEMBERS);
regionData.praseWGRegion().setFlag(DefaultFlag.USE, StateFlag.State.DENY);
return regionData;
}
示例3: disablePacket
import com.sk89q.worldguard.protection.flags.RegionGroup; //导入依赖的package包/类
@Override
public RegionData disablePacket(RegionData regionData) {
RegionGroupFlag groupFlag = DefaultFlag.USE.getRegionGroupFlag();
regionData.praseWGRegion().setFlag(groupFlag, RegionGroup.ALL);
regionData.praseWGRegion().setFlag(DefaultFlag.USE, StateFlag.State.ALLOW);
return regionData;
}
示例4: createFlag
import com.sk89q.worldguard.protection.flags.RegionGroup; //导入依赖的package包/类
/**
* Create a custom flag for WorldGuard.
*
* @param type The type of flag.
* @param id The name/id of the flag.
* @param value The default value of the flag.
* @param regionGroup The default region-group of the flag.
* @return The creation status.
* @deprecated Currently only supports 'STATE' flags.
*/
public static Status createFlag(String type, String id, Object value, String regionGroup) {
if (!worldGuardEnabled()) {
protoFlags.put(id, new ProtoFlag(type, id, value, regionGroup, false));
return Status.IN_QUEUE;
}
try {
flags.put(id, new StateFlag(id, Boolean.valueOf(value.toString()), RegionGroup.valueOf(regionGroup.toUpperCase())));
return Status.SUCCESS;
} catch (Exception ignored) {
}
return Status.FAILED;
}
示例5: apply
import com.sk89q.worldguard.protection.flags.RegionGroup; //导入依赖的package包/类
@Override
public StateFlag apply(ProtoFlag protoFlag) {
try {
return new StateFlag(protoFlag.getId(), Boolean.valueOf(protoFlag.getValue().toString()), RegionGroup.valueOf(protoFlag.getRegionGroup().toUpperCase()));
} catch (Exception ignored) {
}
return null;
}
示例6: groupFlags
import com.sk89q.worldguard.protection.flags.RegionGroup; //导入依赖的package包/类
public static void groupFlags(ProtectedRegion region,Flag<?> flag, String group){
RegionGroupFlag regionGroupFlag = flag.getRegionGroupFlag();
RegionGroup regionGroup = RegionGroup.valueOf(group.toUpperCase());
region.setFlag(regionGroupFlag, regionGroup);
}
示例7: parseFlagGroupInput
import com.sk89q.worldguard.protection.flags.RegionGroup; //导入依赖的package包/类
@Override
public RegionGroup parseFlagGroupInput(RegionGroupFlag flag, String input) throws InvalidFlagFormat {
return flag.parseInput(FlagContext.create().setInput(input).build());
}
示例8: parseFlagGroupInput
import com.sk89q.worldguard.protection.flags.RegionGroup; //导入依赖的package包/类
@Override
public RegionGroup parseFlagGroupInput(RegionGroupFlag flag, String input) throws InvalidFlagFormat {
return flag.parseInput(WorldGuardPlugin.inst(), null, input);
}
示例9: parseFlagGroupInput
import com.sk89q.worldguard.protection.flags.RegionGroup; //导入依赖的package包/类
/**
* Convert string input to a region group flag value.
* @param flag The flag to parse the input for
* @param input The input
* @return The RegionGroup denoted by the input
* @throws InvalidFlagFormat When the input for the flag is incorrect
*/
public abstract RegionGroup parseFlagGroupInput(RegionGroupFlag flag, String input) throws InvalidFlagFormat;