@Override
 protected void writeSyncTag(NBTTagCompound NBT) {
   super.writeSyncTag(NBT);
   NBT.setIntArray("CookTime", extractorCookTime);
   NBT.setInteger("drill", drillTime);
   NBT.setBoolean("bedrock", bedrock);
 }
  @Override
  public void updateEntity(World world, int x, int y, int z, int meta) {
    super.updateTileEntity();
    this.getPowerBelow();
    if (DragonAPICore.debugtest) tank.addLiquid(1000, FluidRegistry.WATER);
    this.testIdle();
    this.throughPut();
    if (world.isRemote) return;
    if (!bedrock) {
      if (ConfigRegistry.EXTRACTORMAINTAIN.getState()) {
        if (drillTime <= 0
            && inv[9] != null
            && ReikaItemHelper.matchStacks(inv[9], ItemStacks.drill)) {
          ReikaInventoryHelper.decrStack(9, inv);
          drillTime = DRILL_LIFE;
        }
      } else {
        drillTime = DRILL_LIFE;
        inv[9] = null;
      }
    }
    boolean[] tickPer = new boolean[4];
    for (int i = 0; i < 4; i++) {
      boolean flag1 = false;

      int n = this.getNumberConsecutiveOperations(i);
      for (int k = 0; k < n; k++) flag1 |= this.doOperation(n > 1, i, tickPer);

      if (flag1) this.markDirty();
    }
    if (ReikaArrayHelper.isAllTrue(tickPer))
      RotaryAchievements.INSANITY.triggerAchievement(this.getPlacer());
  }
  @Override
  public void updateEntity(World world, int x, int y, int z, int meta) {
    super.updateTileEntity();
    this.getIOSidesDefault(world, x, y, z, meta);
    this.getPower(false);

    // ReikaJavaLibrary.pConsole((omega-MINSPEED)+":"+dur);
    timer.setCap(this.getOperationTime());

    tempTimer.update();
    if (tempTimer.checkCap()) this.updateTemperature(world, x, y, z, meta);

    if (!worldObj.isRemote) {
      int n = this.getNumberConsecutiveOperations();
      for (int i = 0; i < n; i++) this.doOperation(n > 1);

      freezeTick = timer.getTick();
    }

    sound.update();
    if (omega > 0) {
      if (sound.checkCap())
        SoundRegistry.FAN.playSoundAtBlock(
            world, x, y, z, RotaryAux.isMuffled(this) ? 0.1F : 0.4F, 0.6F);
    }
  }
  @Override
  public void updateEntity(World world, int x, int y, int z, int meta) {
    super.updateTileEntity();
    this.getPowerBelow();
    this.updateItem();

    if (power >= MINPOWER && omega >= MINSPEED) {
      ItemStack is = inv[0];
      if (is != null) {
        FluidStack fs = tank.getFluid();
        if (fs != null) {
          WettingRecipe wr = RecipesWetter.getRecipes().getRecipe(is, fs);
          if (wr != null) {
            if (tick >= wr.duration) {
              tank.removeLiquid(wr.getFluid().amount);
              inv[0] = wr.getOutput();
              tick = 0;
              this.onItemSet(0, inv[0]);
            } else {
              tick += 1 + 4 * ReikaMathLibrary.logbase2(omega / MINSPEED);
            }
          } else {
            tick = 0;
          }
        } else {
          tick = 0;
        }
      } else {
        tick = 0;
      }
    } else {
      tick = 0;
    }
  }
  @Override
  protected void readSyncTag(NBTTagCompound NBT) {
    super.readSyncTag(NBT);

    extractorCookTime = NBT.getIntArray("CookTime");
    drillTime = NBT.getInteger("drill");
    bedrock = NBT.getBoolean("bedrock");
  }
  @Override
  protected void writeSyncTag(NBTTagCompound NBT) {
    super.writeSyncTag(NBT);

    NBT.setInteger("temp", temperature);
  }
  @Override
  protected void readSyncTag(NBTTagCompound NBT) {
    super.readSyncTag(NBT);

    temperature = NBT.getInteger("temp");
  }