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


Java ProtectedRegion.isOwner方法代碼示例

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


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

示例1: onCommandProcess

import com.sk89q.worldguard.protection.regions.ProtectedRegion; //導入方法依賴的package包/類
@EventHandler
void onCommandProcess(PlayerCommandPreprocessEvent e) {
	Player p = e.getPlayer();
	ProtectedRegion region = Hooks.getWorldguard().getRegionManager(p.getWorld()).getRegion(TerrenosManager.getTerrenoIdByBlock(e.getPlayer().getLocation().getBlock()));
	if (region == null || !region.getId().contains("-")) return;
	String[] s = region.getId().split("-");
	
	if (!region.isOwner(e.getPlayer().getName()) && !region.isMember(e.getPlayer().getName())) {
		for (String cmd : Utils.getComandosBloqueados(s[0], s[1])) {
			if (e.getMessage().startsWith(cmd)) {
				p.sendMessage(Utils.getMensagem("comando_bloqueado"));
				e.setCancelled(true);
				break;
			}
		}
	}
}
 
開發者ID:leonardosnt,項目名稱:OldBukkit,代碼行數:18,代碼來源:PlayerListener.java

示例2: isAllowed

import com.sk89q.worldguard.protection.regions.ProtectedRegion; //導入方法依賴的package包/類
public boolean isAllowed(LocalPlayer localplayer, ProtectedRegion region) {
    if (region.isOwner(localplayer) || region.isOwner(localplayer.getName())) {
        return true;
    } else if (region.getId().toLowerCase().equals(localplayer.getName().toLowerCase())) {
        return true;
    } else if (region.getId().toLowerCase().contains(localplayer.getName().toLowerCase() + "//")) {
        return true;
    } else if (region.isOwner("*")) {
        return true;
    }
    if (localplayer.hasPermission("fawe.worldguard.member")) {
        if (region.isMember(localplayer) || region.isMember(localplayer.getName())) {
            return true;
        } else if (region.isMember("*")) {
            return true;
        }
    }
    return false;
}
 
開發者ID:boy0001,項目名稱:FastAsyncWorldedit,代碼行數:20,代碼來源:Worldguard.java

示例3: getTerrenoNome

import com.sk89q.worldguard.protection.regions.ProtectedRegion; //導入方法依賴的package包/類
public static String getTerrenoNome(Player p) {
	for (ProtectedRegion pr : wg.getRegionManager(p.getWorld()).getApplicableRegions(p.getLocation())) {
		if (pr.isOwner(wg.wrapPlayer(p)) && pr.getId().contains("-")) {
			return pr.getId().split("-")[1];
		}
	}
	return "";
}
 
開發者ID:leonardosnt,項目名稱:OldBukkit,代碼行數:9,代碼來源:TerrenosManager.java

示例4: checkBlock

import com.sk89q.worldguard.protection.regions.ProtectedRegion; //導入方法依賴的package包/類
private boolean checkBlock(Player player, Block block) {

        if (player.hasPermission("umagic.bypass")) return true;

        RegionManager regionManager = getWorldGuard().getRegionManager(block.getWorld());
        ApplicableRegionSet applicableRegionSet = regionManager.getApplicableRegions(block.getLocation());

        if (applicableRegionSet.getRegions().isEmpty()) {
            getActionMessage().message(player, "" + ChatColor.RED + ChatColor.BOLD
                    + "The " + ChatColor.AQUA + ChatColor.BOLD + "Magical Hoe"
                    + ChatColor.RED + ChatColor.BOLD + " can only be used in regions!");
            return false;
        }

        for (ProtectedRegion region : applicableRegionSet.getRegions()) {

            boolean isOwner = region.isOwner(getWorldGuard().wrapPlayer(player));
            boolean isMember = region.isMember(getWorldGuard().wrapPlayer(player));

            if (!isOwner) if (!isMember) {
                getActionMessage().message(player, "" + ChatColor.RED + ChatColor.BOLD
                        + "You are not an owner or member of this region!");
                return false;
            }

        }

        return true;

    }
 
開發者ID:Ullarah,項目名稱:MinecraftPlugins,代碼行數:31,代碼來源:MagicFunctions.java

示例5: isInYourRegion

import com.sk89q.worldguard.protection.regions.ProtectedRegion; //導入方法依賴的package包/類
public static boolean isInYourRegion(Player p) {
	for (ProtectedRegion pr : wg.getRegionManager(p.getWorld()).getApplicableRegions(p.getLocation())) {
		return pr.isOwner(wg.wrapPlayer(p));
	}
	return false;
}
 
開發者ID:leonardosnt,項目名稱:OldBukkit,代碼行數:7,代碼來源:TerrenosManager.java

示例6: checkBlock

import com.sk89q.worldguard.protection.regions.ProtectedRegion; //導入方法依賴的package包/類
public boolean checkBlock(Player player, Block block) {

        if (player.hasPermission("chest.bypass")) return true;

        RegionManager regionManager = ChestInit.getWorldGuard().getRegionManager(block.getWorld());
        ApplicableRegionSet applicableRegionSet = regionManager.getApplicableRegions(block.getLocation());

        if (applicableRegionSet.getRegions().isEmpty()) return false;
        for (ProtectedRegion r : applicableRegionSet.getRegions())
            if (!r.isOwner(ChestInit.getWorldGuard().wrapPlayer(player))) return false;

        return true;

    }
 
開發者ID:Ullarah,項目名稱:MinecraftPlugins,代碼行數:15,代碼來源:ChestFunctions.java


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