Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: Port to 1.20.2-rc2 Fabric #58

Merged
merged 3 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ jobs:
# BuildSharedServiceManager) will not release any memory until all scheduled remapJar tasks have complete.
run: |
./gradlew clean --stacktrace
./gradlew :{1.{8.9,12.2}-forge,1.{19,19.1}-fabric,1.{16.2,17.1,18.1}-{forge,fabric}}:jar --stacktrace
./gradlew :{1.20-fabric,1.{19.2,19.3,19.4,20.1}-{forge,fabric}}:jar --stacktrace
./gradlew jar --stacktrace
./gradlew :{1.{8.9,12.2}-forge,1.{19,19.1}-fabric,1.{16.2,17.1,18.1}-{forge,fabric}}:build --stacktrace
./gradlew :{1.20-fabric,1.{19.2,19.3,19.4,20.1}-{forge,fabric}}:build --stacktrace
./gradlew build --stacktrace

- name: Publish
Expand Down
107 changes: 56 additions & 51 deletions api/UniversalCraft.api

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions root.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ plugins {
version = versionFromBuildIdAndBranch()

preprocess {
val fabric12002 = createNode("1.20.2-fabric", 12002, "yarn")
val forge12001 = createNode("1.20.1-forge", 12001, "srg")
val fabric12001 = createNode("1.20.1-fabric", 12001, "yarn")
val fabric12000 = createNode("1.20-fabric", 12000, "yarn")
Expand All @@ -29,6 +30,7 @@ preprocess {
val forge11202 = createNode("1.12.2-forge", 11202, "srg")
val forge10809 = createNode("1.8.9-forge", 10809, "srg")

fabric12002.link(fabric12001)
forge12001.link(fabric12001)
fabric12001.link(fabric12000)
fabric12000.link(fabric11904)
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ listOf(
"1.20-fabric",
"1.20.1-fabric",
"1.20.1-forge",
"1.20.2-fabric",
).forEach { version ->
include(":$version")
project(":$version").apply {
Expand Down
26 changes: 24 additions & 2 deletions src/main/kotlin/gg/essential/universal/UScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ abstract class UScreen(
//$$ private var lastDraggedDy = -1.0
//$$ private var lastScrolledX = -1.0
//$$ private var lastScrolledY = -1.0
//$$ private var lastScrolledDX = 0.0
//$$
//$$ final override fun init() {
//$$ updateGuiScale()
Expand Down Expand Up @@ -124,7 +125,12 @@ abstract class UScreen(
//$$ return false
//$$ }
//$$
//#if MC>=12002
//$$ override fun mouseScrolled(mouseX: Double, mouseY: Double, horizontalAmount: Double, delta: Double): Boolean {
//$$ lastScrolledDX = horizontalAmount
//#else
//$$ final override fun mouseScrolled(mouseX: Double, mouseY: Double, delta: Double): Boolean {
//#endif
//$$ lastScrolledX = mouseX
//$$ lastScrolledY = mouseY
//$$ onMouseScrolled(delta)
Expand All @@ -140,7 +146,17 @@ abstract class UScreen(
//$$ }
//$$
//#if MC>=12000
//#if MC>=12002
//$$ private var lastBackgroundMouseX = 0
//$$ private var lastBackgroundMouseY = 0
//$$ private var lastBackgroundDelta = 0f
//$$ final override fun renderBackground(context: DrawContext, mouseX: Int, mouseY: Int, delta: Float) {
//$$ lastBackgroundMouseX = mouseX
//$$ lastBackgroundMouseY = mouseY
//$$ lastBackgroundDelta = delta
//#else
//$$ final override fun renderBackground(context: DrawContext) {
//#endif
//$$ drawContexts.add(context)
//$$ onDrawBackgroundCompat(UMatrixStack(context.matrices), 0)
//$$ drawContexts.removeLast()
Expand Down Expand Up @@ -321,7 +337,9 @@ abstract class UScreen(
}

open fun onMouseScrolled(delta: Double) {
//#if MC>=11502
//#if MC>=12002
//$$ super.mouseScrolled(lastScrolledX, lastScrolledY, lastScrolledDX, delta)
//#elseif MC>=11502
//$$ super.mouseScrolled(lastScrolledX, lastScrolledY, delta)
//#endif
}
Expand All @@ -345,7 +363,11 @@ abstract class UScreen(
open fun onDrawBackground(matrixStack: UMatrixStack, tint: Int) {
//#if MC>=12000
//$$ withDrawContext(matrixStack) { drawContext ->
//$$ super.renderBackground(drawContext)
//#if MC>=12002
//$$ super.renderBackground(drawContext, lastBackgroundMouseX, lastBackgroundMouseY, lastBackgroundDelta)
//#else
//$$ super.renderBackground(drawContext)
//#endif
//$$ }
//#elseif MC>=11904
//$$ super.renderBackground(matrixStack.toMC())
Expand Down
4 changes: 4 additions & 0 deletions src/main/kotlin/gg/essential/universal/wrappers/UPlayer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ object UPlayer {

@JvmStatic
fun getUUID(): UUID {
//#if MC>=12002
//$$ return UMinecraft.getMinecraft().session.uuidOrNull!!
//#else
return UMinecraft.getMinecraft().session.profile.id
//#endif
}

@JvmStatic
Expand Down
3 changes: 3 additions & 0 deletions versions/1.20.2-fabric/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
essential.defaults.loom.minecraft=com.mojang:minecraft:1.20.2-rc2
essential.defaults.loom.mappings=net.fabricmc:yarn:1.20.2-rc2+build.1:v2
essential.defaults.loom.fabric-loader=net.fabricmc:fabric-loader:0.14.22