Examples of FakePlayer


Examples of lineage2.gameserver.model.FakePlayer

   * Method onEvtThink.
   */
  @Override
  protected final void onEvtThink()
  {
    FakePlayer actor = getActor();
    if (actor.isActionsDisabled())
    {
      return;
    }
    try
    {
View Full Code Here

Examples of lineage2.gameserver.model.FakePlayer

  /**
   * Method thinkFollow.
   */
  protected void thinkFollow()
  {
    FakePlayer actor = getActor();
    Creature target = (Creature) _intention_arg0;
    Integer offset = (Integer) _intention_arg1;
    if ((target == null) || target.isAlikeDead() || (actor.getDistance(target) > 4000.0D) || (offset == null))
    {
      clientActionFailed();
      return;
    }
    if (actor.isFollow && (actor.getFollowTarget() == target))
    {
      clientActionFailed();
      return;
    }
    if (actor.isInRange(target, offset.intValue() + 20) || actor.isMovementDisabled())
    {
      clientActionFailed();
    }
    if (_followTask != null)
    {
View Full Code Here

Examples of lineage2.gameserver.model.FakePlayer

   * Method thinkAttack.
   * @param checkRange boolean
   */
  protected void thinkAttack(boolean checkRange)
  {
    FakePlayer actor = getActor();
    Player player = actor.getPlayer();
    if (player == null)
    {
      setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
      return;
    }
    if (actor.isActionsDisabled() || actor.isAttackingDisabled())
    {
      return;
    }
    Creature attack_target = getAttackTarget();
    if ((attack_target == null) || (attack_target.isDead()))
    {
      setIntention(CtrlIntention.AI_INTENTION_FOLLOW);
      return;
    }
    if (!checkRange)
    {
      clientStopMoving();
      actor.doAttack(attack_target);
      return;
    }
    int range = actor.getPhysicalAttackRange();
    if (range < 10)
    {
      range = 10;
    }
    boolean canSee = GeoEngine.canSeeTarget(actor, attack_target, false);
    if ((!canSee && (range > 200)) || (Math.abs(actor.getZ() - attack_target.getZ()) > 200))
    {
      setIntention(CtrlIntention.AI_INTENTION_FOLLOW);
      return;
    }
    range = (int) (range + actor.getMinDistance(attack_target));
    if (actor.isFakeDeath())
    {
      actor.breakFakeDeath();
    }
    if (actor.isInRangeZ(attack_target, range))
    {
      if (!canSee)
      {
        setIntention(CtrlIntention.AI_INTENTION_FOLLOW);
        return;
      }
      clientStopMoving(false);
      actor.doAttack(attack_target);
    }
  }
View Full Code Here

Examples of lineage2.gameserver.model.FakePlayer

     * Method runImpl.
     */
    @Override
    public void runImpl()
    {
      FakePlayer actor = getActor();
      if (getIntention() != CtrlIntention.AI_INTENTION_FOLLOW)
      {
        return;
      }
      Creature target = (Creature) _intention_arg0;
      int offset = (_intention_arg1 instanceof Integer) ? ((Integer) _intention_arg1).intValue() : 0;
      if ((target == null) || target.isAlikeDead() || (actor.getDistance(target) > 4000.0D))
      {
        setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
        return;
      }
      Player player = actor.getPlayer();
      if ((player == null) || player.isLogoutStarted())
      {
        setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
        return;
      }
      if (!actor.isInRange(target, offset + 20) && (!actor.isFollow || (actor.getFollowTarget() != target)))
      {
        actor.followToCharacter(target, offset, false);
      }
      _followTask = ThreadPoolManager.getInstance().schedule(this, 250L);
    }
View Full Code Here

Examples of logisticspipes.blocks.crafting.FakePlayer

    */
    return false;
  }

  public static EntityPlayer getFakePlayer(TileEntity tile) {
    return new FakePlayer(tile);
  }
View Full Code Here

Examples of net.minecraftforge.common.FakePlayer

  public static boolean isFakePlayer(EntityPlayer player) {
    return player.username.equals( "[XACT]" );
  }

  private EntityPlayer createFakePlayer(World world) {
    return new FakePlayer( world, "[XACT]" );
  }
View Full Code Here

Examples of net.minecraftforge.common.util.FakePlayer

                    //if (this.worldObj.setBlock(x, y, z, ((ItemBlock) this.inventorySlots[0].getItem()).field_150939_a, this.inventorySlots[0].getItemDamage(), 1 | 2)) {
                      //  this.decrStackSize(0, 1);
                       // markDirty();
                    //Block block = worldObj.getBlock(x, y, z);
                    boolean done=false;
                    FakePlayer player=FakePlayerFactory.getMinecraft((WorldServer)worldObj);
                    Item item=inventorySlots[0].getItem();
                    ItemStack stack=inventorySlots[0];
                    if (!done)
                        item.onItemUseFirst(stack, player, worldObj, x, y, z, ForgeDirection.OPPOSITES[orientation], 0F, 0F, 0F);
                    if (!done)
View Full Code Here

Examples of net.minecraftforge.common.util.FakePlayer

    List<EntityLivingBase> entsInBounds = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, getKillBounds());
    if(!entsInBounds.isEmpty()) {

      for (EntityLivingBase ent : entsInBounds) {
        if(!ent.isDead) {
          FakePlayer fakee = getAttackera();
          fakee.setCurrentItemOrArmor(0, getStackInSlot(0));
          fakee.attackTargetEntityWithCurrentItem(ent);
          useNutrient();
          swingWeapon();
          if(getStackInSlot(0).stackSize <= 0) {
            setInventorySlotContents(0, null);
          }
View Full Code Here

Examples of net.minecraftforge.common.util.FakePlayer

        isFavourite = name.equalsIgnoreCase(player);
        isRemote = remote;

        if(!player.equalsIgnoreCase(""))
        {
            entInstance = isRemote ? createPlayer(world, player) : new FakePlayer((WorldServer)world, EntityHelperBase.getSimpleGameProfileFromName(player));
        }
        else if(tag != null)
        {
            entInstance = (EntityLivingBase)EntityList.createEntityFromNBT(tag, world);
        }
View Full Code Here

Examples of net.minecraftforge.common.util.FakePlayer

        if(!invalid)
        {
            if(!playerMorph.equalsIgnoreCase(""))
            {
                entInstance = isRemote ? createPlayer(world, playerMorph) : new FakePlayer((WorldServer)world, EntityHelperBase.getSimpleGameProfileFromName(playerMorph));
                identifier = "playerMorphState::player_" + playerMorph;
            }
            else
            {
                try
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.