try to fix an issue where active abilities can be kept after resetting skilltree
This commit is contained in:
+2
-2
@@ -48,7 +48,7 @@ mod_name=Fretux's Skill Engine
|
||||
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||
mod_license=All Rights Reserved
|
||||
# The mod version. See https://semver.org/
|
||||
mod_version=1.3.0
|
||||
mod_version=1.3.1
|
||||
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
||||
# This should match the base package used for the mod sources.
|
||||
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
@@ -56,4 +56,4 @@ mod_group_id=net.fretux.skillengine
|
||||
# The authors of the mod. This is a simple text string that is used for display purposes in the mod list.
|
||||
mod_authors=Fretux
|
||||
# The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list.
|
||||
mod_description=A framework for the Ascend Skilltree
|
||||
mod_description=A framework for the Ascend Skilltree
|
||||
|
||||
@@ -109,6 +109,13 @@ public class PlayerSkillData {
|
||||
return abilitySlots.clone();
|
||||
}
|
||||
|
||||
public void clearAbilitySlots() {
|
||||
for (int i = 0; i < abilitySlots.length; i++) {
|
||||
abilitySlots[i] = null;
|
||||
abilityCooldowns[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void setCooldown(int slot, int ticks) {
|
||||
int idx = slot - 1;
|
||||
if (idx < 0 || idx >= abilityCooldowns.length) return;
|
||||
@@ -215,9 +222,10 @@ public class PlayerSkillData {
|
||||
unlockedNodes.clear();
|
||||
activeTags.clear();
|
||||
unlockedAbilities.clear();
|
||||
clearAbilitySlots();
|
||||
}
|
||||
|
||||
public void sync(ServerPlayer player) {
|
||||
PacketHandler.syncSkillsTo(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user