aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PlayerStats.java
diff options
context:
space:
mode:
authorRoman / Linnea Gräf <roman.graef@gmail.com>2022-12-09 13:19:54 +0100
committerGitHub <noreply@github.com>2022-12-09 23:19:54 +1100
commit337b77aa50db6b4a159795827623d36acccbdcc4 (patch)
tree07b107d9925de565e78bf02a1526881bd05b1519 /src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PlayerStats.java
parentac74ab8c13cf486cf36cb911f0a723908b0c5072 (diff)
downloadnotenoughupdates-337b77aa50db6b4a159795827623d36acccbdcc4.tar.gz
notenoughupdates-337b77aa50db6b4a159795827623d36acccbdcc4.tar.bz2
notenoughupdates-337b77aa50db6b4a159795827623d36acccbdcc4.zip
Katting (#447)
Co-authored-by: nea <romangraef@gmail.com> Co-authored-by: nea <roman.graef@gmail.com> Co-authored-by: nea <nea@nea.moe> Co-authored-by: nea <romangraef@loves.dicksinhisan.us> Co-authored-by: nea <roman.graef@grb-online.net> Co-authored-by: nea <hello@nea89.moe> Co-authored-by: nea <roman.graef@stud.tu-darmstadt.de>
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PlayerStats.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PlayerStats.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PlayerStats.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PlayerStats.java
index c5a17aef..56ecd3a2 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PlayerStats.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PlayerStats.java
@@ -24,9 +24,11 @@ import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
+import io.github.moulberry.notenoughupdates.miscfeatures.PetInfoOverlay;
import io.github.moulberry.notenoughupdates.profileviewer.info.QuiverInfo;
import io.github.moulberry.notenoughupdates.util.Constants;
import io.github.moulberry.notenoughupdates.util.JsonUtils;
+import io.github.moulberry.notenoughupdates.util.PetLeveling;
import io.github.moulberry.notenoughupdates.util.Utils;
import net.minecraft.nbt.CompressedStreamTools;
import net.minecraft.nbt.JsonToNBT;
@@ -491,11 +493,13 @@ public class PlayerStats {
tierNum = "" + (Integer.parseInt(tierNum) + 1);
}
- GuiProfileViewer.PetLevel levelObj = GuiProfileViewer.getPetLevel(petname, tier, exp);
- if (levelObj == null) return null;
- float level = levelObj.level;
- float currentLevelRequirement = levelObj.currentLevelRequirement;
- float maxXP = levelObj.maxXP;
+ PetLeveling.PetLevel levelObj = PetLeveling.getPetLevelingForPet(
+ petname,
+ PetInfoOverlay.Rarity.valueOf(tier)
+ ).getPetLevel(exp);
+ float level = levelObj.getCurrentLevel();
+ float currentLevelRequirement = levelObj.getExpRequiredForNextLevel();
+ float maxXP = levelObj.getMaxLevel();
pet.addProperty("level", level);
pet.addProperty("currentLevelRequirement", currentLevelRequirement);
pet.addProperty("maxXP", maxXP);