Examples of UserIdent


Examples of com.forgeessentials.util.UserIdent

  private void setLimit(String target, int limit)
  {
    if (target.startsWith("p:"))
    {
      APIRegistry.perms.setPlayerPermissionProperty(new UserIdent(target.replaceFirst("p:", "")), PERM_LIMIT_PROP, Integer.toString(limit));
    }
    else if (target.startsWith("g:"))
    {
      APIRegistry.perms.setGroupPermissionProperty(target.replaceFirst("g:", ""), PERM_LIMIT_PROP, Integer.toString(limit));
    }
View Full Code Here

Examples of com.forgeessentials.util.UserIdent

        x = mop.blockX;
        y = mop.blockY;
        z = mop.blockZ;

        WorldPoint point = new WorldPoint(player.dimension, x, y, z);
        if (!APIRegistry.perms.checkUserPermission(new UserIdent(player), point, getPermissionNode()))
        {
            OutputHandler.chatError(player, "Insufficient permissions.");
            return;
        }
View Full Code Here

Examples of com.forgeessentials.util.UserIdent

            if (!(player.getCurrentEquippedItem().getItem().getUnlocalizedName().equals(info.getWandID()))) return;
            if (player.getCurrentEquippedItem().getItemDamage() != info.getWandDmg()) return;
        }

        WorldPoint point = new WorldPoint(player.dimension, event.x, event.y, event.z);
        if (!APIRegistry.perms.checkUserPermission(new UserIdent(player), point, "fe.core.pos"))
        {
            OutputHandler.chatError(player,
                    "You have insufficient permissions to do that. If you believe you received this message in error, please talk to a server admin.");
            return;
        }
View Full Code Here

Examples of com.forgeessentials.util.UserIdent

        }

        // replacing stuff...

    // Player info
    String playerPrefix = FunctionHelper.formatColors(FunctionHelper.getPlayerPrefixSuffix(new UserIdent(event.player), false));
    String playerSuffix = FunctionHelper.formatColors(FunctionHelper.getPlayerPrefixSuffix(new UserIdent(event.player), true));
    String groupPrefix = FunctionHelper.formatColors(FunctionHelper.getPlayerGroupPrefixSuffix(new UserIdent(event.player), false));
    String groupSuffix = FunctionHelper.formatColors(FunctionHelper.getPlayerGroupPrefixSuffix(new UserIdent(event.player), true));
    String zoneID = APIRegistry.perms.getZonesAt(new WorldPoint(event.player)).get(0).getName();
    String rank = "";


        // It may be beneficial to make this a public function. -RlonRyan
View Full Code Here

