diff --git a/src/main/java/com/buuz135/industrialforegoingsouls/block/tile/SoulLaserBaseBlockEntity.java b/src/main/java/com/buuz135/industrialforegoingsouls/block/tile/SoulLaserBaseBlockEntity.java index 354e7c4..2c57398 100644 --- a/src/main/java/com/buuz135/industrialforegoingsouls/block/tile/SoulLaserBaseBlockEntity.java +++ b/src/main/java/com/buuz135/industrialforegoingsouls/block/tile/SoulLaserBaseBlockEntity.java @@ -57,7 +57,7 @@ public SoulLaserBaseBlockEntity(BlockPos blockPos, BlockState blockState) { super(IndustrialForegoingSouls.SOUL_LASER_BLOCK, blockPos, blockState); this.soulAmount = 0; setShowEnergy(false); - this.addProgressBar(work = new ProgressBarComponent(74, 24 + 18, 0, ConfigSoulLaserBase.MAX_PROGRESS) { + this.addProgressBar(this.work = new ProgressBarComponent(74, 24 + 18, 0, ConfigSoulLaserBase.MAX_PROGRESS) { @Override @OnlyIn(Dist.CLIENT) public List> getScreenAddons() { @@ -76,8 +76,7 @@ public List getTooltipLines() { .setProgressIncrease(0) .setCanReset(oreLaserBaseTile -> true) .setOnStart(() -> { - int maxProgress = (int) Math.floor(ConfigSoulLaserBase.MAX_PROGRESS * (this.hasAugmentInstalled(AugmentTypes.EFFICIENCY) ? AugmentWrapper.getType(this.getInstalledAugments(AugmentTypes.EFFICIENCY).get(0), AugmentTypes.EFFICIENCY) : 1)); - work.setMaxProgress(maxProgress); + }) .setOnFinishWork(this::onWork) ); @@ -116,6 +115,8 @@ private void onWork() { } } } + int maxProgress = (int) Math.floor(ConfigSoulLaserBase.MAX_PROGRESS * (this.hasAugmentInstalled(AugmentTypes.EFFICIENCY) ? AugmentWrapper.getType(this.getInstalledAugments(AugmentTypes.EFFICIENCY).get(0), AugmentTypes.EFFICIENCY) : 1)); + this.work.setMaxProgress(maxProgress); } @Override