当前位置: 首页>>代码示例>>Java>>正文


Java LWC.findProtection方法代码示例

本文整理汇总了Java中com.griefcraft.lwc.LWC.findProtection方法的典型用法代码示例。如果您正苦于以下问题:Java LWC.findProtection方法的具体用法?Java LWC.findProtection怎么用?Java LWC.findProtection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.griefcraft.lwc.LWC的用法示例。


在下文中一共展示了LWC.findProtection方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isInventoryAccessible

import com.griefcraft.lwc.LWC; //导入方法依赖的package包/类
/**
 * Check if the given player has access rights for the given block.
 *
 * @param player player to check
 * @param block block to check
 * @return true if the player may access the block's contents
 */
public boolean isInventoryAccessible(Player player, Block block) {
    switch (invProtectionType) {
        case LWC:
            LWC lwc = SensibleToolboxPlugin.getInstance().getLWC();
            Protection prot = lwc.findProtection(block);
            if (prot != null) {
                boolean ok = lwc.canAccessProtection(player, prot);
                Debugger.getInstance().debug(2, "LWC check: can " + player.getName() + " access " + block + "? " + ok);
                return ok;
            } else {
                return true;
            }
        case WORLDGUARD:
            ApplicableRegionSet set = WGBukkit.getRegionManager(block.getWorld()).getApplicableRegions(block.getLocation());
            return set.allows(DefaultFlag.CHEST_ACCESS, WGBukkit.getPlugin().wrapPlayer(player));
        case BEST:
            throw new IllegalArgumentException("should never get here!");
        default:
            return true;
    }
}
 
开发者ID:desht,项目名称:sensibletoolbox,代码行数:29,代码来源:BlockProtection.java

示例2: protectChest

import com.griefcraft.lwc.LWC; //导入方法依赖的package包/类
void protectChest(CraftoPlayer owner, Block chestBlock) {
	LWCPlugin lwcPlugin = (LWCPlugin) Bukkit.getPluginManager().getPlugin("LWC");
	LWC lwc = lwcPlugin.getLWC();

	Protection protection = lwc.findProtection(chestBlock);
	if (protection != null) {
		// delete
		protection.remove();
	}

	lwc.getPhysicalDatabase().registerProtection(54,
			Protection.Type.PRIVATE,
			chestBlock.getWorld().getName(),
			owner.getUniqueId().toString(),
			null,
			chestBlock.getX(),
			chestBlock.getY(),
			chestBlock.getZ());
}
 
开发者ID:Craftolution,项目名称:CraftoPlugin,代码行数:20,代码来源:ChestFillComponent.java

示例3: removeProtection

import com.griefcraft.lwc.LWC; //导入方法依赖的package包/类
public static void removeProtection(Block block) {
	LWC api = ((LWCPlugin) Bukkit.getPluginManager().getPlugin("LWC")).getLWC();
	Protection protect = api.findProtection(block);
	protect.remove();
}
 
开发者ID:xEssentials,项目名称:xEssentials-deprecated-bukkit,代码行数:6,代码来源:LWCHook.java


注:本文中的com.griefcraft.lwc.LWC.findProtection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。