@Override public void updateEntity(World world, int x, int y, int z, int meta) { if (!PowerTransferHelper.checkPowerFrom(this, ForgeDirection.DOWN) && !PowerTransferHelper.checkPowerFrom(this, ForgeDirection.UP)) { this.noInputMachine(); } if (power >= MINPOWER && torque >= MINTORQUE) { timer.setCap(Math.max(1, 20 - 2 * (int) ReikaMathLibrary.logbase(omega, 2))); timer.update(); Extraction e = this.getExtraction(world, x, y, z); if (e != null) { if (timer.checkCap() && e.canPerform(world, x, y, z)) { this.harvest(e, world, x, y, z); } } else { timer.reset(); } } }
private void harvest(Extraction e, World world, int x, int y, int z) { if (e instanceof HeavyWaterExtraction) ReactorAchievements.HEAVYWATER.triggerAchievement(this.getPlacer()); tank.fill(new FluidStack(e.output, e.getExtractedAmount(world, x, y, z)), true); }