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


Java LWC类代码示例

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


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

示例1: removeLWC

import com.griefcraft.lwc.LWC; //导入依赖的package包/类
/**
 * Remove any LWC Data that may be on the plot.
 */
public void removeLWC(final Plot plot) {
    final int x1 = plot.getBottomX();
    final int z1 = plot.getBottomZ();
    final int x2 = plot.getTopX();
    final int z2 = plot.getBottomZ();

    plugin.getServerBridge().runTaskAsynchronously(new Runnable() {
        @Override
        public void run() {
            LWC lwc = LWC.getInstance();
            List<Protection> protections = lwc.getPhysicalDatabase().loadProtections(plot.getWorld().getName(), x1, x2, 0, 256, z1, z2);

            for (Protection protection : protections) {
                protection.remove();
            }
        }
    });
}
 
开发者ID:WorldCretornica,项目名称:PlotMe-Core,代码行数:22,代码来源:PlotMeCoreManager.java

示例2: setInvProtectionType

import com.griefcraft.lwc.LWC; //导入依赖的package包/类
/**
 * Set the inventory protection method to be used by STB.  If a type of
 * BEST is supplied, STB will choose the best available protection method.
 *
 * @param invProtectionType the desired protection type
 */
public void setInvProtectionType(InvProtectionType invProtectionType) {
    switch (invProtectionType) {
        case BEST:
            if (SensibleToolbox.getPluginInstance().getLWC() != null) {
                this.invProtectionType = InvProtectionType.LWC;
            } else if (SensibleToolbox.getPluginInstance().isWorldGuardAvailable()) {
                this.invProtectionType = InvProtectionType.WORLDGUARD;
            } else {
                this.invProtectionType = InvProtectionType.NONE;
            }
            break;
        default:
            if (invProtectionType.isAvailable()) {
                this.invProtectionType = invProtectionType;
            } else {
                LogUtils.warning("Inventory protection type " + invProtectionType + " is not available");
                this.invProtectionType = InvProtectionType.NONE;
            }
            break;
    }
    Debugger.getInstance().debug("Using inventory protection method: " + this.invProtectionType);
}
 
开发者ID:desht,项目名称:sensibletoolbox,代码行数:29,代码来源:BlockProtection.java

示例3: 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

示例4: 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

示例5: loadLWC

import com.griefcraft.lwc.LWC; //导入依赖的package包/类
/**
 * load / reload the instance of LWC
 */
public void loadLWC() {
    if (manager.isPluginEnabled("LWC")) {
        lwc = LWC.getInstance();
        PluginDescriptionFile desc = lwc.getPlugin().getDescription();
        lwcIntegration = new LWCIntegration();
        MessageUtil.log(this, "Successfully hooked into " + desc.getName() + " v" + desc.getVersion() + ".");
    } else {
        MessageUtil.log(this, "&4Could not find LWC.");
    }
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:14,代码来源:FactionsXL.java

示例6: canAccess

import com.griefcraft.lwc.LWC; //导入依赖的package包/类
private boolean canAccess(Player p, Block b){
    if(!LWC.getInstance().isProtectable(b)) return true;

    return LWC.getInstance().getProtectionCache().getProtection(b) == null || LWC.getInstance().canAccessProtection(p, b);
}
 
开发者ID:TheBusyBiscuit,项目名称:CS-CoreLib,代码行数:6,代码来源:LWCProtectionModule.java

示例7: getLWC

import com.griefcraft.lwc.LWC; //导入依赖的package包/类
public LWC getLWC() {
    return lwc;
}
 
开发者ID:desht,项目名称:sensibletoolbox,代码行数:4,代码来源:SensibleToolboxPlugin.java

示例8: isOwner

import com.griefcraft.lwc.LWC; //导入依赖的package包/类
public static boolean isOwner(Player p, Block block) {
	LWC api = ((LWCPlugin) Bukkit.getPluginManager().getPlugin("LWC")).getLWC();
	return api.canAccessProtection(p, block);
}
 
开发者ID:xEssentials,项目名称:xEssentials-deprecated-bukkit,代码行数:5,代码来源:LWCHook.java

示例9: 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

示例10: getLWC

import com.griefcraft.lwc.LWC; //导入依赖的package包/类
/**
 * @return
 * the loaded instance of LWC
 */
public LWC getLWC() {
    return lwc;
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:8,代码来源:FactionsXL.java

示例11: isAvailable

import com.griefcraft.lwc.LWC; //导入依赖的package包/类
public boolean isAvailable() {
    switch (this) {
        case WORLDGUARD: return SensibleToolbox.getPluginInstance().isWorldGuardAvailable();
        case LWC: return SensibleToolbox.getPluginInstance().getLWC() != null;
        default: return true;
    }
}
 
开发者ID:desht,项目名称:sensibletoolbox,代码行数:8,代码来源:BlockProtection.java


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