Fix overflow with XP container machines (#64)

This commit is contained in:
miozune authored and GitHub committed 2022-04-20 11:49:19 +02:00
1 parent 88d7baef0a
commit edc8786d79
1 file changed
+2 -1
@@ -29,7 +29,8 @@ public class ExperienceContainer extends FluidTank {
public ExperienceContainer(int maxStored) {
super(null, 0);
maxXp = maxStored;
// enforce overflow-safe value
maxXp = Math.min(maxStored, XpUtil.liquidToExperience(Integer.MAX_VALUE));
}
public int getMaximumExperiance() {