Example usage for net.minecraftforge.server.permission.context BlockPosContext BlockPosContext

List of usage examples for net.minecraftforge.server.permission.context BlockPosContext BlockPosContext

Introduction

In this page you can find the example usage for net.minecraftforge.server.permission.context BlockPosContext BlockPosContext.

Prototype

public BlockPosContext(PlayerEntity ep, BlockPos pos, @Nullable BlockState state, @Nullable Direction f) 

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
    }//from w w  w.  ja  v  a 2  s . c o m
    return PermissionAPI.hasPermission(player.getGameProfile(), MODIFYBLOCKS,
            new BlockPosContext(player, pos, null, null));
}