當前位置: 首頁>>代碼示例>>Java>>正文


Java RegionManager.removeRegion方法代碼示例

本文整理匯總了Java中com.sk89q.worldguard.protection.managers.RegionManager.removeRegion方法的典型用法代碼示例。如果您正苦於以下問題:Java RegionManager.removeRegion方法的具體用法?Java RegionManager.removeRegion怎麽用?Java RegionManager.removeRegion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.sk89q.worldguard.protection.managers.RegionManager的用法示例。


在下文中一共展示了RegionManager.removeRegion方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: execute

import com.sk89q.worldguard.protection.managers.RegionManager; //導入方法依賴的package包/類
protected void execute(Event event) {
	String name = (String) this.name.getSingle(event);
	World world = (World) this.world.getSingle(event);

	RegionManager regionManager = WGBukkit.getRegionManager(world);
	if (!regionManager.hasRegion(name)) {
		Skript.error("Region \"" + name + "\" in world \"" + world.getName() + "\" does not exists.");
		return;
	}

	regionManager.removeRegion(name, RemovalStrategy.REMOVE_CHILDREN);
	try {
		regionManager.save();
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
開發者ID:Sharpjaws,項目名稱:SharpSK,代碼行數:18,代碼來源:EffDeleteRegion.java

示例2: onUpdate

import com.sk89q.worldguard.protection.managers.RegionManager; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public void onUpdate(ObjectId updatedObject) {
    ProcessingProtectedRegion region = storageAdapter.load(updatedObject);
    ProtectedRegion protectedRegion = region.getRegion();
    if (checkIsIgnored(RegionStorageAdapter.RegionPath.create(region.getWorld(), protectedRegion.getId())))
        return;
    RegionManager regionManager = getRegionManager(region.getWorld());
    if (regionManager != null) {
        regionManager.removeRegion(protectedRegion.getId());
        regionManager.addRegion(protectedRegion);
        String parent = region.getParent();
        if (parent != null) {
            try {
                protectedRegion.setParent(regionManager.getRegion(parent));
            } catch (ProtectedRegion.CircularInheritanceException ignore) {
                LOGGER.warning("Circular inheritance for region " + protectedRegion.getId() + " of world " + region.getWorld() + ".");
            }
        }
    }
}
 
開發者ID:maxikg,項目名稱:mongowg,代碼行數:24,代碼來源:WorldGuardOpLogHandler.java

示例3: updateRegion

import com.sk89q.worldguard.protection.managers.RegionManager; //導入方法依賴的package包/類
public static void updateRegion(IslandInfo islandInfo) {
    try {
        ProtectedCuboidRegion region = setRegionFlags(islandInfo);
        RegionManager regionManager = getWorldGuard().getRegionManager(uSkyBlock.getInstance().getWorld());
        regionManager.removeRegion(islandInfo.getName() + "island");
        regionManager.removeRegion(islandInfo.getLeader() + "island");
        regionManager.addRegion(region);
        String netherName = islandInfo.getName() + "nether";
        region = setRegionFlags(islandInfo, netherName);
        World netherWorld = uSkyBlock.getInstance().getSkyBlockNetherWorld();
        if (netherWorld != null) {
            regionManager = getWorldGuard().getRegionManager(netherWorld);
            regionManager.removeRegion(netherName);
            regionManager.addRegion(region);
        }
        islandInfo.setRegionVersion(getVersion());
    } catch (Exception e) {
        LogUtil.log(Level.SEVERE, "ERROR: Failed to update region for " + islandInfo.getName(), e);
    }
}
 
開發者ID:rlf,項目名稱:uSkyBlock,代碼行數:21,代碼來源:WorldGuardHandler.java

示例4: spatial_remove

import com.sk89q.worldguard.protection.managers.RegionManager; //導入方法依賴的package包/類
public boolean spatial_remove(final ABPortal portal) {
    final SafeLocation location = portal.getLocation();
    if ( location == null )
        return true;

    final HashSet<UUID> portals = worldPortals.get(location.getWorldId());
    if ( portals != null && portals.contains(portal.uid) )
        portals.remove(portal.uid);

    final World world = location.getWorld();
    if ( world == null )
        return true;

    final RegionManager rm = wg.getRegionManager(world);
    if ( rm == null )
        return true;

    final String key = "abyss-" + portal.uid.toString();
    if ( rm.hasRegion(key) )
        rm.removeRegion(key);

    return true;
}
 
開發者ID:stendec,項目名稱:Abyss,代碼行數:24,代碼來源:WorldGuardManager.java

示例5: deletarTerreno

import com.sk89q.worldguard.protection.managers.RegionManager; //導入方法依賴的package包/類
public static void deletarTerreno(String player, String nome) {
	World w = TerrenosManager.getTerrenoWorld(player, nome);
	RegionManager rm = wg.getRegionManager(w);
	ProtectedRegion terreno = TerrenosManager.getTerreno(player, nome);
	delTerreno(w, terreno.getMinimumPoint(),terreno.getMaximumPoint());
	rm.removeRegion(player.toLowerCase() + "-" + nome);
	FilesManager.getDataFile().set(player.toLowerCase() + "." + nome.toLowerCase(), null);
	FilesManager.saveDataFile();
	try {
		rm.save();
	} catch (Exception e) {
		Utils.logError("Ocorreu um erro ao salvar os terrenos");
		e.printStackTrace();
	}
}
 
開發者ID:leonardosnt,項目名稱:OldBukkit,代碼行數:16,代碼來源:TerrenosManager.java

示例6: removeProtection

import com.sk89q.worldguard.protection.managers.RegionManager; //導入方法依賴的package包/類
public boolean removeProtection(World world, ProtectedRegion pr) {
    RegionManager rm = wgp.getRegionManager(world);
    rm.removeRegion(pr.getId());
    try {
        rm.save();
    } catch (ProtectionDatabaseException ex) {
        plugin.getLogger().log(Level.SEVERE, "Unexpected failure saving WorldGuard configuration: {0}", ex.toString());
        return false;
    }
    return true;
}
 
開發者ID:ddonofrio,項目名稱:libelula,代碼行數:12,代碼來源:WorldGuardManager.java

示例7: onDelete

import com.sk89q.worldguard.protection.managers.RegionManager; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public void onDelete(ObjectId deletedObject) {
    RegionStorageAdapter.RegionPath path = storageAdapter.resolvePath(deletedObject);
    RegionManager regionManager = getRegionManager(path);
    if (regionManager != null)
        regionManager.removeRegion(path.getId());
}
 
開發者ID:maxikg,項目名稱:mongowg,代碼行數:11,代碼來源:WorldGuardOpLogHandler.java

示例8: removeRegion

import com.sk89q.worldguard.protection.managers.RegionManager; //導入方法依賴的package包/類
public RegionData removeRegion(RegionData regionData, World world) {
    RegionManager manager = CubitBukkitPlugin.inst().getWorldGuardPlugin().getRegionManager(world);
    manager.removeRegion(regionData.getRegionName());
    return regionData;

}
 
開發者ID:MineGaming,項目名稱:cubit,代碼行數:7,代碼來源:ManageRegions.java

示例9: removeIslandRegion

import com.sk89q.worldguard.protection.managers.RegionManager; //導入方法依賴的package包/類
public static void removeIslandRegion(String islandName) {
    RegionManager regionManager = getWorldGuard().getRegionManager(uSkyBlock.getSkyBlockWorld());
    regionManager.removeRegion(islandName + "island");
    regionManager.removeRegion(islandName + "nether");
}
 
開發者ID:rlf,項目名稱:uSkyBlock,代碼行數:6,代碼來源:WorldGuardHandler.java

示例10: exec

import com.sk89q.worldguard.protection.managers.RegionManager; //導入方法依賴的package包/類
@Override
public Construct exec(Target t, Environment env, Construct... args) throws CancelCommandException, ConfigRuntimeException {
	Static.checkPlugin("WorldGuard", t);

	World world = null;
	String region;

	if (args.length == 1) {

		region = args[0].val();

		MCPlayer m = null;

		if (env.getEnv(CommandHelperEnvironment.class).GetCommandSender() instanceof MCPlayer) {
			m = env.getEnv(CommandHelperEnvironment.class).GetPlayer();
		}

		if (m != null) {
			world = Bukkit.getServer().getWorld(m.getWorld().getName());
		}
	} else {
		region = args[1].val();
		world = Bukkit.getServer().getWorld(args[0].val());
	}

	if (world == null) {
		throw new CREInvalidWorldException("Unknown world specified", t);
	}

	RegionManager mgr = WorldGuardPlugin.inst().getRegionManager(world);

	ProtectedRegion regionExists = mgr.getRegion(region);

	if (regionExists == null) {
		throw new CREPluginInternalException(String.format("The region (%s) does not exist in world (%s).", region, world.getName()), t);
	}

	mgr.removeRegion(region);

	try {
		mgr.save();
	} catch (StorageException e) {
		throw new CREPluginInternalException("Error while removing protected region", t, e);
	}

	return CVoid.VOID;
}
 
開發者ID:jb-aero,項目名稱:SKCompat,代碼行數:48,代碼來源:CHWorldGuard.java


注:本文中的com.sk89q.worldguard.protection.managers.RegionManager.removeRegion方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。