本文整理汇总了Java中me.ryanhamshire.GriefPrevention.Claim.allowBuild方法的典型用法代码示例。如果您正苦于以下问题:Java Claim.allowBuild方法的具体用法?Java Claim.allowBuild怎么用?Java Claim.allowBuild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类me.ryanhamshire.GriefPrevention.Claim
的用法示例。
在下文中一共展示了Claim.allowBuild方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setBlock
import me.ryanhamshire.GriefPrevention.Claim; //导入方法依赖的package包/类
private static boolean setBlock(Location location, Player player ,
Material material,Material mask){
Claim claim = GriefPrevention.instance.dataStore.getClaimAt(location, true, null);
if(claim == null){
player.sendMessage("You can only use this tool in a claimed area.");
return false;
}
String errormessage = claim.allowBuild(player);
if(errormessage == null){
Block block = location.getBlock();
if(mask == null || block.getType() == mask)
location.getBlock().setType(material);
}
else{
player.sendMessage(errormessage);
return false;
}
return true;
}
示例2: allowbuild
import me.ryanhamshire.GriefPrevention.Claim; //导入方法依赖的package包/类
private boolean allowbuild(Player player, Location location)
{
Claim claim = GriefPrevention.instance.dataStore.getClaimAt(location, true, null);
ForgePermittor.log(isNewerVersion + " " + method , true);
if (claim != null)
try {
return isNewerVersion ? (method.invoke(claim, player, player.getItemInHand().getType())) == null : claim.allowBuild(player) == null;
} catch (Exception e) {
e.printStackTrace();
return false;
}
return true;
}
示例3: isAllowed
import me.ryanhamshire.GriefPrevention.Claim; //导入方法依赖的package包/类
public boolean isAllowed(Player player, Claim claim, MaskType type) {
return claim != null && (claim.getOwnerName().equalsIgnoreCase(player.getName()) || claim.getOwnerName().equals(player.getUniqueId()) || (type == MaskType.MEMBER && (claim.allowBuild(player, Material.AIR) == null)));
}