From 25f0e7fd62db22036969120843165f4759530b8f Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Thu, 17 Jul 2025 11:52:28 +0200 Subject: feat: Launch on 1.21.7 --- build.gradle.kts | 6 +- gradle/libs.versions.toml | 45 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- .../nea/firmament/compat/jade/DrillToolProvider.kt | 35 ++- .../mixins/compat/jade/ElementAccessor.java | 12 - .../firmament/compat/rei/NEUItemEntryRenderer.kt | 8 +- .../firmament/compat/rei/recipes/SBKatRecipe.kt | 174 ++++++++------ .../firmament/mixins/HideStatusEffectsPatch.java | 13 +- .../nea/firmament/mixins/MixinHandledScreen.java | 8 +- .../nea/firmament/mixins/PlayerDropEventPatch.java | 2 +- .../mixins/WorldRenderLastEventPatch.java | 4 +- .../devcosmetics/CustomCapeFeatureRenderer.java | 2 +- src/main/kotlin/features/chat/ChatLinks.kt | 12 +- .../features/debug/ExportedTestConstantMeta.kt | 2 +- .../features/debug/itemeditor/LegacyItemData.kt | 7 +- .../debug/itemeditor/LegacyItemExporter.kt | 2 +- .../kotlin/features/diana/AncestralSpadeSolver.kt | 6 +- .../events/anniversity/AnniversaryFeatures.kt | 3 +- src/main/kotlin/features/fixes/Fixes.kt | 7 +- .../features/inventory/ItemRarityCosmetics.kt | 3 +- src/main/kotlin/features/inventory/PetFeatures.kt | 62 +++-- .../features/inventory/REIDependencyWarner.kt | 2 +- src/main/kotlin/features/inventory/SlotLocking.kt | 4 +- .../inventory/buttons/InventoryButtonEditor.kt | 38 +-- .../features/inventory/buttons/InventoryButtons.kt | 6 +- .../storageoverlay/StorageOverviewScreen.kt | 6 +- .../kotlin/features/items/BonemerangOverlay.kt | 7 +- src/main/kotlin/features/macros/ComboProcessor.kt | 11 +- src/main/kotlin/features/macros/RadialMenu.kt | 17 +- src/main/kotlin/features/mining/PickaxeAbility.kt | 8 +- .../features/mining/PristineProfitTracker.kt | 3 +- src/main/kotlin/features/misc/CustomCapes.kt | 48 ++-- src/main/kotlin/features/misc/Hud.kt | 19 +- src/main/kotlin/features/world/FairySouls.kt | 1 - src/main/kotlin/features/world/Waypoints.kt | 3 +- src/main/kotlin/gui/BarComponent.kt | 4 +- src/main/kotlin/gui/CheckboxComponent.kt | 3 +- src/main/kotlin/gui/config/HudMetaHandler.kt | 14 +- src/main/kotlin/gui/config/JAnyHud.kt | 71 ++++-- src/main/kotlin/gui/config/ManagedConfig.kt | 7 +- src/main/kotlin/gui/entity/EntityRenderer.kt | 7 +- src/main/kotlin/gui/hud/MoulConfigHud.kt | 10 +- src/main/kotlin/repo/ItemCache.kt | 5 +- src/main/kotlin/repo/MiningRepoData.kt | 3 +- src/main/kotlin/util/FragmentGuiScreen.kt | 10 +- src/main/kotlin/util/MC.kt | 5 +- src/main/kotlin/util/MoulConfigFragment.kt | 6 +- src/main/kotlin/util/MoulConfigUtils.kt | 6 +- src/main/kotlin/util/mc/ItemUtil.kt | 30 ++- src/main/kotlin/util/render/CustomRenderLayers.kt | 10 +- src/main/kotlin/util/render/DrawContextExt.kt | 85 +++++-- .../kotlin/util/render/FacingThePlayerContext.kt | 5 +- .../kotlin/util/render/RenderCircleProgress.kt | 14 +- .../kotlin/util/render/RenderInWorldContext.kt | 25 +- src/main/kotlin/util/render/TranslatedScissors.kt | 28 +-- src/main/resources/firmament.accesswidener | 3 +- src/test/kotlin/testutil/ItemResources.kt | 2 +- .../texturepack/CustomGlobalArmorOverrides.kt | 4 +- .../features/texturepack/CustomScreenLayouts.kt | 3 +- .../features/texturepack/StringMatcher.kt | 265 ++++++++++----------- .../texturepack/predicates/SkullPredicate.kt | 2 +- .../custommodels/CustomSkullTexturePatch.java | 4 +- .../mixins/custommodels/SupplyFakeModelPatch.java | 6 +- .../screenlayouts/ReplaceAnvilScreen.java | 6 +- .../screenlayouts/ReplaceFurnaceBackgrounds.java | 5 +- .../screenlayouts/ReplacePlayerBackgrounds.java | 11 +- .../ReplaceTextColorInHandledScreen.java | 17 +- 67 files changed, 698 insertions(+), 566 deletions(-) delete mode 100644 src/compat/jade/java/moe/nea/firmament/mixins/compat/jade/ElementAccessor.java diff --git a/build.gradle.kts b/build.gradle.kts index c8bdfdb..9b28c22 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -27,10 +27,8 @@ plugins { alias(libs.plugins.kotlin.plugin.serialization) alias(libs.plugins.kotlin.plugin.powerassert) alias(libs.plugins.kotlin.plugin.ksp) - // alias(libs.plugins.loom) + alias(libs.plugins.loom) alias(libs.plugins.shadow) apply false - // TODO: use arch loom once they update to 1.8 - id("fabric-loom") version "1.10.1" id("firmament.common") id("firmament.license-management") alias(libs.plugins.mcAutoTranslations) @@ -197,7 +195,7 @@ val explosiveEnhancementSourceSet = val wildfireGenderSourceSet = createIsolatedSourceSet("wildfireGender") val jadeSourceSet = createIsolatedSourceSet("jade") val modmenuSourceSet = createIsolatedSourceSet("modmenu") -val reiSourceSet = createIsolatedSourceSet("rei") +val reiSourceSet = createIsolatedSourceSet("rei", isEnabled = false) val moulconfigSourceSet = createIsolatedSourceSet("moulconfig") val customTexturesSourceSet = createIsolatedSourceSet("texturePacks", "texturePacks") diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d4ff2c4..46dc698 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,42 +3,41 @@ # SPDX-License-Identifier: CC0-1.0 [versions] -minecraft = "1.21.5" +minecraft = "1.21.7" +# Update from https://maven.fabricmc.net/net/fabricmc/fabric-language-kotlin/ +fabric_kotlin = "1.13.2+kotlin.2.1.20" # Update from https://kotlinlang.org/ kotlin = "2.1.20" # Update from https://github.com/google/ksp/releases kotlin_ksp = "2.1.20-2.0.0" -# Update from https://linkie.shedaniel.me/dependencies?loader=fabric -fabric_loader = "0.16.13" -fabric_api = "0.119.9+1.21.5" -yarn = "1.21.5+build.1" -modmenu = "14.0.0-rc.2" -architectury = "16.0.3" +# Update from https://linkie.shedaniel.dev/dependencies?loader=fabric +yarn = "1.21.7+build.8" +fabric_loader = "0.16.14" +fabric_api = "0.129.0+1.21.7" +architectury = "17.0.6" +modmenu = "15.0.0-beta.3" # Update from https://maven.architectury.dev/me/shedaniel/RoughlyEnoughItems-fabric/ (but is typically late) rei = "19.0.805" -# Update from https://maven.fabricmc.net/net/fabricmc/fabric-language-kotlin/ -fabric_kotlin = "1.13.2+kotlin.2.1.20" - # Update from https://maven.architectury.dev/dev/architectury/loom/dev.architectury.loom.gradle.plugin/ -loom = "1.7.414" # TODO: port back to architectury (and) 1.9.424 +loom = "1.10.433" # TODO: port back to architectury (and) 1.9.424 # Update from https://modrinth.com/mod/qolify/versions?l=fabric qolify = "1.6.0-1.21.1" # Update from https://modrinth.com/mod/sodium/versions?l=fabric -sodium = "mc1.21.5-0.6.13-fabric" +sodium = "mc1.21.6-0.6.13-fabric" # Update from https://modrinth.com/mod/freecam/versions?l=fabric -freecammod = "1.3.3+mc1.21.5" +freecammod = "1.3.4+mc1.21.6" # Update from https://modrinth.com/mod/no-chat-reports/versions?l=fabric -ncr = "Fabric-1.21.5-v2.12.0" +ncr = "Fabric-1.21.7-v2.14.0" # Update from https://modrinth.com/mod/female-gender/versions?l=fabric -femalegender = "4.3.4+1.21.5" +femalegender = "4.3.4+1.21.7" shadow = "8.3.8" @@ -46,18 +45,18 @@ shadow = "8.3.8" explosiveenhancement = "1.2.3-1.21.0" # Update from https://modrinth.com/mod/not-enough-animations/versions?l=fabric -notenoughanimations = "prj4BdjU" +notenoughanimations = "JTLkasT1" -# Update from https://modrinth.com/mod/cit-resewn/versions?l=fabric +# Update from https://modrinth.com/mod/cit-resewn/versions?l=fabric lmao yeah sure citresewn = "1.2.0+1.21" # Update from https://modrinth.com/mod/jade/versions?l=fabric -jade = "18.1.0+fabric" +jade = "19.0.4+fabric" devauth = "1.2.1" # Update from https://ktor.io/docs/ -ktor = "3.1.2" +ktor = "3.2.2" # Update from https://repo.nea.moe/#/releases/moe/nea/neurepoparser neurepoparser = "1.8.0" @@ -69,7 +68,9 @@ hotswap_agent = "1.4.2-SNAPSHOT" # Update from https://github.com/LlamaLad7/MixinExtras/tags mixinextras = "0.4.1" -jarvis = "1.1.4" +# Update from https://repo.nea.moe/#/releases/moe/nea/jarvis/ +jarvis = "2.0.0" + nealisp = "1.1.0" # Update from https://github.com/NotEnoughUpdates/MoulConfig/tags @@ -90,7 +91,7 @@ manninghamMills = "2.4.1" # Update from https://docs.isxander.dev/yet-another-config-lib/installing-yacl # Nvm, they just don't update docs: https://modrinth.com/mod/yacl/versions?l=fabric -yacl = "3.6.6+1.21.5-fabric" +yacl = "3.7.1+1.21.6-fabric" # Update from https://maven.shedaniel.me/me/shedaniel/cloth/basic-math/ basicMath = "0.6.1" @@ -109,7 +110,7 @@ fabric_api_deprecated = { module = "net.fabricmc.fabric-api:fabric-api-deprecate fabric_kotlin = { module = "net.fabricmc:fabric-language-kotlin", version.ref = "fabric_kotlin" } architectury = { module = "dev.architectury:architectury", version.ref = "architectury" } rei_api = { module = "me.shedaniel:RoughlyEnoughItems-api", version.ref = "rei" } -moulconfig = { module = "org.notenoughupdates.moulconfig:modern-1.21.5", version.ref = "moulconfig" } +moulconfig = { module = "org.notenoughupdates.moulconfig:modern-1.21.7", version.ref = "moulconfig" } repoparser = { module = "moe.nea:neurepoparser", version.ref = "neurepoparser" } mixinextras = { module = "io.github.llamalad7:mixinextras-fabric", version.ref = "mixinextras" } jarvis_api = { module = "moe.nea.jarvis:jarvis-api", version.ref = "jarvis" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4cdd0fb..8b8fb18 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -4,6 +4,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/compat/jade/java/moe/nea/firmament/compat/jade/DrillToolProvider.kt b/src/compat/jade/java/moe/nea/firmament/compat/jade/DrillToolProvider.kt index 10bff1b..addfc42 100644 --- a/src/compat/jade/java/moe/nea/firmament/compat/jade/DrillToolProvider.kt +++ b/src/compat/jade/java/moe/nea/firmament/compat/jade/DrillToolProvider.kt @@ -1,6 +1,5 @@ package moe.nea.firmament.compat.jade -import java.util.Optional import java.util.function.UnaryOperator import snownee.jade.api.BlockAccessor import snownee.jade.api.IBlockComponentProvider @@ -8,14 +7,13 @@ import snownee.jade.api.ITooltip import snownee.jade.api.JadeIds import snownee.jade.api.config.IPluginConfig import snownee.jade.api.theme.IThemeHelper -import snownee.jade.api.ui.IElement -import snownee.jade.api.ui.IElementHelper +import snownee.jade.api.ui.Element +import snownee.jade.api.ui.JadeUI +import snownee.jade.gui.JadeLinearLayout import snownee.jade.impl.ui.ItemStackElement -import snownee.jade.impl.ui.TextElement -import kotlin.jvm.optionals.getOrDefault +import snownee.jade.impl.ui.TextElementImpl import net.minecraft.text.Text import net.minecraft.util.Identifier -import net.minecraft.util.math.Vec2f import moe.nea.firmament.Firmament import moe.nea.firmament.repo.ExpensiveItemCacheApi import moe.nea.firmament.repo.RepoManager @@ -38,34 +36,31 @@ class DrillToolProvider : IBlockComponentProvider { if (lastItemIndex < 0) return@map inner val innerMut = inner.toMutableList() val harvestIndicator = innerMut.indexOfLast { - it is TextElement && it.cachedSize == Vec2f.ZERO && it.text.visit { - if (it.isEmpty()) Optional.empty() else Optional.of(true) - }.getOrDefault(false) + it is TextElementImpl && it.width == 0 && it.string.isNotEmpty() } val canHarvest = SBItemStack(MC.stackInHand).breakingPower >= customBlock.breakingPower val lastItem = innerMut[lastItemIndex] as ItemStackElement if (harvestIndicator < 0) { - innerMut.add(lastItemIndex + 1, canHarvestIndicator(canHarvest, lastItem.alignment)) + innerMut.add(lastItemIndex + 1, canHarvestIndicator(canHarvest)) } else { - innerMut.set(harvestIndicator, canHarvestIndicator(canHarvest, lastItem.alignment)) + innerMut.set(harvestIndicator, canHarvestIndicator(canHarvest)) } - innerMut.set(lastItemIndex, IElementHelper.get() - .item(tool, 0.75f) - .translate(lastItem.translation) - .size(lastItem.size) - .message(null) - .align(lastItem.alignment)) + innerMut.set( + lastItemIndex, JadeUI + .item(tool, 0.75f) + ) innerMut.subList(0, lastItemIndex - 1).removeIf { it is ItemStackElement } innerMut } }) } - fun canHarvestIndicator(canHarvest: Boolean, align: IElement.Align): IElement { + fun canHarvestIndicator(canHarvest: Boolean): Element { val t = IThemeHelper.get() val text = if (canHarvest) t.success(CHECK) else t.danger(X) - return IElementHelper.get().text(text) - .scale(0.75F).zOffset(800).size(Vec2f.ZERO).translate(Vec2f(-3F, 3.25F)).align(align) + return JadeUI.text(text) + .scale(0.75F) + .alignSelfCenter() } private val CHECK: Text = Text.literal("✔") diff --git a/src/compat/jade/java/moe/nea/firmament/mixins/compat/jade/ElementAccessor.java b/src/compat/jade/java/moe/nea/firmament/mixins/compat/jade/ElementAccessor.java deleted file mode 100644 index 1b58e3c..0000000 --- a/src/compat/jade/java/moe/nea/firmament/mixins/compat/jade/ElementAccessor.java +++ /dev/null @@ -1,12 +0,0 @@ -package moe.nea.firmament.mixins.compat.jade; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.gen.Accessor; -import snownee.jade.api.ui.Element; -import snownee.jade.api.ui.IElement; - -@Mixin(Element.class) -public interface ElementAccessor { - @Accessor("align") - IElement.Align getAlign_firmament(); -} diff --git a/src/compat/rei/java/moe/nea/firmament/compat/rei/NEUItemEntryRenderer.kt b/src/compat/rei/java/moe/nea/firmament/compat/rei/NEUItemEntryRenderer.kt index 5e4eee3..f881f77 100644 --- a/src/compat/rei/java/moe/nea/firmament/compat/rei/NEUItemEntryRenderer.kt +++ b/src/compat/rei/java/moe/nea/firmament/compat/rei/NEUItemEntryRenderer.kt @@ -52,9 +52,9 @@ object NEUItemEntryRenderer : EntryRenderer { entry.value.asImmutableItemStack() } - context.matrices.push() - context.matrices.translate(bounds.centerX.toFloat(), bounds.centerY.toFloat(), 0F) - context.matrices.scale(bounds.width.toFloat() / 16F, bounds.height.toFloat() / 16F, 1f) + context.matrices.pushMatrix() + context.matrices.translate(bounds.centerX.toFloat(), bounds.centerY.toFloat(), ) + context.matrices.scale(bounds.width.toFloat() / 16F, bounds.height.toFloat() / 16F, ) context.drawItemWithoutEntity(itemToRender, -8, -8) context.drawStackOverlay( minecraft.textRenderer, itemToRender, -8, -8, @@ -64,7 +64,7 @@ object NEUItemEntryRenderer : EntryRenderer { ) else null ) - context.matrices.pop() + context.matrices.popMatrix() } val minecraft = MinecraftClient.getInstance() diff --git a/src/compat/rei/java/moe/nea/firmament/compat/rei/recipes/SBKatRecipe.kt b/src/compat/rei/java/moe/nea/firmament/compat/rei/recipes/SBKatRecipe.kt index cce1465..f77e9f5 100644 --- a/src/compat/rei/java/moe/nea/firmament/compat/rei/recipes/SBKatRecipe.kt +++ b/src/compat/rei/java/moe/nea/firmament/compat/rei/recipes/SBKatRecipe.kt @@ -17,7 +17,6 @@ import me.shedaniel.rei.api.client.gui.widgets.WidgetWithBounds import me.shedaniel.rei.api.client.gui.widgets.Widgets import me.shedaniel.rei.api.client.registry.display.DisplayCategory import me.shedaniel.rei.api.common.category.CategoryIdentifier -import me.shedaniel.rei.api.common.util.EntryStacks import kotlin.time.Duration.Companion.seconds import net.minecraft.client.gui.DrawContext import net.minecraft.client.gui.Element @@ -55,11 +54,13 @@ class SBKatRecipe(override val neuRecipe: NEUKatUpgradeRecipe) : SBRecipe() { val inputLevelLabelCenter = Point(bounds.minX + 30 - 18 + 5 + 8, bounds.minY + 25) val inputLevelLabel = Widgets.createLabel( inputLevelLabelCenter, - Text.literal("")).centered() + Text.literal("") + ).centered() val outputLevelLabelCenter = Point(bounds.maxX - 30 + 8, bounds.minY + 25) val outputLevelLabel = Widgets.createLabel( outputLevelLabelCenter, - Text.literal("")).centered() + Text.literal("") + ).centered() val coinStack = SBItemStack(SkyblockId.COINS, recipe.coins.toInt()) levelValue.whenChanged { oldValue, newValue -> if (oldValue.toInt() == newValue.toInt()) return@whenChanged @@ -72,40 +73,60 @@ class SBKatRecipe(override val neuRecipe: NEUKatUpgradeRecipe) : SBRecipe() { inputLevelLabel.message = Text.literal(newInput.levelData.currentLevel.toString()) inputLevelLabel.bounds.location = Point( inputLevelLabelCenter.x - MC.font.getWidth(inputLevelLabel.message) / 2, - inputLevelLabelCenter.y) + inputLevelLabelCenter.y + ) outputLevelLabel.message = Text.literal(newOutput.levelData.currentLevel.toString()) outputLevelLabel.bounds.location = Point( outputLevelLabelCenter.x - MC.font.getWidth(outputLevelLabel.message) / 2, - outputLevelLabelCenter.y) + outputLevelLabelCenter.y + ) coinStack.setStackSize((recipe.coins * (1 - 0.3 * newValue / 100)).toInt()) } levelValue.set(1F) add(Widgets.createRecipeBase(bounds)) - add(wrapWidget(Rectangle(bounds.centerX - slider.width / 2, - bounds.maxY - 30, - slider.width, - slider.height), - slider)) - add(Widgets.withTooltip( - Widgets.createArrow(Point(bounds.centerX - arrowWidth / 2, bounds.minY + 40)), - Text.literal("Upgrade time: " + FirmFormatters.formatTimespan(recipe.seconds.seconds)))) + add( + wrapWidget( + Rectangle( + bounds.centerX - slider.width / 2, + bounds.maxY - 30, + slider.width, + slider.height + ), + slider + ) + ) + add( + Widgets.withTooltip( + Widgets.createArrow(Point(bounds.centerX - arrowWidth / 2, bounds.minY + 40)), + Text.literal("Upgrade time: " + FirmFormatters.formatTimespan(recipe.seconds.seconds)) + ) + ) add(Widgets.createResultSlotBackground(Point(bounds.maxX - 30, bounds.minY + 40))) add(inputLevelLabel) add(outputLevelLabel) - add(Widgets.createSlot(Point(bounds.maxX - 30, bounds.minY + 40)).markOutput().disableBackground() - .entry(SBItemEntryDefinition.getEntry(outputStack))) - add(Widgets.createSlot(Point(bounds.minX + 30 - 18 + 5, bounds.minY + 40)).markInput() - .entry(SBItemEntryDefinition.getEntry(inputStack))) + add( + Widgets.createSlot(Point(bounds.maxX - 30, bounds.minY + 40)).markOutput().disableBackground() + .entry(SBItemEntryDefinition.getEntry(outputStack)) + ) + add( + Widgets.createSlot(Point(bounds.minX + 30 - 18 + 5, bounds.minY + 40)).markInput() + .entry(SBItemEntryDefinition.getEntry(inputStack)) + ) val allInputs = recipe.items.map { SBItemEntryDefinition.getEntry(it) } + listOf(SBItemEntryDefinition.getEntry(coinStack)) for ((index, item) in allInputs.withIndex()) { - add(Widgets.createSlot( - Point(bounds.centerX + index * 20 - allInputs.size * 18 / 2 - (allInputs.size - 1) * 2 / 2, - bounds.minY + 20)) - .markInput() - .entry(item)) + add( + Widgets.createSlot( + Point( + bounds.centerX + index * 20 - allInputs.size * 18 / 2 - (allInputs.size - 1) * 2 / 2, + bounds.minY + 20 + ) + ) + .markInput() + .entry(item) + ) } } } @@ -123,8 +144,8 @@ fun wrapWidget(bounds: Rectangle, component: GuiComponent): Widget { } override fun render(context: DrawContext, mouseX: Int, mouseY: Int, delta: Float) { - context.matrices.push() - context.matrices.translate(bounds.minX.toFloat(), bounds.minY.toFloat(), 0F) + context.matrices.pushMatrix() + context.matrices.translate(bounds.minX.toFloat(), bounds.minY.toFloat()) component.render( GuiImmediateContext( ModernRenderContext(context), @@ -133,50 +154,57 @@ fun wrapWidget(bounds: Rectangle, component: GuiComponent): Widget { mouseX - bounds.minX, mouseY - bounds.minY, mouseX, mouseY, mouseX.toFloat(), mouseY.toFloat() - )) - context.matrices.pop() + ) + ) + context.matrices.popMatrix() } override fun mouseMoved(mouseX: Double, mouseY: Double) { val mouseXInt = mouseX.toInt() val mouseYInt = mouseY.toInt() - component.mouseEvent(MouseEvent.Move(0F, 0F), - GuiImmediateContext( - IMinecraft.instance.provideTopLevelRenderContext(), - bounds.minX, bounds.minY, - bounds.width, bounds.height, - mouseXInt - bounds.minX, mouseYInt - bounds.minY, - mouseXInt, mouseYInt, - mouseX.toFloat(), mouseY.toFloat() - )) + component.mouseEvent( + MouseEvent.Move(0F, 0F), + GuiImmediateContext( + IMinecraft.instance.provideTopLevelRenderContext(), + bounds.minX, bounds.minY, + bounds.width, bounds.height, + mouseXInt - bounds.minX, mouseYInt - bounds.minY, + mouseXInt, mouseYInt, + mouseX.toFloat(), mouseY.toFloat() + ) + ) } override fun mouseClicked(mouseX: Double, mouseY: Double, button: Int): Boolean { val mouseXInt = mouseX.toInt() val mouseYInt = mouseY.toInt() - return component.mouseEvent(MouseEvent.Click(button, true), - GuiImmediateContext( - IMinecraft.instance.provideTopLevelRenderContext(), - bounds.minX, bounds.minY, - bounds.width, bounds.height, - mouseXInt - bounds.minX, mouseYInt - bounds.minY, - mouseXInt, mouseYInt, - mouseX.toFloat(), mouseY.toFloat() - )) + return component.mouseEvent( + MouseEvent.Click(button, true), + GuiImmediateContext( + IMinecraft.instance.provideTopLevelRenderContext(), + bounds.minX, bounds.minY, + bounds.width, bounds.height, + mouseXInt - bounds.minX, mouseYInt - bounds.minY, + mouseXInt, mouseYInt, + mouseX.toFloat(), mouseY.toFloat() + ) + ) } override fun mouseReleased(mouseX: Double, mouseY: Double, button: Int): Boolean { val mouseXInt = mouseX.toInt() val mouseYInt = mouseY.toInt() - return component.mouseEvent(MouseEvent.Click(button, false), - GuiImmediateContext( - IMinecraft.instance.provideTopLevelRenderContext(), - bounds.minX, bounds.minY, - bounds.width, bounds.height, - mouseXInt - bounds.minX, mouseYInt - bounds.minY, - mouseXInt, mouseYInt, - mouseX.toFloat(), mouseY.toFloat() - )) + return component.mouseEvent( + MouseEvent.Click(button, false), + GuiImmediateContext( + IMinecraft.instance.provideTopLevelRenderContext(), + bounds.minX, bounds.minY, + bounds.width, bounds.height, + mouseXInt - bounds.minX, mouseYInt - bounds.minY, + mouseXInt, mouseYInt, + mouseX.toFloat(), mouseY.toFloat() + ) + ) } override fun mouseDragged( @@ -188,15 +216,17 @@ fun wrapWidget(bounds: Rectangle, component: GuiComponent): Widget { ): Boolean { val mouseXInt = mouseX.toInt() val mouseYInt = mouseY.toInt() - return component.mouseEvent(MouseEvent.Move(deltaX.toFloat(), deltaY.toFloat()), - GuiImmediateContext( - IMinecraft.instance.provideTopLevelRenderContext(), - bounds.minX, bounds.minY, - bounds.width, bounds.height, - mouseXInt - bounds.minX, mouseYInt - bounds.minY, - mouseXInt, mouseYInt, - mouseX.toFloat(), mouseY.toFloat() - )) + return component.mouseEvent( + MouseEvent.Move(deltaX.toFloat(), deltaY.toFloat()), + GuiImmediateContext( + IMinecraft.instance.provideTopLevelRenderContext(), + bounds.minX, bounds.minY, + bounds.width, bounds.height, + mouseXInt - bounds.minX, mouseYInt - bounds.minY, + mouseXInt, mouseYInt, + mouseX.toFloat(), mouseY.toFloat() + ) + ) } @@ -208,15 +238,17 @@ fun wrapWidget(bounds: Rectangle, component: GuiComponent): Widget { ): Boolean { val mouseXInt = mouseX.toInt() val mouseYInt = mouseY.toInt() - return component.mouseEvent(MouseEvent.Scroll(verticalAmount.toFloat()), - GuiImmediateContext( - IMinecraft.instance.provideTopLevelRenderContext(), - bounds.minX, bounds.minY, - bounds.width, bounds.height, - mouseXInt - bounds.minX, mouseYInt - bounds.minY, - mouseXInt, mouseYInt, - mouseX.toFloat(), mouseY.toFloat() - )) + return component.mouseEvent( + MouseEvent.Scroll(verticalAmount.toFloat()), + GuiImmediateContext( + IMinecraft.instance.provideTopLevelRenderContext(), + bounds.minX, bounds.minY, + bounds.width, bounds.height, + mouseXInt - bounds.minX, mouseYInt - bounds.minY, + mouseXInt, mouseYInt, + mouseX.toFloat(), mouseY.toFloat() + ) + ) } } } diff --git a/src/main/java/moe/nea/firmament/mixins/HideStatusEffectsPatch.java b/src/main/java/moe/nea/firmament/mixins/HideStatusEffectsPatch.java index c5af8b6..2a58921 100644 --- a/src/main/java/moe/nea/firmament/mixins/HideStatusEffectsPatch.java +++ b/src/main/java/moe/nea/firmament/mixins/HideStatusEffectsPatch.java @@ -1,17 +1,16 @@ package moe.nea.firmament.mixins; -import com.llamalad7.mixinextras.injector.v2.WrapWithCondition; import moe.nea.firmament.features.fixes.Fixes; import net.minecraft.client.gui.DrawContext; -import net.minecraft.client.gui.screen.ingame.InventoryScreen; import net.minecraft.client.gui.screen.ingame.StatusEffectsDisplay; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -@Mixin(InventoryScreen.class) +@Mixin(StatusEffectsDisplay.class) public abstract class HideStatusEffectsPatch { @Shadow public abstract boolean shouldHideStatusEffectHud(); @@ -21,9 +20,11 @@ public abstract class HideStatusEffectsPatch { cir.setReturnValue(!Fixes.TConfig.INSTANCE.getHidePotionEffects()); } - @WrapWithCondition(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/ingame/StatusEffectsDisplay;drawStatusEffects(Lnet/minecraft/client/gui/DrawContext;IIF)V")) - private boolean conditionalRenderStatuses(StatusEffectsDisplay instance, DrawContext context, int mouseX, int mouseY, float tickDelta) { - return shouldHideStatusEffectHud() || !Fixes.TConfig.INSTANCE.getHidePotionEffects(); + @Inject(method = "drawStatusEffects", at = @At("HEAD"), cancellable = true) + private void conditionalRenderStatuses(DrawContext context, int mouseX, int mouseY, CallbackInfo ci) { + if (shouldHideStatusEffectHud() || !Fixes.TConfig.INSTANCE.getHidePotionEffects()) { + ci.cancel(); + } } } diff --git a/src/main/java/moe/nea/firmament/mixins/MixinHandledScreen.java b/src/main/java/moe/nea/firmament/mixins/MixinHandledScreen.java index 43aec40..a5fec35 100644 --- a/src/main/java/moe/nea/firmament/mixins/MixinHandledScreen.java +++ b/src/main/java/moe/nea/firmament/mixins/MixinHandledScreen.java @@ -62,12 +62,12 @@ public abstract class MixinHandledScreen { } } - @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/ingame/HandledScreen;drawForeground(Lnet/minecraft/client/gui/DrawContext;II)V", shift = At.Shift.AFTER)) + @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/ingame/HandledScreen;renderMain(Lnet/minecraft/client/gui/DrawContext;IIF)V", shift = At.Shift.AFTER)) public void onAfterRenderForeground(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) { - context.getMatrices().push(); - context.getMatrices().translate(-x, -y, 0); + context.getMatrices().pushMatrix(); + context.getMatrices().translate(-x, -y); HandledScreenForegroundEvent.Companion.publish(new HandledScreenForegroundEvent((HandledScreen) (Object) this, context, mouseX, mouseY, delta)); - context.getMatrices().pop(); + context.getMatrices().popMatrix(); } @Inject(method = "onMouseClick(Lnet/minecraft/screen/slot/Slot;IILnet/minecraft/screen/slot/SlotActionType;)V", at = @At("HEAD"), cancellable = true) diff --git a/src/main/java/moe/nea/firmament/mixins/PlayerDropEventPatch.java b/src/main/java/moe/nea/firmament/mixins/PlayerDropEventPatch.java index f07604e..86f6806 100644 --- a/src/main/java/moe/nea/firmament/mixins/PlayerDropEventPatch.java +++ b/src/main/java/moe/nea/firmament/mixins/PlayerDropEventPatch.java @@ -15,7 +15,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(ClientPlayerEntity.class) public abstract class PlayerDropEventPatch extends PlayerEntity { public PlayerDropEventPatch() { - super(null, null, 0, null); + super(null, null); } @Inject(method = "dropSelectedItem", at = @At("HEAD"), cancellable = true) diff --git a/src/main/java/moe/nea/firmament/mixins/WorldRenderLastEventPatch.java b/src/main/java/moe/nea/firmament/mixins/WorldRenderLastEventPatch.java index 3ed8c1b..e268819 100644 --- a/src/main/java/moe/nea/firmament/mixins/WorldRenderLastEventPatch.java +++ b/src/main/java/moe/nea/firmament/mixins/WorldRenderLastEventPatch.java @@ -2,8 +2,10 @@ package moe.nea.firmament.mixins; +import com.mojang.blaze3d.buffers.GpuBufferSlice; import moe.nea.firmament.events.WorldRenderLastEvent; import net.minecraft.client.render.*; +import net.minecraft.client.render.fog.FogRenderer; import net.minecraft.client.util.Handle; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.profiler.Profiler; @@ -29,7 +31,7 @@ public abstract class WorldRenderLastEventPatch { protected abstract void checkEmpty(MatrixStack matrices); @Inject(method = "method_62214", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/profiler/Profiler;pop()V", shift = At.Shift.AFTER)) - public void onWorldRenderLast(Fog fog, RenderTickCounter renderTickCounter, Camera camera, Profiler profiler, Matrix4f matrix4f, Matrix4f matrix4f2, Handle handle, Handle handle2, boolean bl, Frustum frustum, Handle handle3, Handle handle4, CallbackInfo ci) { + public void onWorldRenderLast(GpuBufferSlice gpuBufferSlice, RenderTickCounter renderTickCounter, Camera camera, Profiler profiler, Matrix4f matrix4f, Handle handle, Handle handle2, boolean bl, Frustum frustum, Handle handle3, Handle handle4, CallbackInfo ci) { var imm = this.bufferBuilders.getEntityVertexConsumers(); var stack = new MatrixStack(); // TODO: pre-cancel this event if F1 is active diff --git a/src/main/java/moe/nea/firmament/mixins/feature/devcosmetics/CustomCapeFeatureRenderer.java b/src/main/java/moe/nea/firmament/mixins/feature/devcosmetics/CustomCapeFeatureRenderer.java index 5a92f89..e1bdd7e 100644 --- a/src/main/java/moe/nea/firmament/mixins/feature/devcosmetics/CustomCapeFeatureRenderer.java +++ b/src/main/java/moe/nea/firmament/mixins/feature/devcosmetics/CustomCapeFeatureRenderer.java @@ -29,7 +29,7 @@ public abstract class CustomCapeFeatureRenderer extends FeatureRenderer original, @Local PlayerEntityRenderState playerEntityRenderState, @Local SkinTextures skinTextures, @Local VertexConsumerProvider vertexConsumerProvider) { + private void onRender(BipedEntityModel instance, MatrixStack matrixStack, VertexConsumer vertexConsumer, int light, int overlay, Operation original, @Local(argsOnly = true) PlayerEntityRenderState playerEntityRenderState, @Local SkinTextures skinTextures, @Local VertexConsumerProvider vertexConsumerProvider) { CustomCapes.render( playerEntityRenderState, vertexConsumer, diff --git a/src/main/kotlin/features/chat/ChatLinks.kt b/src/main/kotlin/features/chat/ChatLinks.kt index 1fb12e1..28c526f 100644 --- a/src/main/kotlin/features/chat/ChatLinks.kt +++ b/src/main/kotlin/features/chat/ChatLinks.kt @@ -8,6 +8,7 @@ import java.net.URL import java.util.Collections import java.util.concurrent.atomic.AtomicInteger import moe.nea.jarvis.api.Point +import org.joml.Vector2i import kotlinx.coroutines.Deferred import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.async @@ -27,6 +28,7 @@ import moe.nea.firmament.events.ModifyChatEvent import moe.nea.firmament.events.ScreenRenderPostEvent import moe.nea.firmament.features.FirmamentFeature import moe.nea.firmament.gui.config.ManagedConfig +import moe.nea.firmament.jarvis.JarvisIntegration import moe.nea.firmament.util.MC import moe.nea.firmament.util.render.drawTexture import moe.nea.firmament.util.transformEachRecursively @@ -42,7 +44,7 @@ object ChatLinks : FirmamentFeature { val allowAllHosts by toggle("allow-all-hosts") { false } val allowedHosts by string("allowed-hosts") { "cdn.discordapp.com,media.discordapp.com,media.discordapp.net,i.imgur.com" } val actualAllowedHosts get() = allowedHosts.split(",").map { it.trim() } - val position by position("position", 16 * 20, 9 * 20) { Point(0.0, 0.0) } + val position by position("position", 16 * 20, 9 * 20) { Vector2i(0, 0) } } private fun isHostAllowed(host: String) = @@ -110,11 +112,11 @@ object ChatLinks : FirmamentFeature { val imageFuture = imageCache[url] ?: return if (!imageFuture.isCompleted) return val image = imageFuture.getCompleted() ?: return - it.drawContext.matrices.push() + it.drawContext.matrices.pushMatrix() val pos = TConfig.position - pos.applyTransformations(it.drawContext.matrices) + pos.applyTransformations(JarvisIntegration.jarvis, it.drawContext.matrices) val scale = min(1F, min((9 * 20F) / image.height, (16 * 20F) / image.width)) - it.drawContext.matrices.scale(scale, scale, 1F) + it.drawContext.matrices.scale(scale, scale) it.drawContext.drawTexture( image.texture, 0, @@ -126,7 +128,7 @@ object ChatLinks : FirmamentFeature { image.width, image.height, ) - it.drawContext.matrices.pop() + it.drawContext.matrices.popMatrix() } @Subscribe diff --git a/src/main/kotlin/features/debug/ExportedTestConstantMeta.kt b/src/main/kotlin/features/debug/ExportedTestConstantMeta.kt index f0250dc..bdc1f9a 100644 --- a/src/main/kotlin/features/debug/ExportedTestConstantMeta.kt +++ b/src/main/kotlin/features/debug/ExportedTestConstantMeta.kt @@ -12,7 +12,7 @@ data class ExportedTestConstantMeta( ) { companion object { val current = ExportedTestConstantMeta( - SharedConstants.getGameVersion().saveVersion.id, + SharedConstants.getGameVersion().dataVersion().id, Optional.of("Firmament ${Firmament.version.friendlyString}") ) diff --git a/src/main/kotlin/features/debug/itemeditor/LegacyItemData.kt b/src/main/kotlin/features/debug/itemeditor/LegacyItemData.kt index bc8c618..29a85d6 100644 --- a/src/main/kotlin/features/debug/itemeditor/LegacyItemData.kt +++ b/src/main/kotlin/features/debug/itemeditor/LegacyItemData.kt @@ -1,15 +1,13 @@ package moe.nea.firmament.features.debug.itemeditor import kotlinx.serialization.Serializable -import kotlin.jvm.optionals.getOrNull -import net.minecraft.item.ItemStack import net.minecraft.nbt.NbtCompound import net.minecraft.util.Identifier import moe.nea.firmament.Firmament import moe.nea.firmament.repo.ExpensiveItemCacheApi import moe.nea.firmament.repo.ItemCache -import moe.nea.firmament.util.MC import moe.nea.firmament.util.StringUtil.camelWords +import moe.nea.firmament.util.mc.loadItemFromNbt /** * Load data based on [prismarine.js' 1.8 item data](https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.8/items.json) @@ -68,8 +66,7 @@ object LegacyItemData { putByte("Count", 1) putShort("Damage", legacyItemType.metadata) })!! - val stack = ItemStack.fromNbt(MC.defaultRegistries, nbt).getOrNull() - ?: error("Could not transform ${legacyItemType}") + val stack = loadItemFromNbt(nbt) ?: error("Could not transform $legacyItemType") stack.item to legacyItemType } }.toMap() diff --git a/src/main/kotlin/features/debug/itemeditor/LegacyItemExporter.kt b/src/main/kotlin/features/debug/itemeditor/LegacyItemExporter.kt index ecf3d2c..f4f23b0 100644 --- a/src/main/kotlin/features/debug/itemeditor/LegacyItemExporter.kt +++ b/src/main/kotlin/features/debug/itemeditor/LegacyItemExporter.kt @@ -284,7 +284,7 @@ class LegacyItemExporter private constructor(var itemStack: ItemStack) { fun copyLegacySkullNbt() { val profile = itemStack.get(DataComponentTypes.PROFILE) ?: return legacyNbt.put("SkullOwner", NbtCompound().apply { - profile.id.ifPresent { + profile.uuid.ifPresent { putString("Id", it.toString()) } putBoolean("hypixelPopulated", true) diff --git a/src/main/kotlin/features/diana/AncestralSpadeSolver.kt b/src/main/kotlin/features/diana/AncestralSpadeSolver.kt index ff85c00..48004e8 100644 --- a/src/main/kotlin/features/diana/AncestralSpadeSolver.kt +++ b/src/main/kotlin/features/diana/AncestralSpadeSolver.kt @@ -106,13 +106,11 @@ object AncestralSpadeSolver : SubscriptionOwner { nextGuess?.let { tinyBlock(it, 1f, 0x80FFFFFF.toInt()) // TODO: replace this - color(1f, 1f, 0f, 1f) - tracer(it, lineWidth = 3f) + tracer(it, lineWidth = 3f, color = 0x80FFFFFF.toInt()) } if (particlePositions.size > 2 && lastDing.passedTime() < 10.seconds && nextGuess != null) { // TODO: replace this // TODO: add toggle - color(0f, 1f, 0f, 0.7f) - line(particlePositions) + line(particlePositions, color = 0x80FFFFFF.toInt()) } } } diff --git a/src/main/kotlin/features/events/anniversity/AnniversaryFeatures.kt b/src/main/kotlin/features/events/anniversity/AnniversaryFeatures.kt index 0cfaeba..0f0316a 100644 --- a/src/main/kotlin/features/events/anniversity/AnniversaryFeatures.kt +++ b/src/main/kotlin/features/events/anniversity/AnniversaryFeatures.kt @@ -4,6 +4,7 @@ package moe.nea.firmament.features.events.anniversity import io.github.notenoughupdates.moulconfig.observer.ObservableList import io.github.notenoughupdates.moulconfig.xml.Bind import moe.nea.jarvis.api.Point +import org.joml.Vector2i import kotlin.time.Duration.Companion.seconds import net.minecraft.entity.passive.PigEntity import net.minecraft.util.math.BlockPos @@ -31,7 +32,7 @@ object AnniversaryFeatures : FirmamentFeature { object TConfig : ManagedConfig(identifier, Category.EVENTS) { val enableShinyPigTracker by toggle("shiny-pigs") {true} - val trackPigCooldown by position("pig-hud", 200, 300) { Point(0.1, 0.2) } + val trackPigCooldown by position("pig-hud", 200, 300) { Vector2i(100, 200) } } override val config: ManagedConfig? diff --git a/src/main/kotlin/features/fixes/Fixes.kt b/src/main/kotlin/features/fixes/Fixes.kt index d490cc4..8870285 100644 --- a/src/main/kotlin/features/fixes/Fixes.kt +++ b/src/main/kotlin/features/fixes/Fixes.kt @@ -1,6 +1,7 @@ package moe.nea.firmament.features.fixes import moe.nea.jarvis.api.Point +import org.joml.Vector2i import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable import net.minecraft.client.MinecraftClient import net.minecraft.client.option.KeyBinding @@ -22,7 +23,7 @@ object Fixes : FirmamentFeature { var autoSprint by toggle("auto-sprint") { false } val autoSprintKeyBinding by keyBindingWithDefaultUnbound("auto-sprint-keybinding") val autoSprintUnderWater by toggle("auto-sprint-underwater") { true } - val autoSprintHud by position("auto-sprint-hud", 80, 10) { Point(0.0, 1.0) } + val autoSprintHud by position("auto-sprint-hud", 80, 10) { Vector2i() } val peekChat by keyBindingWithDefaultUnbound("peek-chat") val hidePotionEffects by toggle("hide-mob-effects") { false } val hidePotionEffectsHud by toggle("hide-potion-effects-hud") { false } @@ -49,7 +50,7 @@ object Fixes : FirmamentFeature { @Subscribe fun onRenderHud(it: HudRenderEvent) { if (!TConfig.autoSprintKeyBinding.isBound) return - it.context.matrices.push() + it.context.matrices.pushMatrix() TConfig.autoSprintHud.applyTransformations(it.context.matrices) it.context.drawText( MC.font, ( @@ -65,7 +66,7 @@ object Fixes : FirmamentFeature { } ), 0, 0, -1, true ) - it.context.matrices.pop() + it.context.matrices.popMatrix() } @Subscribe diff --git a/src/main/kotlin/features/inventory/ItemRarityCosmetics.kt b/src/main/kotlin/features/inventory/ItemRarityCosmetics.kt index fdc378a..9dae118 100644 --- a/src/main/kotlin/features/inventory/ItemRarityCosmetics.kt +++ b/src/main/kotlin/features/inventory/ItemRarityCosmetics.kt @@ -1,6 +1,7 @@ package moe.nea.firmament.features.inventory import java.awt.Color +import net.minecraft.client.gl.RenderPipelines import net.minecraft.client.gui.DrawContext import net.minecraft.client.render.RenderLayer import net.minecraft.item.ItemStack @@ -38,7 +39,7 @@ object ItemRarityCosmetics : FirmamentFeature { val rarity = Rarity.fromItem(item) ?: return val rgb = rarityToColor[rarity] ?: 0xFF00FF80.toInt() drawContext.drawGuiTexture( - RenderLayer::getGuiTextured, + RenderPipelines.GUI_TEXTURED, Identifier.of("firmament:item_rarity_background"), x, y, 16, 16, diff --git a/src/main/kotlin/features/inventory/PetFeatures.kt b/src/main/kotlin/features/inventory/PetFeatures.kt index 9393b03..701d30c 100644 --- a/src/main/kotlin/features/inventory/PetFeatures.kt +++ b/src/main/kotlin/features/inventory/PetFeatures.kt @@ -1,6 +1,6 @@ package moe.nea.firmament.features.inventory -import moe.nea.jarvis.api.Point +import org.joml.Vector2i import net.minecraft.item.ItemStack import net.minecraft.text.Text import net.minecraft.util.Formatting @@ -10,6 +10,7 @@ import moe.nea.firmament.events.HudRenderEvent import moe.nea.firmament.events.SlotRenderEvents import moe.nea.firmament.features.FirmamentFeature import moe.nea.firmament.gui.config.ManagedConfig +import moe.nea.firmament.jarvis.JarvisIntegration import moe.nea.firmament.util.FirmFormatters.formatPercent import moe.nea.firmament.util.FirmFormatters.shortFormat import moe.nea.firmament.util.MC @@ -31,7 +32,9 @@ object PetFeatures : FirmamentFeature { object TConfig : ManagedConfig(identifier, Category.INVENTORY) { val highlightEquippedPet by toggle("highlight-pet") { true } var petOverlay by toggle("pet-overlay") { false } - val petOverlayHud by position("pet-overlay-hud", 80, 10) { Point(0.5, 1.0) } + val petOverlayHud by position("pet-overlay-hud", 80, 10) { + Vector2i() + } } val petMenuTitle = "Pets(?: \\([0-9]+/[0-9]+\\))?".toPattern() @@ -43,12 +46,12 @@ object PetFeatures : FirmamentFeature { val stack = event.slot.stack if (stack.petData?.active == true) petMenuTitle.useMatch(MC.screenName ?: return) { - petItemStack = stack - event.context.drawGuiTexture( - Firmament.identifier("selected_pet_background"), - event.slot.x, event.slot.y, 16, 16, - ) - } + petItemStack = stack + event.context.drawGuiTexture( + Firmament.identifier("selected_pet_background"), + event.slot.x, event.slot.y, 16, 16, + ) + } } @Subscribe @@ -62,25 +65,48 @@ object PetFeatures : FirmamentFeature { val petType = titleCase(petData.type) val heldItem = petData.heldItem?.let { item -> "Held Item: ${titleCase(item)}" } - it.context.matrices.push() - TConfig.petOverlayHud.applyTransformations(it.context.matrices) + it.context.matrices.pushMatrix() + TConfig.petOverlayHud.applyTransformations(JarvisIntegration.jarvis, it.context.matrices) val lines = mutableListOf() - it.context.matrices.push() - it.context.matrices.translate(-0.5, -0.5, 0.0) - it.context.matrices.scale(2f, 2f, 1f) + it.context.matrices.pushMatrix() + it.context.matrices.translate(-0.5F, -0.5F) + it.context.matrices.scale(2f, 2f) it.context.drawItem(itemStack, 0, 0) - it.context.matrices.pop() + it.context.matrices.popMatrix() lines.add(Text.literal("[Lvl ${xp.currentLevel}] ").append(Text.literal(petType).withColor(rarityCode))) if (heldItem != null) lines.add(Text.literal(heldItem)) - if (xp.currentLevel != xp.maxLevel) lines.add(Text.literal("Required L${xp.currentLevel + 1}: ${shortFormat(xp.expInCurrentLevel.toDouble())}/${shortFormat(xp.expRequiredForNextLevel.toDouble())} (${formatPercent(xp.percentageToNextLevel.toDouble())})")) - lines.add(Text.literal("Required L100: ${shortFormat(xp.expTotal.toDouble())}/${shortFormat(xp.expRequiredForMaxLevel.toDouble())} (${formatPercent(xp.percentageToMaxLevel.toDouble())})")) + if (xp.currentLevel != xp.maxLevel) lines.add( + Text.literal( + "Required L${xp.currentLevel + 1}: ${shortFormat(xp.expInCurrentLevel.toDouble())}/${ + shortFormat( + xp.expRequiredForNextLevel.toDouble() + ) + } (${formatPercent(xp.percentageToNextLevel.toDouble())})" + ) + ) + lines.add( + Text.literal( + "Required L100: ${shortFormat(xp.expTotal.toDouble())}/${shortFormat(xp.expRequiredForMaxLevel.toDouble())} (${ + formatPercent( + xp.percentageToMaxLevel.toDouble() + ) + })" + ) + ) for ((index, line) in lines.withIndex()) { - it.context.drawText(MC.font, line.copy().withColor(Formatting.GRAY), 36, MC.font.fontHeight * index, -1, true) + it.context.drawText( + MC.font, + line.copy().withColor(Formatting.GRAY), + 36, + MC.font.fontHeight * index, + -1, + true + ) } - it.context.matrices.pop() + it.context.matrices.popMatrix() } } diff --git a/src/main/kotlin/features/inventory/REIDependencyWarner.kt b/src/main/kotlin/features/inventory/REIDependencyWarner.kt index 476759a..6bf2928 100644 --- a/src/main/kotlin/features/inventory/REIDependencyWarner.kt +++ b/src/main/kotlin/features/inventory/REIDependencyWarner.kt @@ -31,7 +31,7 @@ object REIDependencyWarner { var sentWarning = false fun modrinthLink(slug: String) = - "https://modrinth.com/mod/$slug/versions?g=${SharedConstants.getGameVersion().name}&l=fabric" + "https://modrinth.com/mod/$slug/versions?g=${SharedConstants.getGameVersion().name()}&l=fabric" fun downloadButton(modName: String, modId: String, slug: String): Text { val alreadyDownloaded = FabricLoader.getInstance().isModLoaded(modId) diff --git a/src/main/kotlin/features/inventory/SlotLocking.kt b/src/main/kotlin/features/inventory/SlotLocking.kt index 0a3f01b..f413ef5 100644 --- a/src/main/kotlin/features/inventory/SlotLocking.kt +++ b/src/main/kotlin/features/inventory/SlotLocking.kt @@ -2,6 +2,7 @@ package moe.nea.firmament.features.inventory +import com.mojang.blaze3d.pipeline.RenderPipeline import java.util.UUID import org.lwjgl.glfw.GLFW import kotlinx.serialization.KSerializer @@ -16,6 +17,7 @@ import kotlinx.serialization.json.JsonObject import kotlinx.serialization.json.JsonPrimitive import kotlinx.serialization.json.int import kotlinx.serialization.serializer +import net.minecraft.client.gl.RenderPipelines import net.minecraft.client.gui.screen.ingame.HandledScreen import net.minecraft.client.render.RenderLayer import net.minecraft.entity.player.PlayerInventory @@ -484,7 +486,7 @@ object SlotLocking : FirmamentFeature { val isUUIDLocked = (it.slot.stack?.skyblockUUID) in (lockedUUIDs ?: setOf()) if (isSlotLocked || isUUIDLocked) { it.context.drawGuiTexture( - RenderLayer::getGuiTexturedOverlay, + RenderPipelines.GUI_TEXTURED, when { isSlotLocked -> (Identifier.of("firmament:slot_locked")) diff --git a/src/main/kotlin/features/inventory/buttons/InventoryButtonEditor.kt b/src/main/kotlin/features/inventory/buttons/InventoryButtonEditor.kt index eecbd17..1e4f6a3 100644 --- a/src/main/kotlin/features/inventory/buttons/InventoryButtonEditor.kt +++ b/src/main/kotlin/features/inventory/buttons/InventoryButtonEditor.kt @@ -122,7 +122,9 @@ class InventoryButtonEditor( ButtonWidget.builder(Text.translatable("firmament.inventory-buttons.simple-preset")) { // Preset from NEU // Credit: https://github.com/NotEnoughUpdates/NotEnoughUpdates/blob/9b1fcfebc646e9fb69f99006327faa3e734e5f51/src/main/resources/assets/notenoughupdates/invbuttons/presets.json#L900-L1348 - val newButtons = InventoryButtonTemplates.loadTemplate("TkVVQlVUVE9OUy9bIntcblx0XCJ4XCI6IDE2MCxcblx0XCJ5XCI6IC0yMCxcblx0XCJhbmNob3JSaWdodFwiOiBmYWxzZSxcblx0XCJhbmNob3JCb3R0b21cIjogZmFsc2UsXG5cdFwiaWNvblwiOiBcImJvbmVcIixcblx0XCJjb21tYW5kXCI6IFwicGV0c1wiXG59Iiwie1xuXHRcInhcIjogMTQwLFxuXHRcInlcIjogLTIwLFxuXHRcImFuY2hvclJpZ2h0XCI6IGZhbHNlLFxuXHRcImFuY2hvckJvdHRvbVwiOiBmYWxzZSxcblx0XCJpY29uXCI6IFwiYXJtb3Jfc3RhbmRcIixcblx0XCJjb21tYW5kXCI6IFwid2FyZHJvYmVcIlxufSIsIntcblx0XCJ4XCI6IDEyMCxcblx0XCJ5XCI6IC0yMCxcblx0XCJhbmNob3JSaWdodFwiOiBmYWxzZSxcblx0XCJhbmNob3JCb3R0b21cIjogZmFsc2UsXG5cdFwiaWNvblwiOiBcImVuZGVyX2NoZXN0XCIsXG5cdFwiY29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blx0XCJhbmNob3JSaWdodFwiOiBmYWxzZSxcblx0XCJhbmNob3JCb3R0b21cIjogZmFsc2UsXG5cdFwiaWNvblwiOiBcImVuZGVyX2NoZXN0XCIsXG5cdFwiY29tbWFuZFwiOiBcInN0b3JhZ2VcIlxufSIsIntcblx0XCJ4XCI6IDEwMCxcblx0XCJ5XCI6IC0yMCxcblx0XCJhbmNob3JSaWdodFwiOiBmYWxzZSxcblx0XCJhbmNob3JCb3R0b21cIjogZmFsc2UsXG5cdFwiaWNvblwiOiBcInNrdWxsOmQ3Y2M2Njg3NDIzZDA1NzBkNTU2YWM1M2UwNjc2Y2I1NjNiYmRkOTcxN2NkODI2OWJkZWJlZDZmNmQ0ZTdiZjhcIixcblx0XCJjb21tYW5kXCI6IFwid2FycCBpc2xhbmRcIlxufSIsIntcblx0XCJ4XCI6IDgwLFxuXHRcInlcIjogLTIwLFxuXHRcImFuY2hvclJpZ2h0XCI6IGZhbHNlLFxuXHRcImFuY2hvckJvdHRvbVwiOiBmYWxzZSxcblx0XCJpY29uXCI6IFwic2t1bGw6MzVmNGI0MGNlZjllMDE3Y2Q0MTEyZDI2YjYyNTU3ZjhjMWQ1YjE4OWRhMmU5OTUzNDIyMmJjOGNlYzdkOTE5NlwiLFxuXHRcImNvbW1hbmRcIjogXCJ3YXJwIGh1YlwiXG59Il0=" + ) if (newButtons != null) buttons = moveButtons(newButtons.map { it.copy(command = it.command?.removePrefix("/")) }) } @@ -134,7 +136,9 @@ class InventoryButtonEditor( ButtonWidget.builder(Text.translatable("firmament.inventory-buttons.all-warps-preset")) { // Preset from NEU // Credit: https://github.com/NotEnoughUpdates/NotEnoughUpdates/blob/9b1fcfebc646e9fb69f99006327faa3e734e5f51/src/main/resources/assets/notenoughupdates/invbuttons/presets.json#L1817-L2276 - val newButtons = InventoryButtonTemplates.loadTemplate("TkVVQlVUVE9OUy9bIntcblx0XCJ4XCI6IDIsXG5cdFwieVwiOiAtODQsXG5cdFwiYW5jaG9yUmlnaHRcI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CJcbn0iLCJ7XG5cdFwieFwiOiAxNTEsXG5cdFwieVwiOiAyLFxuXHRcImFuY2hvclJpZ2h0XCI6IGZhbHNlLFxuXHRcImFuY2hvckJvdHRvbVwiOiB0cnVlLFxuXHRcImljb25cIjogXCJza3VsbDpjMzY4N2UyNWM2MzJiY2U4YWE2MWUwZDY0YzI0ZTY5NGMzZWVhNjI5ZWE5NDRmNGNmMzBkY2ZiNGZiY2UwNzFcIixcblx0XCJjb21tYW5kXCI6IFwid2FycCBuZXRoZXJcIlxufSJd" + ) if (newButtons != null) buttons = moveButtons(newButtons.map { it.copy(command = it.command?.removePrefix("/")) }) } @@ -188,31 +192,24 @@ class InventoryButtonEditor( return newButtons } - override fun renderBackground(context: DrawContext, mouseX: Int, mouseY: Int, delta: Float) { - context.matrices.push() - context.matrices.translate(0F, 0F, -15F) - super.renderBackground(context, mouseX, mouseY, delta) - context.matrices.pop() - } - override fun render(context: DrawContext, mouseX: Int, mouseY: Int, delta: Float) { super.render(context, mouseX, mouseY, delta) - context.matri