From a2a77a0c87e1f91a880a2a67d9ee9533777d6dd4 Mon Sep 17 00:00:00 2001 From: nmccullagh Date: Tue, 30 Jul 2024 22:58:25 +0100 Subject: [PATCH 1/2] Use Taming Levels Added to API. Potential fix for active armour inserted into wrong wardrobe slot --- .../inventory/itemLoaders/WardrobeInventoryItemLoader.java | 6 +++--- .../skyblock/profileviewer/skills/SkillWidget.java | 4 ++-- .../skyblock/profileviewer/skills/SkillsPage.java | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/profileviewer/inventory/itemLoaders/WardrobeInventoryItemLoader.java b/src/main/java/de/hysky/skyblocker/skyblock/profileviewer/inventory/itemLoaders/WardrobeInventoryItemLoader.java index 9d4347264c..ba98da2650 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/profileviewer/inventory/itemLoaders/WardrobeInventoryItemLoader.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/profileviewer/inventory/itemLoaders/WardrobeInventoryItemLoader.java @@ -25,9 +25,9 @@ public List loadItems(JsonObject data) { if (activeSlot != -1) { List activeArmour = super.loadItems(activeArmorSet).reversed(); for (int i = 0; i < 4; i++) { - int baseIndex = activeSlot % 9; - int page = activeSlot / 9; - int slotIndex = (page * 36) + (i * 9) + baseIndex - 1; + int baseIndex = (activeSlot -1) % 9; + int page = (activeSlot - 1) / 9; + int slotIndex = (page * 36) + (i * 9) + baseIndex; itemList.set(slotIndex, activeArmour.get(i)); } } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/profileviewer/skills/SkillWidget.java b/src/main/java/de/hysky/skyblocker/skyblock/profileviewer/skills/SkillWidget.java index 51f5e5f401..65c54b497a 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/profileviewer/skills/SkillWidget.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/profileviewer/skills/SkillWidget.java @@ -88,8 +88,8 @@ public void render(DrawContext context, int mouseX, int mouseY, int x, int y) { fillColor = Color.MAGENTA; } - if ((SOFT_SKILL_CAP.containsKey(SKILL_NAME) && SKILL_LEVEL.level > SOFT_SKILL_CAP.get(SKILL_NAME)) && SKILL_LEVEL.level < SKILL_CAP.get(SKILL_NAME) && SKILL_LEVEL.fill == 1 || - (SKILL_NAME.equals("Taming") && SKILL_LEVEL.level >= SOFT_SKILL_CAP.get(SKILL_NAME))) { + if ((SOFT_SKILL_CAP.containsKey(SKILL_NAME) && SKILL_LEVEL.level > SOFT_SKILL_CAP.get(SKILL_NAME)) + && SKILL_LEVEL.level < SKILL_CAP.get(SKILL_NAME) && SKILL_LEVEL.fill == 1) { fillColor = Color.YELLOW; } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/profileviewer/skills/SkillsPage.java b/src/main/java/de/hysky/skyblocker/skyblock/profileviewer/skills/SkillsPage.java index 952e5620bf..784da52214 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/profileviewer/skills/SkillsPage.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/profileviewer/skills/SkillsPage.java @@ -49,6 +49,7 @@ private int getSkillCap(String skill) { try { return switch (skill) { case "Farming" -> this.PLAYER_PROFILE.getAsJsonObject("jacobs_contest").getAsJsonObject("perks").get("farming_level_cap").getAsInt(); + case "Taming" -> this.PLAYER_PROFILE.getAsJsonObject("pets_data").getAsJsonObject("pet_care").get("pet_types_sacrificed").getAsJsonArray().size(); default -> -1; }; } catch (Exception e) { From 442f786ce4e9bd22e91249830ce8fab01e72f6ed Mon Sep 17 00:00:00 2001 From: BigloBot <95036804+BigloBot@users.noreply.github.com> Date: Wed, 31 Jul 2024 10:54:34 +0100 Subject: [PATCH 2/2] Update src/main/java/de/hysky/skyblocker/skyblock/profileviewer/inventory/itemLoaders/WardrobeInventoryItemLoader.java Co-authored-by: Kevin <92656833+kevinthegreat1@users.noreply.github.com> --- .../inventory/itemLoaders/WardrobeInventoryItemLoader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/profileviewer/inventory/itemLoaders/WardrobeInventoryItemLoader.java b/src/main/java/de/hysky/skyblocker/skyblock/profileviewer/inventory/itemLoaders/WardrobeInventoryItemLoader.java index ba98da2650..547a0becff 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/profileviewer/inventory/itemLoaders/WardrobeInventoryItemLoader.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/profileviewer/inventory/itemLoaders/WardrobeInventoryItemLoader.java @@ -25,7 +25,7 @@ public List loadItems(JsonObject data) { if (activeSlot != -1) { List activeArmour = super.loadItems(activeArmorSet).reversed(); for (int i = 0; i < 4; i++) { - int baseIndex = (activeSlot -1) % 9; + int baseIndex = (activeSlot - 1) % 9; int page = (activeSlot - 1) / 9; int slotIndex = (page * 36) + (i * 9) + baseIndex; itemList.set(slotIndex, activeArmour.get(i));