Depend on fabric-rendering-v1 (+ fabric-api-base) and handle hud rendering on fabric too

This commit is contained in:
Username404-59 2021-04-28 12:30:59 +02:00
parent bd0ac48e11
commit eb95454313
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
4 changed files with 19 additions and 3 deletions

View File

@ -14,8 +14,9 @@ architectury { platformSetupLoomIde(); fabric() }
dependencies {
modImplementation("${Groups.Fabric}:fabric-loader:${rootProject.property("fabric_loader_version")}")
modApi("${Groups.FabricApi}:fabric-resource-loader-v0:${rootProject.property("fabric_resource_loader_version")}")
include("${Groups.FabricApi}:fabric-resource-loader-v0:${rootProject.property("fabric_resource_loader_version")}") { isTransitive = false }
include(modApi("${Groups.FabricApi}:fabric-rendering-v1:${rootProject.property("fabric_rendering_api_version")}")!!)
include(modRuntime("${Groups.FabricApi}:fabric-resource-loader-v0:${rootProject.property("fabric_resource_loader_version")}")!!)
include(modRuntime("${Groups.FabricApi}:fabric-api-base:${rootProject.property("fabric_api_base_version")}")!!)
modRuntime(modCompileOnly("com.terraformersmc:modmenu:${rootProject.property("modmenu_version")}") {
exclude(group = Groups.FabricApi, module = "fabric-resource-loader-v0")
})

View File

@ -1,8 +1,20 @@
package fr.username404.snowygui.fabric
import com.mojang.blaze3d.vertex.PoseStack
import fr.username404.snowygui.EventSnowy
import fr.username404.snowygui.Snowy
import net.fabricmc.api.ClientModInitializer
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback.EVENT
class FabricInit: Snowy(), ClientModInitializer {
override fun onInitializeClient() = atInit()
override fun onInitializeClient() {
atInit()
EVENT.register(
object: HudRenderCallback, EventSnowy {
override val type: String = "HudRender"
override fun onHudRender(matrixStack: PoseStack?, tickDelta: Float) = fire(matrixStack)
}
)
}
}

View File

@ -30,6 +30,7 @@
"depends": {
"fabricloader": ">=0.9.3",
"fabric-resource-loader-v0": "*",
"fabric-rendering-v1": "*",
"minecraft": ">=${minecraft_version}"
},
"breaks": {

View File

@ -11,4 +11,6 @@ minecraft=1.16.5
forge_version=36.1.4
fabric_loader_version=0.11.3
fabric_resource_loader_version=0.2.5+059ea8667c
fabric_rendering_api_version=1.1.2+346247d77c
fabric_api_base_version=0.1.3+12a8474c7c
modmenu_version=1.16.9