Package net.minecraft.entity.player

Examples of net.minecraft.entity.player.EntityPlayer


    nbtRoot = NetworkUtil.readNBTTagCompound(buf);
  }

  @Override
  public IMessage onMessage(PacketNutrientLevel message, MessageContext ctx) {
    EntityPlayer player = EnderIO.proxy.getClientPlayer();
    TileKillerJoe tile = message.getTileEntity(player.worldObj);
    if (tile != null) {
      if(message.nbtRoot.hasKey("tank")) {
        NBTTagCompound tankRoot = message.nbtRoot.getCompoundTag("tank");
        tile.fuelTank.readFromNBT(tankRoot);
View Full Code Here


    nbtRoot = NetworkUtil.readNBTTagCompound(buf);
  }

  @Override
  public IMessage onMessage(PacketPowerInfo message, MessageContext ctx) {
    EntityPlayer player = EnderIO.proxy.getClientPlayer();
    TilePowerMonitor te = message.getTileEntity(player.worldObj);
    if(te != null) {
      te.readPowerInfoFromNBT(message.nbtRoot);
    }
    return null;
View Full Code Here

    stopLevel = buffer.readFloat();
  }

  @Override
  public IMessage onMessage(PacketPowerMonitor message, MessageContext ctx) {
    EntityPlayer player = ctx.getServerHandler().playerEntity;
    TileEntity te = player.worldObj.getTileEntity(message.x, message.y, message.z);
    if(!(te instanceof TilePowerMonitor)) {
      Log.warn("createPowerMonitotPacket: Could not handle packet as TileEntity was not a TilePowerMonitor.");
      return null;
    }
View Full Code Here

    super(tile);
  }

  @Override
  public IMessage onMessage(PacketSwing message, MessageContext ctx) {
    EntityPlayer player = EnderIO.proxy.getClientPlayer();
    TileKillerJoe tile = message.getTileEntity(player.worldObj);
    if (tile != null) {
      tile.swingWeapon();
    }
    return null;
View Full Code Here

 
  @Override
  public void toolUsed(ItemStack item, EntityLivingBase user, int x, int y, int z) {
    Block block = user.worldObj.getBlock(x, y, z);
    if (user.isSneaking() && block instanceof IDismantleable && user instanceof EntityPlayer) {
      EntityPlayer player = (EntityPlayer) user;
      IDismantleable machine = (IDismantleable) block;
      if (machine.canDismantle(player, player.worldObj, x, y, z) && !player.worldObj.isRemote) {
          machine.dismantleBlock(player, player.worldObj, x, y, z, false);
      }
    }
View Full Code Here

  @Override
  public boolean onDefend(IInterdictionMatrix interdictionMatrix, EntityLivingBase entityLiving)
  {
    if (entityLiving instanceof EntityPlayer)
    {
      EntityPlayer player = (EntityPlayer) entityLiving;

      IBiometricIdentifier biometricIdentifier = interdictionMatrix.getBiometricIdentifier();

      if (biometricIdentifier != null && biometricIdentifier.isAccessGranted(player.username, Permission.DEFENSE_STATION_CONFISCATION))
      {
        return false;
      }
    }

    Set<ItemStack> controlledStacks = interdictionMatrix.getFilteredItems();

    int confiscationCount = 0;
    IInventory inventory = null;

    if (entityLiving instanceof EntityPlayer)
    {
      IBiometricIdentifier biometricIdentifier = interdictionMatrix.getBiometricIdentifier();

      if (biometricIdentifier != null && biometricIdentifier.isAccessGranted(((EntityPlayer) entityLiving).username, Permission.BYPASS_INTERDICTION_MATRIX))
      {
        return false;
      }

      EntityPlayer player = (EntityPlayer) entityLiving;
      inventory = player.inventory;
    }
    else if (entityLiving instanceof IInventory)
    {
      inventory = (IInventory) entityLiving;
View Full Code Here

  {
    boolean hasPermission = false;

    if (!hasPermission && entityLiving instanceof EntityPlayer)
    {
      EntityPlayer player = (EntityPlayer) entityLiving;

      if (!player.capabilities.isCreativeMode && !player.isEntityInvulnerable())
      {
        for (int i = 0; i < player.inventory.getSizeInventory(); i++)
        {
          if (player.inventory.getStackInSlot(i) != null)
          {
            interdictionMatrix.mergeIntoInventory(player.inventory.getStackInSlot(i));
            player.inventory.setInventorySlotContents(i, null);
          }
        }
        player.setHealth(1);
        player.attackEntityFrom(ModularForceFieldSystem.damagefieldShock, 100);
        interdictionMatrix.requestFortron(Settings.INTERDICTION_MURDER_ENERGY, false);

        player.addChatMessage("[" + interdictionMatrix.getInvName() + "] " + LanguageUtility.getLocal("message.moduleAntiPersonnel.death"));
      }
    }

    return false;
  }
View Full Code Here

      for (EntityLivingBase entityLiving : warningList)
      {
        if (entityLiving instanceof EntityPlayer && !actionList.contains(entityLiving))
        {
          EntityPlayer player = (EntityPlayer) entityLiving;

          boolean isGranted = false;

          if (biometricIdentifier != null && biometricIdentifier.isAccessGranted(player.username, Permission.BYPASS_INTERDICTION_MATRIX))
          {
            isGranted = true;
          }

          if (!isGranted && this.worldObj.rand.nextInt(3) == 0 && getModuleCount(ModularForceFieldSystem.itemModuleSilence) <= 0)
          {
            player.addChatMessage("[" + this.getInvName() + "] " + LanguageUtility.getLocal("message.interdictionMatrix.warn"));
          }

        }
      }
View Full Code Here

    /**
     * Check for security permission to see if this player should be ignored.
     */
    if (entityLiving instanceof EntityPlayer)
    {
      EntityPlayer player = (EntityPlayer) entityLiving;

      IBiometricIdentifier biometricIdentifier = this.getBiometricIdentifier();

      if (biometricIdentifier != null && biometricIdentifier.isAccessGranted(player.username, Permission.BYPASS_INTERDICTION_MATRIX))
      {
View Full Code Here

      if (field.contains(fieldPos))
      {
        if (entity instanceof EntityPlayer)
        {
          EntityPlayer entityPlayer = (EntityPlayer) entity;

          if (entityPlayer.isSneaking())
          {
            IBiometricIdentifier biometricIdentifier = projector.getBiometricIdentifier();

            if (entityPlayer.capabilities.isCreativeMode)
            {
View Full Code Here

TOP

Related Classes of net.minecraft.entity.player.EntityPlayer

Copyright © 2018 www.massapicom. 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.