Skip to content

Commit

Permalink
fix capacity
Browse files Browse the repository at this point in the history
  • Loading branch information
GDCloudstrike committed Nov 12, 2024
1 parent afacb0a commit a3d4668
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, L
EnumChatFormatting.BLUE + (f != null ? f.getLocalizedName()
: StatCollector.translateToLocal("item.itemGregtechPump.tooltip.3")));
aList.add(
EnumChatFormatting.BLUE + (f != null ? "" + f.amount : "" + 0)
EnumChatFormatting.BLUE + (f != null ? "" + formatNumbers(f.amount) : "" + 0)
+ "L"
+ " / "
+ formatNumbers(getCapacity(aStack))
Expand Down Expand Up @@ -706,7 +706,7 @@ public int getCapacity(ItemStack container) {
}
int aMeta = this.getCorrectMetaForItemstack(container);

return aMeta == 4 ? 16_384_000 : 2000 * (int) Math.pow(4, aMeta);
return 2000 * (int) Math.pow(4, aMeta);
}

public int fill(ItemStack container, FluidStack resource) {
Expand Down Expand Up @@ -841,8 +841,11 @@ public void initNBT(ItemStack aStack) {
aNewNBT.setBoolean("mInit", true);
aNewNBT.setString("mFluid", "@@@@@");
aNewNBT.setInteger("mFluidAmount", 0);
int aCapacity = aMeta == 4 ? 16_384_000 : 2000 * (int) Math.pow(4, aMeta);
aNewNBT.setInteger("mCapacity", aCapacity);
if (!aNewNBT.hasKey("capacityInit")) {
int aCapacity = 2000 * (int) Math.pow(4, aMeta);
aNewNBT.setInteger("mCapacity", aCapacity);
aNewNBT.setBoolean("capacityInit", true);
}
aStack.setTagCompound(aNewNBT);
}
}
Expand Down

0 comments on commit a3d4668

Please sign in to comment.