Exemplo n.º 1
0
  @Override
  public void updateEntity() {

    super.updateEntity();

    if ((bluePrintBuilder == null || bluePrintBuilder.done)
        && box.isInitialized()
        && (builderRobot == null || builderRobot.done())) {

      box.deleteLasers();
      box.reset();

      if (CoreProxy.proxy.isSimulating(worldObj)) {
        sendNetworkUpdate();
      }

      return;
    }

    if (!box.isInitialized() && bluePrintBuilder == null && builderRobot != null) {
      builderRobot.setDead();
      builderRobot = null;
    }
  }
Exemplo n.º 2
0
  @Override
  public void updateEntity() {
    super.updateEntity();

    if (inProcess && arm != null) {

      arm.setArmSpeed(0);
      float energyToUse = 2 + powerProvider.getEnergyStored() / 1000;

      boolean enoughStep =
          (0.015 + energyToUse / 200F)
              > (1F
                  / 32F); // (otherwise the movement is rounded to 0 and the energy absorbed with no
                          // movement)
      if (enoughStep) {
        float energy = powerProvider.useEnergy(energyToUse, energyToUse, true);

        if (energy > 0) {
          arm.doMove(0.015 + energy / 200F);
        }
      }
    }

    if (arm != null) {
      double[] head = arm.getHead();
      headPosX = head[0];
      headPosY = head[1];
      headPosZ = head[2];

      speed = arm.getArmSpeed();
    }

    if (ProxyCore.proxy.isSimulating(worldObj)) {
      sendNetworkUpdate();
    }
    if (inProcess || !isDigging) {
      return;
    }

    createUtilsIfNeeded();

    if (bluePrintBuilder != null) {

      builderDone = bluePrintBuilder.done;
      if (!builderDone) {

        buildFrame();
        return;

      } else {

        if (builder != null && builder.done()) {

          box.deleteLasers();
          builder.setDead();
          builder = null;
        }
      }
    }

    if (builder == null) {
      dig();
    }
  }