Implement translations, datagen, added moonseyetome and other changes

This commit is contained in:
2025-11-11 11:56:51 +01:00
parent 7be17457a3
commit 20ca8c3e43
10 changed files with 174 additions and 9 deletions
@@ -32,6 +32,7 @@ public class PlayerStats {
ascendXP -= xpNeeded;
ascendLevel++;
unspentPoints += POINTS_PER_LEVEL;
knowledge += 1;
}
if (ascendLevel >= MAX_ASCEND_LEVEL) {
int xpNeeded = getXPToNextAscendLevel();
@@ -97,11 +98,33 @@ public class PlayerStats {
return base + intelligence * perPoint;
}
private int knowledge = 0;
private boolean hasUsedMoonseye = false; // Moonseye Tome First Use
public int getKnowledge() {
return knowledge;
}
public void addKnowledge(int amount) {
knowledge = Math.max(0, knowledge + amount);
}
public boolean hasUsedMoonseye() {
return hasUsedMoonseye;
}
public void setHasUsedMoonseye(boolean used) {
this.hasUsedMoonseye = used;
}
public CompoundTag serializeNBT() {
CompoundTag tag = new CompoundTag();
tag.putInt("AscendLevel", ascendLevel);
tag.putInt("AscendXP", ascendXP);
tag.putInt("UnspentPoints", unspentPoints);
tag.putInt("Knowledge", knowledge);
tag.putBoolean("HasUsedMoonseye", hasUsedMoonseye);
CompoundTag attrTag = new CompoundTag();
for (Map.Entry<String, Integer> entry : attributes.entrySet()) {
attrTag.putInt(entry.getKey(), entry.getValue());
@@ -125,5 +148,11 @@ public class PlayerStats {
attributes.put(key, Math.max(0, Math.min(loaded, MAX_ATTRIBUTE_POINTS)));
}
}
if (tag.contains("Knowledge")) {
knowledge = tag.getInt("Knowledge");
}
if (tag.contains("HasUsedMoonseye")) {
hasUsedMoonseye = tag.getBoolean("HasUsedMoonseye");
}
}
}