Example usage for net.minecraftforge.server.permission PermissionAPI hasPermission

List of usage examples for net.minecraftforge.server.permission PermissionAPI hasPermission

Introduction

In this page you can find the example usage for net.minecraftforge.server.permission PermissionAPI hasPermission.

Prototype

public static boolean hasPermission(GameProfile profile, String node, @Nullable IContext context) 

Source Link

Usage

From source file:com.lothrazar.cyclicmagic.registry.PermissionRegistry.java

License:Open Source License

public static boolean hasPermissionHere(EntityPlayer player, BlockPos pos) {
    if (player.world.isRemote) {
        return true;//Do not check permissions on client side! can crash or go crazy
    }/*  www . j a v a 2  s  . c  om*/
    return PermissionAPI.hasPermission(player.getGameProfile(), MODIFYBLOCKS,
            new BlockPosContext(player, pos, null, null));
}