diff options
author | syeyoung <cyong06@naver.com> | 2021-04-25 23:42:50 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-04-25 23:42:50 +0900 |
commit | 31962f3cd061697fe7596102632f471ff01cb6c8 (patch) | |
tree | 95f8b1b81672141c71050062621c035d3ef01de1 /src/main/java/kr/syeyoung/dungeonsguide | |
parent | b5a7c0164cfc595e639577ec8aa217748cc395f0 (diff) | |
download | Skyblock-Dungeons-Guide-31962f3cd061697fe7596102632f471ff01cb6c8.tar.gz Skyblock-Dungeons-Guide-31962f3cd061697fe7596102632f471ff01cb6c8.tar.bz2 Skyblock-Dungeons-Guide-31962f3cd061697fe7596102632f471ff01cb6c8.zip |
I think I fixed most bugs.
Also pls test with ign: deathstreaks l8r, to future sye
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide')
5 files changed, 24 insertions, 21 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/DataRendererClassLv.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/DataRendererClassLv.java index 363cbeee..63de1db4 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/DataRendererClassLv.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/DataRendererClassLv.java @@ -34,7 +34,7 @@ public class DataRendererClassLv implements DataRenderer { if (selected) fr.drawString("★", fr.getStringWidth(dungeonClass.getFamilarName()+" "+xpCalcResult.getLevel()+" "),0,0xFFAAAAAA); - RenderUtils.renderBar(0, fr.FONT_HEIGHT, 100,xpCalcResult.getRemainingXp() == 0 ? 1 : (float) (xpCalcResult.getNextLvXp() / xpCalcResult.getRemainingXp())); + RenderUtils.renderBar(0, fr.FONT_HEIGHT, 100,xpCalcResult.getRemainingXp() == 0 ? 1 : (float) (xpCalcResult.getRemainingXp() / xpCalcResult.getNextLvXp())); } return new Dimension(100, fr.FONT_HEIGHT*2); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/DataRendererDungeonLv.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/DataRendererDungeonLv.java index f9a41e6f..6c76d860 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/DataRendererDungeonLv.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/DataRendererDungeonLv.java @@ -31,7 +31,7 @@ public class DataRendererDungeonLv implements DataRenderer { fr.drawString(dungeonType.getFamiliarName(), 0,0, 0xFFFF5555); fr.drawString(xpCalcResult.getLevel()+"", fr.getStringWidth(dungeonType.getFamiliarName()+" "),0,0xFFFFFFFF); - RenderUtils.renderBar(0, fr.FONT_HEIGHT, 100,xpCalcResult.getRemainingXp() == 0 ? 1 : (float) (xpCalcResult.getNextLvXp() / xpCalcResult.getRemainingXp())); + RenderUtils.renderBar(0, fr.FONT_HEIGHT, 100,xpCalcResult.getRemainingXp() == 0 ? 1 : (float) (xpCalcResult.getRemainingXp() / xpCalcResult.getNextLvXp())); } return new Dimension(100, fr.FONT_HEIGHT*2); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/DataRendererEditor.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/DataRendererEditor.java index b42f1aa0..29c728ce 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/DataRendererEditor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/DataRendererEditor.java @@ -151,7 +151,7 @@ public class DataRendererEditor extends MPanel { dim = dataRenderer.renderDummy(); GlStateManager.popMatrix(); } - clip(sr, scissor.x + 156, scissor.y + 5+fr.FONT_HEIGHT+3, hamburgerWidth, 230); + clip(sr, scissor.x + 155, scissor.y + 5+fr.FONT_HEIGHT+3, hamburgerWidth, 230); GlStateManager.translate(-hamburgerWidth-1, 0, 0); Gui.drawRect(0,0, hamburgerWidth, dim.height-1, 0xFFAAAAAA); fr.drawString("=",fr.getStringWidth("=")/2,(dim.height - fr.FONT_HEIGHT) / 2, 0xFFFFFFFF); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/DataRendererSkillLv.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/DataRendererSkillLv.java index 16442f22..ebd42cb8 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/DataRendererSkillLv.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/DataRendererSkillLv.java @@ -31,7 +31,7 @@ public class DataRendererSkillLv implements DataRenderer { fr.drawString(skill.getFriendlyName(), 0,0, 0xFF55ffff); fr.drawString(xpCalcResult.getLevel()+"", fr.getStringWidth(skill.getFriendlyName()+" "),0,0xFFFFFFFF); - RenderUtils.renderBar(0, fr.FONT_HEIGHT, 100,xpCalcResult.getRemainingXp() == 0 ? 1 : (float) (xpCalcResult.getNextLvXp() / xpCalcResult.getRemainingXp())); + RenderUtils.renderBar(0, fr.FONT_HEIGHT, 100,xpCalcResult.getRemainingXp() == 0 ? 1 : (float) (xpCalcResult.getRemainingXp() / xpCalcResult.getNextLvXp())); } return new Dimension(100, fr.FONT_HEIGHT*2); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FeatureViewPlayerOnJoin.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FeatureViewPlayerOnJoin.java index 814ed011..0e96d4c4 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FeatureViewPlayerOnJoin.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FeatureViewPlayerOnJoin.java @@ -350,27 +350,30 @@ public class FeatureViewPlayerOnJoin extends SimpleFeature implements GuiPostRen this.inventory.armorInventory = skyblockProfile.getCurrentArmor().getArmorSlots(); int highestDungeonScore = Integer.MIN_VALUE; - ItemStack highestItem = null; - for (ItemStack itemStack : skyblockProfile.getInventory()) { - if (itemStack == null) continue; - NBTTagCompound display = itemStack.getTagCompound().getCompoundTag("display"); - if (display == null) continue; - NBTTagList nbtTagList = display.getTagList("Lore", 8); - if (nbtTagList == null) continue; - for (int i = 0; i < nbtTagList.tagCount(); i++) { - String str = nbtTagList.getStringTagAt(i); - if (str.contains("Gear")) { - int dungeonScore = Integer.parseInt(TextUtils.keepIntegerCharactersOnly(TextUtils.stripColor(str).split(" ")[3])); - if (dungeonScore > highestDungeonScore) { - highestItem = itemStack; - highestDungeonScore = dungeonScore; + if (skyblockProfile.getInventory() != null) { + ItemStack highestItem = null; + for (ItemStack itemStack : skyblockProfile.getInventory()) { + if (itemStack == null) continue; + NBTTagCompound display = itemStack.getTagCompound().getCompoundTag("display"); + if (display == null) continue; + NBTTagList nbtTagList = display.getTagList("Lore", 8); + if (nbtTagList == null) continue; + for (int i = 0; i < nbtTagList.tagCount(); i++) { + String str = nbtTagList.getStringTagAt(i); + if (TextUtils.stripColor(str).startsWith("Gear")) { + System.out.println(str); + int dungeonScore = Integer.parseInt(TextUtils.keepIntegerCharactersOnly(TextUtils.stripColor(str).split(" ")[2])); + if (dungeonScore > highestDungeonScore) { + highestItem = itemStack; + highestDungeonScore = dungeonScore; + } } } } - } - this.inventory.mainInventory[0] = highestItem; - this.inventory.currentItem = 0; + this.inventory.mainInventory[0] = highestItem; + this.inventory.currentItem = 0; + } } public String getSkinType() { |