Examples of com.forgeessentials.util.UserIdent

        if (e.target == null)
            return;

        EntityPlayer source = e.entityPlayer;
        UserIdent sourceIdent = new UserIdent(source);
        if (e.target instanceof EntityPlayer)
        {
            // player -> player
            EntityPlayer target = (EntityPlayer) e.target;
            if (!APIRegistry.perms.checkUserPermission(new UserIdent(target), ModuleProtection.PERM_PVP)
                    || !APIRegistry.perms.checkUserPermission(sourceIdent, ModuleProtection.PERM_PVP)
                    || !APIRegistry.perms.checkUserPermission(sourceIdent, new WorldPoint(target), ModuleProtection.PERM_PVP))
            {
                e.setCanceled(true);
            }
View Full Code Here

Examples of com.forgeessentials.util.UserIdent

            EntityPlayer target = (EntityPlayer) e.entityLiving;
            {
                String permission = ModuleProtection.PERM_DAMAGE_BY + "." + e.source.damageType;
                if (ModuleProtection.isDebugMode(target))
                    OutputHandler.chatNotification(target, permission);
                if (!APIRegistry.perms.checkUserPermission(new UserIdent(target), permission))
                {
                    e.setCanceled(true);
                    return;
                }
            }
           
            if (e.source.getEntity() != null)
            {
                // non-player-entity -> player (mob)
                Entity source = e.source.getEntity();
                String permission = ModuleProtection.PERM_DAMAGE_BY + "." + source.getClass().getSimpleName();
                if (ModuleProtection.isDebugMode(target))
                    OutputHandler.chatNotification(target, permission);
                if (!APIRegistry.perms.checkUserPermission(new UserIdent(target), permission))
                {
                    e.setCanceled(true);
                    return;
                }
            }
        }
       
        if (e.source.getEntity() instanceof EntityPlayer)
        {
            // player -> living
            EntityPlayer source = (EntityPlayer) e.source.getEntity();
            WorldPoint point = new WorldPoint(e.entityLiving);

//            String permission = ModuleProtection.PERM_DAMAGE_TO + "." + e.entityLiving.getClass().getSimpleName();
//            if (ModuleProtection.isDebugMode(source))
//                OutputHandler.chatNotification(source, permission);
//            if (!APIRegistry.perms.checkUserPermission(new UserIdent(source), point, ModuleProtection.PERM_INTERACT_ENTITY))
//            {
//                e.setCanceled(true);
//                return;
//            }
           
            if (e.entityLiving instanceof EntityPlayer)
            {
                // player -> player
                if (!APIRegistry.perms.checkUserPermission(new UserIdent((EntityPlayer) e.entityLiving), ModuleProtection.PERM_PVP)
                        || !APIRegistry.perms.checkUserPermission(new UserIdent(source), ModuleProtection.PERM_PVP)
                        || !APIRegistry.perms.checkUserPermission(new UserIdent(source), point, ModuleProtection.PERM_PVP))
                {
                    e.setCanceled(true);
                    return;
                }
            }
View Full Code Here

Examples of com.forgeessentials.util.UserIdent

        Block block = e.world.getBlock(e.x, e.y, e.z);
        String permission = ModuleProtection.PERM_BREAK + "." + block.getUnlocalizedName() + "." + block.getDamageValue(e.world, e.x, e.y, e.z);
        if (ModuleProtection.isDebugMode(e.getPlayer()))
            OutputHandler.chatNotification(e.getPlayer(), permission);
        WorldPoint point = new WorldPoint(e.getPlayer().dimension, e.x, e.y, e.z);
        if (!APIRegistry.perms.checkUserPermission(new UserIdent(e.getPlayer()), point, ModuleProtection.PERM_OVERRIDE_BREAK)
                && !APIRegistry.perms.checkUserPermission(new UserIdent(e.getPlayer()), point, permission))
        {
            e.setCanceled(true);
        }
    }
View Full Code Here

Examples of com.forgeessentials.util.UserIdent

    public void placeEvent(BlockEvent.PlaceEvent e)
    {
        if (FMLCommonHandler.instance().getEffectiveSide().isClient())
            return;

        UserIdent ident = new UserIdent(e.player);
        Block block = e.world.getBlock(e.x, e.y, e.z);
        String permission = ModuleProtection.PERM_PLACE + "." + block.getUnlocalizedName() + "." + block.getDamageValue(e.world, e.x, e.y, e.z);
        if (ModuleProtection.isDebugMode(e.player))
            OutputHandler.chatNotification(e.player, permission);
        WorldPoint point = new WorldPoint(e.player.dimension, e.x, e.y, e.z);
View Full Code Here

Examples of com.forgeessentials.util.UserIdent

            Block block = e.world.getBlock(b.x, b.y, b.z);
            String permission = ModuleProtection.PERM_PLACE + "." + block.getUnlocalizedName() + "." + block.getDamageValue(e.world, e.x, e.y, e.z);
            if (ModuleProtection.isDebugMode(e.player))
                OutputHandler.chatNotification(e.player, permission);
            WorldPoint point = new WorldPoint(e.player.dimension, b.x, b.y, b.z);
            if (!APIRegistry.perms.checkUserPermission(new UserIdent(e.player), point, ModuleProtection.PERM_OVERRIDE_PLACE)
                    && !APIRegistry.perms.checkUserPermission(new UserIdent(e.player), point, permission))
            {
                e.setCanceled(true);
                return;
            }
        }
View Full Code Here

Examples of com.forgeessentials.util.UserIdent

    public void playerInteractEvent(PlayerInteractEvent e)
    {
        if (FMLCommonHandler.instance().getEffectiveSide().isClient())
            return;

        UserIdent ident = new UserIdent(e.entityPlayer);

        WorldPoint point;
        if (e.action == RIGHT_CLICK_AIR)
        {
            MovingObjectPosition mop = FunctionHelper.getPlayerLookingSpot(e.entityPlayer);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.