diff options
author | bowser0000 <bowser0000@gmail.com> | 2020-10-02 09:24:12 -0400 |
---|---|---|
committer | bowser0000 <bowser0000@gmail.com> | 2020-10-02 09:24:12 -0400 |
commit | d620d60c40db7ec2c7c59c01a5b02cb431552944 (patch) | |
tree | 7b5d711ec690d6a3860e8d13fd2b1afcfcfb5c7d /src/main/java/me/Danker/commands | |
parent | 4a4aa1e0d511feb544401d9b41607f693887b55b (diff) | |
download | SkyblockMod-d620d60c40db7ec2c7c59c01a5b02cb431552944.tar.gz SkyblockMod-d620d60c40db7ec2c7c59c01a5b02cb431552944.tar.bz2 SkyblockMod-d620d60c40db7ec2c7c59c01a5b02cb431552944.zip |
Fix /skills for people missing taming achievement
Diffstat (limited to 'src/main/java/me/Danker/commands')
-rw-r--r-- | src/main/java/me/Danker/commands/SkillsCommand.java | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/src/main/java/me/Danker/commands/SkillsCommand.java b/src/main/java/me/Danker/commands/SkillsCommand.java index 0bdc762..50f2767 100644 --- a/src/main/java/me/Danker/commands/SkillsCommand.java +++ b/src/main/java/me/Danker/commands/SkillsCommand.java @@ -139,14 +139,30 @@ public class SkillsCommand extends CommandBase { } JsonObject achievementObject = playerObject.get("player").getAsJsonObject().get("achievements").getAsJsonObject(); - farmingLevel = achievementObject.get("skyblock_harvester").getAsInt(); - miningLevel = achievementObject.get("skyblock_excavator").getAsInt(); - combatLevel = achievementObject.get("skyblock_combat").getAsInt(); - foragingLevel = achievementObject.get("skyblock_gatherer").getAsInt(); - fishingLevel = achievementObject.get("skyblock_angler").getAsInt(); - enchantingLevel = achievementObject.get("skyblock_augmentation").getAsInt(); - alchemyLevel = achievementObject.get("skyblock_concoctor").getAsInt(); - tamingLevel = achievementObject.get("skyblock_domesticator").getAsInt(); + if (achievementObject.has("skyblock_harvester")) { + farmingLevel = achievementObject.get("skyblock_harvester").getAsInt(); + } + if (achievementObject.has("skyblock_excavator")) { + miningLevel = achievementObject.get("skyblock_excavator").getAsInt(); + } + if (achievementObject.has("skyblock_combat")) { + combatLevel = achievementObject.get("skyblock_combat").getAsInt(); + } + if (achievementObject.has("skyblock_gatherer")) { + foragingLevel = achievementObject.get("skyblock_gatherer").getAsInt(); + } + if (achievementObject.has("skyblock_angler")) { + fishingLevel = achievementObject.get("skyblock_angler").getAsInt(); + } + if (achievementObject.has("skyblock_augmentation")) { + enchantingLevel = achievementObject.get("skyblock_augmentation").getAsInt(); + } + if (achievementObject.has("skyblock_concoctor")) { + alchemyLevel = achievementObject.get("skyblock_concoctor").getAsInt(); + } + if (achievementObject.has("skyblock_domesticator")) { + tamingLevel = achievementObject.get("skyblock_domesticator").getAsInt(); + } } double skillAvg = (farmingLevel + miningLevel + combatLevel + foragingLevel + fishingLevel + enchantingLevel + alchemyLevel + tamingLevel) / 8; |