Пример #1
0
  @Override
  public void updateTask() {
    // 目で殺す
    littleMaid
        .getLookHelper()
        .setLookPositionWithEntity(targetPlayer, 10F, littleMaid.getVerticalFaceSpeed());
    if (littleMaid.getNavigator().noPath()) {
      littleMaid.setLooksWithInterest(true);
    } else {
      littleMaid.setLooksWithInterest(false);
    }

    //		field_48347_e--;
  }
Пример #2
0
  private boolean checkItem(EntityPlayer par1EntityPlayer) {
    ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem();

    if (itemstack == null) {
      return false;
    }
    return littleMaid.isBreedingItem(itemstack);
  }
Пример #3
0
  @Override
  public boolean continueExecuting() {
    // if (!targetPlayer.isEntityAlive()) {
    if (targetPlayer == null || !targetPlayer.isEntityAlive()) {
      return false;
    }

    if (littleMaid.isContract()) {
      targetRangeSq = littleMaid.mstatMasterDistanceSq;
    } else {
      targetRangeSq = littleMaid.getDistanceSqToEntity(targetPlayer);
    }

    if (targetRangeSq > effectiveRangeSq) {
      return false;
    } else {
      return field_48347_e > 0 && checkItem(targetPlayer);
    }
  }
Пример #4
0
  @Override
  public boolean shouldExecute() {
    if (littleMaid.isContract()) {
      targetPlayer =
          littleMaid.mstatMasterDistanceSq > effectiveRangeSq ? null : littleMaid.mstatMasterEntity;
    } else {
      targetPlayer = worldObj.getClosestPlayerToEntity(littleMaid, effectiveRange);
    }

    if (targetPlayer == null) {
      return false;
    } else {
      return checkItem(targetPlayer);
    }
  }
  /** 数値の更新用、onUpdate内で呼ぶ事 */
  public void onUpdate(LMM_EntityLittleMaid pEntity) {
    prevSwingProgress = swingProgress;
    if (attackTime > 0) {
      attackTime--;
    }

    // 腕振り
    int li = pEntity.getSwingSpeedModifier();
    if (isSwingInProgress) {
      swingProgressInt++;
      if (swingProgressInt >= li) {
        swingProgressInt = 0;
        isSwingInProgress = false;
      }
    } else {
      swingProgressInt = 0;
    }
    swingProgress = (float) swingProgressInt / (float) li;

    if (isUsingItem()) {
      ItemStack itemstack;
      try {
        itemstack = pEntity.maidInventory.getStackInSlot(index);
      } catch (Exception e) {
        return;
      }
      Entity lrentity = pEntity.worldObj.isRemote ? null : pEntity;

      if (itemstack != itemInUse) {
        clearItemInUse(lrentity);
      } else {
        if (itemInUseCount <= 25 && itemInUseCount % 4 == 0) {
          // 食べかすとか
          updateItemUse(pEntity, 5);
        }
        if (--itemInUseCount <= 0 && lrentity != null) {
          onItemUseFinish(pEntity.maidAvatar);
        }
      }
    }
  }
Пример #6
0
 @Override
 public void resetTask() {
   littleMaid.setLooksWithInterest(false);
   // littleMaid.numTicksToChaseTarget = 0;
   littleMaid.setLookSuger(false);
 }
Пример #7
0
 @Override
 public void startExecuting() {
   // littleMaid.setLooksWithInterest(true);
   field_48347_e = 40 + littleMaid.getRNG().nextInt(40);
   littleMaid.setLookSuger(true);
 }