From de3e876619285542ad26212e47dcf8b62062e031 Mon Sep 17 00:00:00 2001 From: TakoTheDev <74718793+TakoTheDev@users.noreply.github.com> Date: Fri, 1 Mar 2024 00:40:07 +0100 Subject: [PATCH 1/6] fix: RenderUtil#drawAllInList() doesn't draw correctly (#446) * fix drawAllInList alignment * fixed a slight inconsistency * Remove color code from getStringWidth Co-authored-by: Sychic <47618543+Sychic@users.noreply.github.com> Signed-off-by: TakoTheDev <74718793+TakoTheDev@users.noreply.github.com> --------- Signed-off-by: TakoTheDev <74718793+TakoTheDev@users.noreply.github.com> Co-authored-by: Sychic <47618543+Sychic@users.noreply.github.com> cherry picked from 2c119f2f15001183a59211ed04ab58ecfe340b46 --- .../skytilsmod/features/impl/dungeons/BossHPDisplays.kt | 4 ++-- .../skytils/skytilsmod/features/impl/dungeons/ChestProfit.kt | 2 +- .../skytils/skytilsmod/features/impl/dungeons/DungeonTimer.kt | 2 +- src/main/kotlin/gg/skytils/skytilsmod/utils/RenderUtil.kt | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/BossHPDisplays.kt b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/BossHPDisplays.kt index 7cd9c4784..a6d4bb91f 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/BossHPDisplays.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/BossHPDisplays.kt @@ -185,13 +185,13 @@ object BossHPDisplays { } override fun demoRender() { - RenderUtil.drawAllInList(this, GIANT_NAMES.map { "$it §a20M§c❤" }) + RenderUtil.drawAllInList(this, GIANT_NAMES.map { "$it §a19.5M§c❤" }) } override val height: Int get() = ScreenRenderer.fontRenderer.FONT_HEIGHT * GIANT_NAMES.size override val width: Int - get() = ScreenRenderer.fontRenderer.getStringWidth("§3§lThe Diamond Giant §a19.9M§c❤") + get() = ScreenRenderer.fontRenderer.getStringWidth("§3§lThe Diamond Giant §a19.5M§c❤") override val toggled: Boolean get() = Skytils.config.showGiantHP diff --git a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/ChestProfit.kt b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/ChestProfit.kt index 1304a8057..949789df0 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/ChestProfit.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/ChestProfit.kt @@ -312,7 +312,7 @@ object ChestProfit { override val height: Int get() = ScreenRenderer.fontRenderer.FONT_HEIGHT * DungeonChest.entries.size override val width: Int - get() = ScreenRenderer.fontRenderer.getStringWidth("Obsidian Chest: 300M") + get() = ScreenRenderer.fontRenderer.getStringWidth("Obsidian Chest: +300M") override val toggled: Boolean get() = Skytils.config.dungeonChestProfit diff --git a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/DungeonTimer.kt b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/DungeonTimer.kt index 8de4d9bbf..eb76fb619 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/DungeonTimer.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/DungeonTimer.kt @@ -320,7 +320,7 @@ object DungeonTimer { } override val height: Int - get() = ScreenRenderer.fontRenderer.FONT_HEIGHT * 5 + get() = ScreenRenderer.fontRenderer.FONT_HEIGHT * 6 override val width: Int get() = ScreenRenderer.fontRenderer.getStringWidth("§7Wither King: 0s") diff --git a/src/main/kotlin/gg/skytils/skytilsmod/utils/RenderUtil.kt b/src/main/kotlin/gg/skytils/skytilsmod/utils/RenderUtil.kt index 2d820bebb..acaf10f2c 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/utils/RenderUtil.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/utils/RenderUtil.kt @@ -866,7 +866,7 @@ object RenderUtil { val leftAlign = element.scaleX < UResolution.scaledWidth / 2f val alignment = if (leftAlign) SmartFontRenderer.TextAlignment.LEFT_RIGHT else SmartFontRenderer.TextAlignment.RIGHT_LEFT - val xPos = if (leftAlign) 0f else element.scaleWidth + val xPos = if (leftAlign) 0f else element.width.toFloat() for ((i, str) in lines.withIndex()) { ScreenRenderer.fontRenderer.drawString( str, From 2b7b8dec7f6163e5c7e45a3c5568b9dc547a7c42 Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Thu, 7 Mar 2024 18:59:18 -0500 Subject: [PATCH 2/6] fix: creeper solver hitbox cherry picked from 93679cc4d1810823a46f48bb7914f00ad1121c36 --- .../skytilsmod/features/impl/dungeons/solvers/CreeperSolver.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/solvers/CreeperSolver.kt b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/solvers/CreeperSolver.kt index 0ce1828b5..2ea2de76b 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/solvers/CreeperSolver.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/solvers/CreeperSolver.kt @@ -59,7 +59,7 @@ object CreeperSolver { }?.firstOrNull() } else if (solutionPairs.isEmpty()) { val creeper = this.creeper!!.entityBoundingBox - val validBox = creeper.expand(0.5, 0.75, 0.5) + val validBox = creeper.expand(0.5, 0.5, 0.5).offset(0.0, 77 - creeper.minY, 0.0) val roomBB = creeper.expand(14.0, 10.0, 13.0) val candidates = BlockPos.getAllInBox(BlockPos(roomBB.minVec), BlockPos(roomBB.maxVec)).filter { From a349af058a147fd33cfdb497cc8879de44a7da3f Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Tue, 5 Mar 2024 23:08:33 -0500 Subject: [PATCH 3/6] fix: wrong render position for Dungeon Chest Profit cherry picked from 6a1cd3d8aa7a324f71637e8842325a264aaa86ed --- .../skytils/skytilsmod/features/impl/dungeons/ChestProfit.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/ChestProfit.kt b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/ChestProfit.kt index 949789df0..4cd6af7a7 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/ChestProfit.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/ChestProfit.kt @@ -25,6 +25,7 @@ import gg.skytils.skytilsmod.core.structure.GuiElement import gg.skytils.skytilsmod.events.impl.GuiContainerEvent import gg.skytils.skytilsmod.features.impl.handlers.AuctionData import gg.skytils.skytilsmod.features.impl.misc.ItemFeatures +import gg.skytils.skytilsmod.mixins.transformers.accessors.AccessorGuiContainer import gg.skytils.skytilsmod.utils.* import gg.skytils.skytilsmod.utils.NumberUtil.romanToDecimal import gg.skytils.skytilsmod.utils.RenderUtil.highlight @@ -86,7 +87,10 @@ object ChestProfit { chestType.items.add(DungeonChestLootItem(lootSlot, value)) } } + GlStateManager.pushMatrix() + GlStateManager.translate((-(event.gui as AccessorGuiContainer).guiLeft).toDouble(), -event.gui.guiTop.toDouble(), 299.0) drawChestProfit(chestType) + GlStateManager.popMatrix() } else if (croesusChestRegex.matches(event.chestName)) { for (i in 10..16) { val openChest = inv.getStackInSlot(i) ?: continue From 25935e4df2ef595af256f972c3ce59299dcc4957 Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Sat, 9 Mar 2024 15:36:23 -0500 Subject: [PATCH 4/6] fix: DungeonListener#team doesn't update after disconnecting fixes NPE cherry picked from 2c7a5b50de5416f0b87148c56136d8b417b37b62 --- .../kotlin/gg/skytils/skytilsmod/listeners/DungeonListener.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/gg/skytils/skytilsmod/listeners/DungeonListener.kt b/src/main/kotlin/gg/skytils/skytilsmod/listeners/DungeonListener.kt index 2436bbbc9..000efc9bb 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/listeners/DungeonListener.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/listeners/DungeonListener.kt @@ -190,7 +190,7 @@ object DungeonListener { } } tickTimer(2, repeats = true) { - if (Utils.inDungeons && (DungeonTimer.scoreShownAt == -1L || System.currentTimeMillis() - DungeonTimer.scoreShownAt < 1500)) { + if (Utils.inDungeons && mc.thePlayer != null && (DungeonTimer.scoreShownAt == -1L || System.currentTimeMillis() - DungeonTimer.scoreShownAt < 1500)) { val tabEntries = TabListUtils.tabEntries if (team.isEmpty() || (DungeonTimer.dungeonStartTime != -1L && team.values.any { it.dungeonClass == DungeonClass.EMPTY })) { if (tabEntries.isNotEmpty() && tabEntries[0].second.contains("§r§b§lParty §r§f(")) { From facd8686633c5c9bb9fd239026c9a03563d228bf Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Sat, 9 Mar 2024 15:39:39 -0500 Subject: [PATCH 5/6] version: 1.8.3 --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 4d904449f..1165c0f18 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -34,7 +34,7 @@ plugins { signing } -version = "1.8.2" +version = "1.8.3" group = "gg.skytils" repositories { From c1b94830b30df9536c4a7a6e3f0b40c4ef520e54 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Mar 2024 14:39:57 +0000 Subject: [PATCH 6/6] build(deps): bump org.jetbrains.gradle.plugin.idea-ext Bumps org.jetbrains.gradle.plugin.idea-ext from 1.1.7 to 1.1.8. --- updated-dependencies: - dependency-name: org.jetbrains.gradle.plugin.idea-ext dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 1165c0f18..2997f03f1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -29,7 +29,7 @@ plugins { id("gg.essential.loom") version "1.3.12" id("gg.essential.defaults") version "0.3.0" idea - id("org.jetbrains.gradle.plugin.idea-ext") version "1.1.7" + id("org.jetbrains.gradle.plugin.idea-ext") version "1.1.8" signing }