diff options
author | nea <nea@nea.moe> | 2023-06-08 00:11:46 +0200 |
---|---|---|
committer | nea <nea@nea.moe> | 2023-06-08 00:11:46 +0200 |
commit | f98a1f5d53792c026c3688fa89dea3e69910cb3a (patch) | |
tree | 873ee14abe51b1d229149c62f4958252026505fa | |
parent | b65382a7b74836e13d8d9c9104971737288d1496 (diff) | |
download | Firmament-f98a1f5d53792c026c3688fa89dea3e69910cb3a.tar.gz Firmament-f98a1f5d53792c026c3688fa89dea3e69910cb3a.tar.bz2 Firmament-f98a1f5d53792c026c3688fa89dea3e69910cb3a.zip |
Update to 1.20
- Remove some devenv mods that are not updated yet
- Replace lib39 with fletchingtable for automixins
- Use non kotlin entrypoints
- Make use of DrawContext in a bunch of places
-rw-r--r-- | build.gradle.kts | 5 | ||||
-rw-r--r-- | gradle/libs.versions.toml | 31 | ||||
-rw-r--r-- | src/main/java/moe/nea/firmament/init/MixinPlugin.java | 38 | ||||
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/MixinHandledScreen.java | 17 | ||||
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/MixinWorldRenderer.java | 2 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/Firmament.kt | 25 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/events/SlotRenderEvents.kt | 8 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/features/inventory/SlotLocking.kt | 5 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/gui/WBar.kt | 15 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/gui/profileviewer/PetsPage.kt | 8 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/hud/RepoDownloadProgress.kt | 11 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/rei/NEUItemEntryRenderer.kt | 12 | ||||
-rw-r--r-- | src/main/resources/fabric.mod.json | 14 | ||||
-rw-r--r-- | src/main/resources/firmament.mixins.json | 2 |
14 files changed, 106 insertions, 87 deletions
diff --git a/build.gradle.kts b/build.gradle.kts index 276d26c..04cbbcb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,6 +10,7 @@ plugins { id("com.github.johnrengelman.shadow") version "7.1.2" id("moe.nea.licenseextractificator") id("io.github.juuxel.loom-quiltflower") version "1.10.0" + id("io.shcm.shsupercm.fabric.fletchingtable") version "1.5" } java { @@ -88,8 +89,6 @@ dependencies { modImplementation(libs.fabric.kotlin) modImplementation(libs.modmenu) modImplementation(libs.libgui) - modImplementation(libs.lib39.core) - include(libs.lib39.core) include(libs.libgui) modApi(libs.fabric.api) modApi(libs.architectury) @@ -197,3 +196,5 @@ tasks.create("printAllLicenses", LicenseDiscoveryTask::class.java, licensing).ap } licensing.addExtraLicenseMatchers() + +fletchingTable.defaultMixinEnvironment.set("client") diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3354484..9de3e9b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,22 +1,21 @@ [versions] -minecraft = "1.19.4" +minecraft = "1.20" fabric_loader = "0.14.21" -fabric_api = "0.83.0+1.19.4" +fabric_api = "0.83.0+1.20" fabric_kotlin = "1.9.4+kotlin.1.8.21" -yarn = "1.19.4+build.2" -libgui = "7.1.0+1.19.4" -rei = "11.0.597" +yarn = "1.20+build.1" +libgui = "8.0.0-beta.1+1.20-rc1" # TODO: Update +rei = "12.0.613" # TODO: Update devauth = "1.0.0" -modmenu = "6.2.1" +modmenu = "7.0.0" ktor = "2.3.0" dbus_java = "4.2.1" -architectury = "8.1.79" +architectury = "9.0.5" # TODO: Update neurepoparser = "1.3.1" -qolify = "1.2.2-1.19.4" -citresewn = "1.1.3+1.19.4" -lib39 = "1.4.2" +qolify = "1.2.2-1.19.4" # TODO: Update +citresewn = "1.1.3+1.19.4" # TODO: Update hotswap_agent = "1.4.2-SNAPSHOT" -ncr = "Fabric-1.19.4-v2.1.1" +ncr = "Fabric-1.19.4-v2.1.1" # TODO: Update [libraries] minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" } @@ -29,7 +28,6 @@ repoparser = { module = "moe.nea:neurepoparser", version.ref = "neurepoparser" } dbus_java_core = { module = "com.github.hypfvieh:dbus-java-core", version.ref = "dbus_java" } dbus_java_unixsocket = { module = "com.github.hypfvieh:dbus-java-transport-native-unixsocket", version.ref = "dbus_java" } libgui = { module = "io.github.cottonmc:LibGui", version.ref = "libgui" } -lib39_core = { module = "com.unascribed:lib39-core", version.ref = "lib39" } # Runtime: hotswap = { module = "virtual.github.hotswapagent:hotswap-agent", version.ref = "hotswap_agent" } @@ -44,7 +42,12 @@ ncr = { module = "maven.modrinth:no-chat-reports", version.ref = "ncr" } [bundles] dbus = ["dbus_java_core", "dbus_java_unixsocket"] runtime_required = ["architectury_fabric", "rei_fabric"] -runtime_optional = ["devauth", "qolify", "citresewn", "ncr"] - +runtime_optional = [ + "devauth", + # Add back once updated: + # "qolify", + # "citresewn", + # "ncr", +] diff --git a/src/main/java/moe/nea/firmament/init/MixinPlugin.java b/src/main/java/moe/nea/firmament/init/MixinPlugin.java index 79a1789..663c9d9 100644 --- a/src/main/java/moe/nea/firmament/init/MixinPlugin.java +++ b/src/main/java/moe/nea/firmament/init/MixinPlugin.java @@ -18,25 +18,49 @@ package moe.nea.firmament.init; -import com.unascribed.lib39.core.api.AutoMixin; +import org.objectweb.asm.tree.ClassNode; +import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; +import org.spongepowered.asm.mixin.extensibility.IMixinInfo; import java.util.List; +import java.util.Set; -// TODO: replace AutoMixin with KSP plugin? -public class MixinPlugin extends AutoMixin { +public class MixinPlugin implements IMixinConfigPlugin { + + @Override + public void onLoad(String mixinPackage) { + } + + @Override + public String getRefMapperConfig() { + return null; + } @Override public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { if (!Boolean.getBoolean("firmament.debug") && mixinClassName.contains("devenv.")) { return false; } - return super.shouldApplyMixin(targetClassName, mixinClassName); + return true; + } + + @Override + public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) { + } @Override public List<String> getMixins() { - var autoDiscoveredMixins = super.getMixins(); - autoDiscoveredMixins.removeIf(it -> !shouldApplyMixin(null, it)); - return autoDiscoveredMixins; + return null; + } + + @Override + public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { + + } + + @Override + public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { + } } diff --git a/src/main/java/moe/nea/firmament/mixins/MixinHandledScreen.java b/src/main/java/moe/nea/firmament/mixins/MixinHandledScreen.java index 23670b7..ac09569 100644 --- a/src/main/java/moe/nea/firmament/mixins/MixinHandledScreen.java +++ b/src/main/java/moe/nea/firmament/mixins/MixinHandledScreen.java @@ -21,6 +21,7 @@ package moe.nea.firmament.mixins; import moe.nea.firmament.events.HandledScreenKeyPressedEvent; import moe.nea.firmament.events.IsSlotProtectedEvent; import moe.nea.firmament.events.SlotRenderEvents; +import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.ingame.HandledScreen; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.screen.slot.Slot; @@ -50,19 +51,15 @@ public class MixinHandledScreen { } - @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/ingame/HandledScreen;drawSlot(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/screen/slot/Slot;)V", shift = At.Shift.AFTER), locals = LocalCapture.CAPTURE_FAILHARD) - public void onAfterDrawSlot( - MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci, - int i, int j, int k, Slot slot) { - SlotRenderEvents.After event = new SlotRenderEvents.After(matrices, slot, mouseX, mouseY, delta); + @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/ingame/HandledScreen;drawSlot(Lnet/minecraft/client/gui/DrawContext;Lnet/minecraft/screen/slot/Slot;)V", shift = At.Shift.AFTER), locals = LocalCapture.CAPTURE_FAILHARD) + public void onAfterDrawSlot(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci, int i, int j, int k, Slot slot) { + SlotRenderEvents.After event = new SlotRenderEvents.After(context, slot, mouseX, mouseY, delta); SlotRenderEvents.After.Companion.publish(event); } - @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/ingame/HandledScreen;drawSlot(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/screen/slot/Slot;)V", shift = At.Shift.BEFORE), locals = LocalCapture.CAPTURE_FAILHARD) - public void onBeforeDrawSlot( - MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci, - int i, int j, int k, Slot slot) { - SlotRenderEvents.Before event = new SlotRenderEvents.Before(matrices, slot, mouseX, mouseY, delta); + @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/ingame/HandledScreen;drawSlot(Lnet/minecraft/client/gui/DrawContext;Lnet/minecraft/screen/slot/Slot;)V", shift = At.Shift.BEFORE), locals = LocalCapture.CAPTURE_FAILHARD) + public void onBeforeDrawSlot(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci, int i, int j, int k, Slot slot) { + SlotRenderEvents.Before event = new SlotRenderEvents.Before(context, slot, mouseX, mouseY, delta); SlotRenderEvents.Before.Companion.publish(event); } } diff --git a/src/main/java/moe/nea/firmament/mixins/MixinWorldRenderer.java b/src/main/java/moe/nea/firmament/mixins/MixinWorldRenderer.java index 3d9d408..2aebd8e 100644 --- a/src/main/java/moe/nea/firmament/mixins/MixinWorldRenderer.java +++ b/src/main/java/moe/nea/firmament/mixins/MixinWorldRenderer.java @@ -32,7 +32,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(WorldRenderer.class) public class MixinWorldRenderer { - @Inject(method = "render", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;applyModelViewMatrix()V", shift = At.Shift.AFTER)) + @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/WorldRenderer;renderChunkDebugInfo(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;Lnet/minecraft/client/render/Camera;)V", shift = At.Shift.BEFORE)) public void onWorldRenderLast(MatrixStack matrices, float tickDelta, long limitTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightmapTextureManager lightmapTextureManager, Matrix4f positionMatrix, CallbackInfo ci) { var event = new WorldRenderLastEvent( matrices, tickDelta, renderBlockOutline, diff --git a/src/main/kotlin/moe/nea/firmament/Firmament.kt b/src/main/kotlin/moe/nea/firmament/Firmament.kt index 6132d3b..f130742 100644 --- a/src/main/kotlin/moe/nea/firmament/Firmament.kt +++ b/src/main/kotlin/moe/nea/firmament/Firmament.kt @@ -19,18 +19,15 @@ package moe.nea.firmament import com.mojang.brigadier.CommandDispatcher -import io.ktor.client.HttpClient -import io.ktor.client.plugins.UserAgent -import io.ktor.client.plugins.cache.HttpCache -import io.ktor.client.plugins.compression.ContentEncoding -import io.ktor.client.plugins.contentnegotiation.ContentNegotiation -import io.ktor.client.plugins.logging.LogLevel -import io.ktor.client.plugins.logging.Logging -import io.ktor.serialization.kotlinx.json.json +import io.ktor.client.* +import io.ktor.client.plugins.* +import io.ktor.client.plugins.cache.* +import io.ktor.client.plugins.compression.* +import io.ktor.client.plugins.contentnegotiation.* +import io.ktor.client.plugins.logging.* +import io.ktor.serialization.kotlinx.json.* import java.nio.file.Files import java.nio.file.Path -import net.fabricmc.api.ClientModInitializer -import net.fabricmc.api.ModInitializer import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents @@ -58,7 +55,7 @@ import moe.nea.firmament.repo.RepoManager import moe.nea.firmament.util.SBData import moe.nea.firmament.util.data.IDataHolder -object Firmament : ModInitializer, ClientModInitializer { +object Firmament { const val MOD_ID = "firmament" val DEBUG = System.getProperty("firmament.debug") == "true" @@ -110,10 +107,12 @@ object Firmament : ModInitializer, ClientModInitializer { registerFirmamentCommand(dispatcher) } - override fun onInitialize() { + @JvmStatic + fun onInitialize() { } - override fun onInitializeClient() { + @JvmStatic + fun onClientInitialize() { dbusConnection.requestBusName("moe.nea.firmament") dbusConnection.exportObject(FirmamentDbusObject) IDataHolder.registerEvents() diff --git a/src/main/kotlin/moe/nea/firmament/events/SlotRenderEvents.kt b/src/main/kotlin/moe/nea/firmament/events/SlotRenderEvents.kt index 695d9c2..c4b0a3d 100644 --- a/src/main/kotlin/moe/nea/firmament/events/SlotRenderEvents.kt +++ b/src/main/kotlin/moe/nea/firmament/events/SlotRenderEvents.kt @@ -18,18 +18,18 @@ package moe.nea.firmament.events -import net.minecraft.client.util.math.MatrixStack +import net.minecraft.client.gui.DrawContext import net.minecraft.screen.slot.Slot interface SlotRenderEvents { - val matrices: MatrixStack + val context: DrawContext val slot: Slot val mouseX: Int val mouseY: Int val delta: Float data class Before( - override val matrices: MatrixStack, override val slot: Slot, + override val context: DrawContext, override val slot: Slot, override val mouseX: Int, override val mouseY: Int, override val delta: Float @@ -39,7 +39,7 @@ interface SlotRenderEvents { } data class After( - override val matrices: MatrixStack, override val slot: Slot, + override val context: DrawContext, override val slot: Slot, override val mouseX: Int, override val mouseY: Int, override val delta: Float diff --git a/src/main/kotlin/moe/nea/firmament/features/inventory/SlotLocking.kt b/src/main/kotlin/moe/nea/firmament/features/inventory/SlotLocking.kt index 27761ce..eab0da0 100644 --- a/src/main/kotlin/moe/nea/firmament/features/inventory/SlotLocking.kt +++ b/src/main/kotlin/moe/nea/firmament/features/inventory/SlotLocking.kt @@ -20,7 +20,7 @@ package moe.nea.firmament.features.inventory import kotlinx.serialization.Serializable import kotlinx.serialization.serializer -import net.minecraft.client.gui.DrawableHelper +import net.minecraft.client.gui.DrawContext import net.minecraft.entity.player.PlayerInventory import moe.nea.firmament.events.HandledScreenKeyPressedEvent import moe.nea.firmament.events.IsSlotProtectedEvent @@ -72,8 +72,7 @@ object SlotLocking : FirmamentFeature { } SlotRenderEvents.Before.subscribe { if (it.slot.inventory is PlayerInventory && it.slot.index in (lockedSlots ?: setOf())) { - DrawableHelper.fill( - it.matrices, + it.context.fill( it.slot.x, it.slot.y, it.slot.x + 16, diff --git a/src/main/kotlin/moe/nea/firmament/gui/WBar.kt b/src/main/kotlin/moe/nea/firmament/gui/WBar.kt index 04c5e3d..ed812ec 100644 --- a/src/main/kotlin/moe/nea/firmament/gui/WBar.kt +++ b/src/main/kotlin/moe/nea/firmament/gui/WBar.kt @@ -5,6 +5,7 @@ import io.github.cottonmc.cotton.gui.client.ScreenDrawing import io.github.cottonmc.cotton.gui.widget.WWidget import io.github.cottonmc.cotton.gui.widget.data.Texture import me.shedaniel.math.Color +import net.minecraft.client.gui.DrawContext import net.minecraft.client.util.math.MatrixStack import moe.nea.firmament.Firmament @@ -27,7 +28,7 @@ open class WBar( } private fun drawSection( - matrices: MatrixStack, + context: DrawContext, texture: Texture, x: Int, y: Int, @@ -36,18 +37,18 @@ open class WBar( sectionEnd: Double ) { if (sectionEnd < progress && width == 4) { - ScreenDrawing.texturedRect(matrices, x, y, 4, 8, texture, fillColor.color) + ScreenDrawing.texturedRect(context, x, y, 4, 8, texture, fillColor.color) return } if (sectionStart > progress && width == 4) { - ScreenDrawing.texturedRect(matrices, x, y, 4, 8, texture, emptyColor.color) + ScreenDrawing.texturedRect(context, x, y, 4, 8, texture, emptyColor.color) return } val increasePerPixel = (sectionEnd - sectionStart / 4) var valueAtPixel = sectionStart for (i in (0 until width)) { ScreenDrawing.texturedRect( - matrices, x + i, y, 1, 8, + context, x + i, y, 1, 8, texture.image, texture.u1 + i / 64F, texture.v1, texture.u1 + (i + 1) / 64F, texture.v2, if (valueAtPixel < progress) fillColor.color else emptyColor.color ) @@ -55,11 +56,11 @@ open class WBar( } } - override fun paint(matrices: MatrixStack, x: Int, y: Int, mouseX: Int, mouseY: Int) { + override fun paint(context: DrawContext, x: Int, y: Int, mouseX: Int, mouseY: Int) { var i = 0 while (i < width - 4) { drawSection( - matrices, + context, if (i == 0) left else middle, x + i, y, (width - (i + 4)).coerceAtMost(4), @@ -67,7 +68,7 @@ open class WBar( ) i += 4 } - drawSection(matrices, right, x + width - 4, y, 4, (width - 4) * total / width, total) + drawSection(context, right, x + width - 4, y, 4, (width - 4) * total / width, total) RenderSystem.setShaderColor(1F, 1F, 1F, 1F) } } diff --git a/src/main/kotlin/moe/nea/firmament/gui/profileviewer/PetsPage.kt b/src/main/kotlin/moe/nea/firmament/gui/profileviewer/PetsPage.kt index 4c669df..62889bd 100644 --- a/src/main/kotlin/moe/nea/firmament/gui/profileviewer/PetsPage.kt +++ b/src/main/kotlin/moe/nea/firmament/gui/profileviewer/PetsPage.kt @@ -9,8 +9,8 @@ import io.github.cottonmc.cotton.gui.widget.WWidget import io.github.cottonmc.cotton.gui.widget.data.Insets import io.github.cottonmc.cotton.gui.widget.icon.Icon import io.github.cottonmc.cotton.gui.widget.icon.ItemIcon +import net.minecraft.client.gui.DrawContext import net.minecraft.client.item.TooltipContext -import net.minecraft.client.util.math.MatrixStack import net.minecraft.item.Items import net.minecraft.text.Text import moe.nea.firmament.gui.WTightScrollPanel @@ -27,9 +27,9 @@ object PetsPage : ProfilePage { for ((i, pet) in profileViewer.member.pets.withIndex()) { val stack = SBItemStack(pet.itemId, PetData(pet.tier, pet.type.name, pet.exp)).asItemStack() it.add(object : WItem(stack) { - override fun paint(matrices: MatrixStack?, x: Int, y: Int, mouseX: Int, mouseY: Int) { - BackgroundPainter.SLOT.paintBackground(matrices, x, y, this) - super.paint(matrices, x, y, mouseX, mouseY) + override fun paint(context: DrawContext?, x: Int, y: Int, mouseX: Int, mouseY: Int) { + BackgroundPainter.SLOT.paintBackground(context, x, y, this) + super.paint(context, x, y, mouseX, mouseY) } override fun addTooltip(tooltip: TooltipBuilder) { diff --git a/src/main/kotlin/moe/nea/firmament/hud/RepoDownloadProgress.kt b/src/main/kotlin/moe/nea/firmament/hud/RepoDownloadProgress.kt index 69e0384..827835a 100644 --- a/src/main/kotlin/moe/nea/firmament/hud/RepoDownloadProgress.kt +++ b/src/main/kotlin/moe/nea/firmament/hud/RepoDownloadProgress.kt @@ -25,6 +25,7 @@ import io.github.cottonmc.cotton.gui.widget.data.Insets import net.minecraft.client.util.math.MatrixStack import kotlin.math.roundToInt import kotlin.math.sin +import net.minecraft.client.gui.DrawContext val Insets.vertical get() = bottom + top @@ -49,8 +50,8 @@ class ProgressBar( } - override fun paint(matrices: MatrixStack, x: Int, y: Int, mouseX: Int, mouseY: Int) { - ScreenDrawing.coloredRect(matrices, x, y, width, height, 0xFF808080.toInt()) + override fun paint(context: DrawContext, x: Int, y: Int, mouseX: Int, mouseY: Int) { + ScreenDrawing.coloredRect(context, x, y, width, height, 0xFF808080.toInt()) val (l, prog) = synchronized(this) { label to (progress to total) } @@ -58,7 +59,7 @@ class ProgressBar( if (t == null) { ScreenDrawing.coloredRect( - matrices, + context, (x + (1 + sin(System.currentTimeMillis().toDouble() / 1000)) * width * 3 / 4 / 2).roundToInt(), y, width / 4, @@ -66,10 +67,10 @@ class ProgressBar( 0xFF00FF00.toInt() ) } else { - ScreenDrawing.coloredRect(matrices, x, y, width * p / t, height, 0xFF00FF00.toInt()) + ScreenDrawing.coloredRect(context, x, y, width * p / t, height, 0xFF00FF00.toInt()) } ScreenDrawing.drawString( - matrices, + context, if (t != null) "$l ($p/$t)" else l, HorizontalAlignment.CENTER, x + insets.left, diff --git a/src/main/kotlin/moe/nea/firmament/rei/NEUItemEntryRenderer.kt b/src/main/kotlin/moe/nea/firmament/rei/NEUItemEntryRenderer.kt index 32186be..deaaeb9 100644 --- a/src/main/kotlin/moe/nea/firmament/rei/NEUItemEntryRenderer.kt +++ b/src/main/kotlin/moe/nea/firmament/rei/NEUItemEntryRenderer.kt @@ -23,22 +23,22 @@ import me.shedaniel.rei.api.client.entry.renderer.EntryRenderer import me.shedaniel.rei.api.client.gui.widgets.Tooltip import me.shedaniel.rei.api.client.gui.widgets.TooltipContext import me.shedaniel.rei.api.common.entry.EntryStack -import net.minecraft.client.util.math.MatrixStack +import net.minecraft.client.gui.DrawContext import moe.nea.firmament.rei.FirmamentReiPlugin.Companion.asItemEntry object NEUItemEntryRenderer : EntryRenderer<SBItemStack> { override fun render( entry: EntryStack<SBItemStack>, - matrices: MatrixStack, + context: DrawContext, bounds: Rectangle, mouseX: Int, mouseY: Int, delta: Float ) { - matrices.push() - matrices.translate(0F, 0F, 100F) - entry.asItemEntry().render(matrices, bounds, mouseX, mouseY, delta) - matrices.pop() + context.matrices.push() + context.matrices.translate(0F, 0F, 100F) + entry.asItemEntry().render(context, bounds, mouseX, mouseY, delta) + context.matrices.pop() } override fun getTooltip(entry: EntryStack<SBItemStack>, tooltipContext: TooltipContext): Tooltip? { diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 063bda7..c227e49 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -20,17 +20,11 @@ "icon": "assets/firmament/icon.png", "environment": "client", "entrypoints": { - "main": [ - { - "adapter": "kotlin", - "value": "moe.nea.firmament.Firmament" - } - ], + "main": [ + "moe.nea.firmament.Firmament::onInitialize" + ], "client": [ - { - "adapter": "kotlin", - "value": "moe.nea.firmament.Firmament" - } + "moe.nea.firmament.Firmament::onClientInitialize" ], "rei_client": [ "moe.nea.firmament.rei.FirmamentReiPlugin" diff --git a/src/main/resources/firmament.mixins.json b/src/main/resources/firmament.mixins.json index 43f3601..599c8ea 100644 --- a/src/main/resources/firmament.mixins.json +++ b/src/main/resources/firmament.mixins.json @@ -2,7 +2,7 @@ "required": true, "plugin": "moe.nea.firmament.init.MixinPlugin", "package": "moe.nea.firmament.mixins", - "compatibilityLevel": "JAVA_16", + "compatibilityLevel": "JAVA_17", "injectors": { "defaultRequire": 1 } |