Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
fixed power unit not displaying power correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Oct 25, 2023
1 parent fa83b56 commit 0bc52ee
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public void appendHoverText(ItemStack stack, @Nullable Level worldIn, List<Compo
public int getBarWidth(@NotNull ItemStack stack) {
long currentEnergy = getCurrentEnergy(stack);
if (currentEnergy > 0) {
double maxAmount = getMaxEnergy(stack), difference = maxAmount - currentEnergy;
return (int)( 13*(difference / maxAmount));
double maxAmount = getMaxEnergy(stack);
return (int)(13.0f* (currentEnergy / (double) maxAmount));
}
return super.getBarWidth(stack);
}
Expand Down

0 comments on commit 0bc52ee

Please sign in to comment.