本文整理了Java中com.sk89q.worldguard.WorldGuard.getFlagRegistry()
方法的一些代码示例,展示了WorldGuard.getFlagRegistry()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorldGuard.getFlagRegistry()
方法的具体详情如下:
包路径:com.sk89q.worldguard.WorldGuard
类名称:WorldGuard
方法名:getFlagRegistry
[英]Get the flag registry.
[中]获取旗帜注册。
代码示例来源:origin: EngineHub/WorldGuard
public static @Nullable Flag get(final String id) {
return WorldGuard.getInstance().getFlagRegistry().get(id);
}
代码示例来源:origin: EngineHub/WorldGuard
public static <T extends Flag> T register(final T flag) throws FlagConflictException {
WorldGuard.getInstance().getFlagRegistry().register(flag);
return flag;
}
代码示例来源:origin: EngineHub/WorldGuard
protected FlagRegistry getFlagRegistry() {
return WorldGuard.getInstance().getFlagRegistry();
}
代码示例来源:origin: EngineHub/WorldGuard
protected FlagRegistry getFlagRegistry() {
return WorldGuard.getInstance().getFlagRegistry();
}
代码示例来源:origin: EngineHub/WorldGuard
protected FlagRegistry getFlagRegistry() {
return WorldGuard.getInstance().getFlagRegistry();
}
代码示例来源:origin: EngineHub/WorldGuard
boolean hasFlags = false;
for (Flag<?> flag : WorldGuard.getInstance().getFlagRegistry()) {
Object val = region.getFlag(flag), group = null;
代码示例来源:origin: mcMMO-Dev/mcMMO
public void registerFlags()
{
if(getWorldGuard() == null)
return;
FlagRegistry registry = WorldGuard.getInstance().getFlagRegistry();
try {
// register our flag with the registry
/*registry.register(WorldGuardFlags.MCMMO_ENABLE_WG_FLAG);
registry.register(WorldGuardFlags.MCMMO_XP_WG_FLAG);*/
registry.register(WorldGuardFlags.MCMMO_ENABLE_WG_FLAG);
registry.register(WorldGuardFlags.MCMMO_XP_WG_FLAG);
System.out.println("mcMMO has registered WG flags successfully!");
} catch (FlagConflictException e) {
e.printStackTrace();
System.out.println("mcMMO has failed to register WG flags!");
// some other plugin registered a flag by the same name already.
// you may want to re-register with a different name, but this
// could cause issues with saved flags in region files. it's better
// to print a message to let the server admin know of the conflict
}
}
代码示例来源:origin: NyaaCat/RPGItems-reloaded
public static void init() {
worldGuardInstance = WorldGuard.getInstance();
FlagRegistry registry = worldGuardInstance.getFlagRegistry();
try {
registry.register(warningMessage);
registry.register(disabledPower);
registry.register(enabledPower);
registry.register(disabledItem);
registry.register(enabledItem);
registry.register(disabledPlayer);
registry.register(enabledPlayer);
RPGItems.logger.info("WorldGuard custom flags registered");
} catch (FlagConflictException e) {
WGSupport.useWorldGuard = false;
RPGItems.plugin.getLogger().log(Level.SEVERE, "Error WorldGuard registering custom flags", e);
}
}
代码示例来源:origin: EngineHub/WorldGuard
/**
* Initialize the region container.
*/
public void initialize() {
ConfigurationManager config = WorldGuard.getInstance().getPlatform().getGlobalStateManager();
container = new RegionContainerImpl(config.selectedRegionStoreDriver, WorldGuard.getInstance().getFlagRegistry());
loadWorlds();
// Migrate to UUIDs
autoMigrate();
}
代码示例来源:origin: EngineHub/WorldGuard
/**
* Execute auto-migration.
*/
protected void autoMigrate() {
ConfigurationManager config = WorldGuard.getInstance().getPlatform().getGlobalStateManager();
if (config.migrateRegionsToUuid) {
RegionDriver driver = getDriver();
UUIDMigration migrator = new UUIDMigration(driver, WorldGuard.getInstance().getProfileService(), WorldGuard.getInstance().getFlagRegistry());
migrator.setKeepUnresolvedNames(config.keepUnresolvedNames);
try {
migrate(migrator);
WorldGuard.logger.info("Regions saved after UUID migration! This won't happen again unless " +
"you change the relevant configuration option in WorldGuard's config.");
config.disableUuidMigration();
} catch (MigrationException e) {
WorldGuard.logger.log(Level.WARNING, "Failed to execute the migration", e);
}
}
}
代码示例来源:origin: EngineHub/WorldGuard
RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
RegionDriver driver = container.getDriver();
UUIDMigration migration = new UUIDMigration(driver, WorldGuard.getInstance().getProfileService(), WorldGuard.getInstance().getFlagRegistry());
migration.setKeepUnresolvedNames(config.keepUnresolvedNames);
sender.print("Now performing migration... this may take a while.");
代码示例来源:origin: EngineHub/WorldGuard
DriverMigration migration = new DriverMigration(fromDriver, toDriver, WorldGuard.getInstance().getFlagRegistry());
代码示例来源:origin: EngineHub/WorldGuard
String value = args.argsLength() >= 3 ? args.getJoinedStrings(2) : null;
RegionGroup groupValue = null;
FlagRegistry flagRegistry = WorldGuard.getInstance().getFlagRegistry();
RegionPermissionModel permModel = getPermissionModel(sender);
代码示例来源:origin: EngineHub/WorldGuard
((SimpleFlagRegistry) WorldGuard.getInstance().getFlagRegistry()).setInitialized(true);
内容来源于网络,如有侵权,请联系作者删除!