当前位置: 首页>>代码示例>>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;未经允许,请勿转载。