diff options
author | Maximusbarcz <maxim.baranek@gmail.com> | 2023-01-16 19:23:35 +0100 |
---|---|---|
committer | Maximusbarcz <maxim.baranek@gmail.com> | 2023-01-16 19:23:35 +0100 |
commit | c940f1261b74e83c135703fa0c35d3f8e5605761 (patch) | |
tree | 6b2fd4e91488da45a76807dc86d097f8fa3f9d8f /src/main/java/dev/mayaqq/ygasi/gui/ResetGui.java | |
parent | dfad85d18a2a7fa55cd8adf85216e92519aa47ba (diff) | |
download | ygasi-c940f1261b74e83c135703fa0c35d3f8e5605761.tar.gz ygasi-c940f1261b74e83c135703fa0c35d3f8e5605761.tar.bz2 ygasi-c940f1261b74e83c135703fa0c35d3f8e5605761.zip |
Some small changes now, mainly a config button in the main branch gui for moderators
Diffstat (limited to 'src/main/java/dev/mayaqq/ygasi/gui/ResetGui.java')
-rw-r--r-- | src/main/java/dev/mayaqq/ygasi/gui/ResetGui.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/dev/mayaqq/ygasi/gui/ResetGui.java b/src/main/java/dev/mayaqq/ygasi/gui/ResetGui.java index c74280f..2f79874 100644 --- a/src/main/java/dev/mayaqq/ygasi/gui/ResetGui.java +++ b/src/main/java/dev/mayaqq/ygasi/gui/ResetGui.java @@ -63,6 +63,7 @@ public class ResetGui { public static void reset(ServerPlayerEntity player) { //check if player experience level is greater than 10 //revoke the abilities first + AdvUtils.revokeAllAdvancements(player, "minecraft", "ygasi/root"); if (AdvUtils.getAdvancementProgress(player, "minecraft", "ygasi/mercenary")) { AdvUtils.revokeAllAdvancements(player, "minecraft", "ygasi/mercenary"); String[] subBranches = {"mercenary.Offence", "mercenary.Ninja", "mercenary.Defence"}; @@ -75,9 +76,8 @@ public class ResetGui { private static void resetBranch (String[] subBranches, ServerPlayerEntity player) { for (String subBranch : subBranches) { for (int i = 1; i < 4; i++) { - String branch = subBranch + i; try { - Class<?> branchClass = Class.forName("dev.mayaqq.ygasi.abilities." + branch); + Class<?> branchClass = Class.forName("dev.mayaqq.ygasi.abilities." + subBranch + i); branchClass.getMethod("revoke", ServerPlayerEntity.class).invoke(null, player); } catch (Exception e) { |