Examples of EntityPlayer


Examples of net.minecraft.entity.player.EntityPlayer

  @SubscribeEvent
  public void onDrops(LivingDropsEvent event) {
    if (event.source.damageType.equals("player")) {

      EntityPlayer player = (EntityPlayer) event.source.getEntity();
      ItemStack stack = player.getCurrentEquippedItem();
      if (stack != null && stack.getItem() == this && stack.stackTagCompound != null && stack.stackTagCompound.getInteger("Activated") == 1) {
        Aspect[] aspects = EnumMobAspect.getAspectsForEntity(event.entity);
        //ScanResult sr=new ScanResult((byte)2,0,0,event.entity,"");
        //AspectList as=ScanManager.getScanAspects(sr,event.entity.worldObj);
        //if(as!=null && as.size()!=0){
View Full Code Here

Examples of net.minecraft.entity.player.EntityPlayer

    boolean handle = handleNext == 0;
    if (!handle)
      handleNext--;

    if (event.entityLiving instanceof EntityPlayer && handle) {
      EntityPlayer player = (EntityPlayer) event.entityLiving;
            ItemStack itemInUse = player.itemInUse;
            if (itemInUse != null && itemInUse.getItem() == this) {

        event.setCanceled(true);
        handleNext = 3;
        player.attackEntityFrom(DamageSource.magic, 3);
      }
    }

    if (handle) {
      Entity source = event.source.getSourceOfDamage();
View Full Code Here

Examples of net.minecraft.entity.player.EntityPlayer

    }

  @Override
  public void processCommand(ICommandSender icommandsender, String[] astring) {
    if (icommandsender instanceof EntityPlayer) {
      EntityPlayer player = (EntityPlayer) icommandsender;
      for (Aspect as : Aspect.aspects.values()) {
        Thaumcraft.proxy.getResearchManager().completeAspect(player, as, (short) 99);
      }
      player.addChatComponentMessage(new ChatComponentText("Added 99 research to all aspects"));
    }

  }
View Full Code Here

Examples of net.minecraft.entity.player.EntityPlayer

    }

    @Override
    public void processCommand(ICommandSender sender, String[] args) {
        if (sender instanceof EntityPlayer) {
            EntityPlayer player = (EntityPlayer) sender;
            MovingObjectPosition pos = BlockUtils.getTargetBlock(player.worldObj, player, true);
            if (player.worldObj.getTileEntity(pos.blockX, pos.blockY, pos.blockZ) instanceof TileInfusedGrain) {
                TileInfusedGrain tile = (TileInfusedGrain) player.worldObj.getTileEntity(pos.blockX, pos.blockY, pos.blockZ);
                for (Aspect a : Aspect.getPrimalAspects()) {
                    if (args[0].toUpperCase().equals(a.getName().toUpperCase())) {
View Full Code Here

Examples of net.minecraft.entity.player.EntityPlayer

  @Override
  public void setRotationAngles(float v1, float v2, float v3, float v4, float v5, float v6, Entity entity) {
    EntityLivingBase living = (EntityLivingBase) entity;
    isSneak = living != null && living.isSneaking();
    if (living != null && living instanceof EntityPlayer) {
      EntityPlayer player = (EntityPlayer) living;

      ItemStack itemstack = player.inventory.getCurrentItem();
      heldItemRight = itemstack != null ? 1 : 0;

      if (itemstack != null && player.getItemInUseCount() > 0) {
        EnumAction enumaction = itemstack.getItemUseAction();

        if (enumaction == EnumAction.block)
          heldItemRight = 3;
        else if (enumaction == EnumAction.bow)
View Full Code Here

Examples of net.minecraft.entity.player.EntityPlayer

    public static HashMap<Entity, Long> firePotionHit = new HashMap<Entity, Long>();

    @SubscribeEvent
    public void onLivingHurt(LivingAttackEvent e) {
        if (e.source.getSourceOfDamage() instanceof EntityPlayer) {
            EntityPlayer p = (EntityPlayer) e.source.getSourceOfDamage();
            if (p.isPotionActive(ModPotions.potionAir) && !p.worldObj.isRemote) {
                airPotionHit.put(e.entity, e.entity.worldObj.getTotalWorldTime());
            }
            if (p.isPotionActive(ModPotions.potionFire) && !p.worldObj.isRemote) {
                firePotionHit.put(e.entity, e.entity.worldObj.getTotalWorldTime());
            }
            if (p.isPotionActive(ModPotions.potionEarth) && !p.worldObj.isRemote) {
                boolean xAxis = Math.abs(e.entity.posZ - p.posZ) < Math.abs(e.entity.posX - p.posX);
                int centerX = (int) ((e.entity.posX + p.posX) / 2);

                int centerY = (int) (p.posY + 2);
                int centerZ = (int) ((e.entity.posZ + p.posZ) / 2);
View Full Code Here

Examples of net.minecraft.entity.player.EntityPlayer

      if (heldItem == null)
        return;

     
      if (attacker instanceof EntityPlayer) {
        EntityPlayer player = (EntityPlayer) attacker;

        ItemStack legs = player.getCurrentArmor(1);
        int pounce = EnchantmentHelper.getEnchantmentLevel(LibEnchantIDs.pounce, legs);
        if (pounce > 0) {
          if (player.worldObj.getBlock((int) Math.floor(player.posX), (int) Math.floor(player.posY) - 1, (int) Math.floor(player.posZ)) == net.minecraft.init.Blocks.air) {

            event.ammount *= 1 + (.25 * pounce);
 
View Full Code Here

Examples of net.minecraft.entity.player.EntityPlayer

  @SubscribeEvent(priority = EventPriority.HIGHEST)
  public void onEntityUpdate(LivingUpdateEvent event) {
    final double min = -0.0784000015258789;

    if (event.entityLiving instanceof EntityPlayer) {
      EntityPlayer player = (EntityPlayer) event.entityLiving;
      int slowfall = EnchantmentHelper.getMaxEnchantmentLevel(LibEnchantIDs.idSlowFall, player.inventory.armorInventory);
      if (slowfall > 0 && !event.entityLiving.isSneaking() && event.entityLiving.motionY < min && event.entityLiving.fallDistance >= 2.9) {
        event.entityLiving.motionY /= 1 + slowfall * 0.33F;
        event.entityLiving.fallDistance = Math.max(2.9F, player.fallDistance - slowfall / 3F);

        player.worldObj.spawnParticle("cloud", player.posX + 0.25, player.posY - 1, player.posZ + 0.25, -player.motionX, player.motionY, -player.motionZ);
      }

      ItemStack heldItem = player.getHeldItem();

      if (heldItem == null)
        return;

      int quickDraw = EnchantmentHelper.getEnchantmentLevel(LibEnchantIDs.idQuickDraw, heldItem);
View Full Code Here

Examples of net.minecraft.entity.player.EntityPlayer

  }

  @SubscribeEvent
  public void onPlayerJump(LivingJumpEvent event) {
    if (event.entityLiving instanceof EntityPlayer) {
      EntityPlayer player = (EntityPlayer) event.entityLiving;
      int boost = EnchantmentHelper.getMaxEnchantmentLevel(LibEnchantIDs.idAscentBoost, player.inventory.armorInventory);

      if (boost >= 1 && !player.isSneaking())
        player.motionY *= (boost + 2) / 2D;
    }
  }
View Full Code Here

Examples of net.minecraft.entity.player.EntityPlayer

  private static final int MAX_HP = 20;

  @SubscribeEvent
  public void onPlayerDamage(LivingHurtEvent event) {
    if (event.entityLiving instanceof EntityPlayer && event.ammount > 0) {
      EntityPlayer player = (EntityPlayer) event.entityLiving;
      event.ammount = removeHP(player, (int) event.ammount);
      updateClient(player);
    }
  }
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.