예제 #1
0
  public void update() {
    stat.update();
    if (ticksExisted >= 30 && !didMakeLockSound) {
      didMakeLockSound = true;
      EntityPlayer player = FMLClientHandler.instance().getClient().thePlayer;
      player.worldObj.playSound(
          player.posX, player.posY, player.posZ, Sounds.HUD_ENTITY_LOCK, 0.1F, 1.0F, true);
    }
    circle1.update();
    circle2.update();
    for (IEntityTrackEntry tracker : trackEntries) {
      tracker.update(entity);
    }
    isLookingAtTarget = isPlayerLookingAtTarget();

    if (hackTime > 0) {
      IHackableEntity hackableEntity =
          HackableHandler.getHackableForEntity(entity, PneumaticCraft.proxy.getPlayer());
      if (hackableEntity != null) {
        hackTime++; // = Math.min(hackTime + 1, hackableEntity.getHackTime(entity,
        // PneumaticCraft.proxy.getPlayer()));
      } else {
        hackTime = 0;
      }
    }
  }
예제 #2
0
 public void hack() {
   if (isInitialized() && isPlayerLookingAtTarget()) {
     IHackableEntity hackable =
         HackableHandler.getHackableForEntity(entity, PneumaticCraft.proxy.getPlayer());
     if (hackable != null
         && (hackTime == 0
             || hackTime > hackable.getHackTime(entity, PneumaticCraft.proxy.getPlayer())))
       NetworkHandler.sendToServer(new PacketHackingEntityStart(entity));
   }
 }