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

    if (worldObj.isRemote) {
      return;
    }

    if ((currentBuilder == null || currentBuilder.isDone(this)) && box.isInitialized()) {
      box.reset();

      sendNetworkUpdate();

      return;
    }

    iterateBpt(false);

    if (mode != Mode.Off) {
      if (getWorldObj().getWorldInfo().getGameType() == GameType.CREATIVE) {
        build();
      } else if (getBattery().getEnergyStored() > POWER_ACTIVATION) {
        build();
      }
    }

    if (!isBuilding && this.isBuildingBlueprint()) {
      updateRequirements();
    }
    isBuilding = this.isBuildingBlueprint();

    if (done) {
      return;
    } else if (getBattery().getEnergyStored() < 25) {
      return;
    }
  }