Skip to content
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
17 changes: 17 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ plugins {
id("dev.deftu.gradle.tools.minecraft.releases-v2")
}

loom.enableModProvidedJavadoc.set(false)
kotlin.explicitApi()
toolkitLoomApi.setupTestClient()
toolkitMultiversion.moveBuildsToRootProject.set(true)
Expand Down Expand Up @@ -132,3 +133,19 @@ dependencies {
}
}
}

listOf("modRuntimeOnly", "modCompileOnly", "modImplementation").forEach { cfg ->
configurations.named(cfg).configure {
exclude("org.jetbrains.kotlin", "kotlin-stdlib")
exclude("org.jetbrains.kotlin", "kotlin-stdlib-jdk7")
exclude("org.jetbrains.kotlin", "kotlin-stdlib-jdk8")
exclude("org.jetbrains.kotlinx", "kotlinx-coroutines-core")
exclude("org.jetbrains.kotlinx", "kotlinx-coroutines-core-jvm")
exclude("org.jetbrains.kotlinx", "kotlinx-serialization-core")
exclude("org.jetbrains.kotlinx", "kotlinx-serialization-core-jvm")
exclude("org.jetbrains.kotlinx", "kotlinx-serialization-json")
exclude("org.jetbrains.kotlinx", "kotlinx-serialization-json-jvm")

exclude("org.jetbrains", "annotations")
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ org.gradle.configureondemand=true
org.gradle.parallel.threads=8

loom.ignoreDependencyLoomVersionValidation=true
dgt.minecraft.revision=3
dgt.minecraft.revision=4
dgt.loom.mappings=official-like

# Mod properties
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
textile = "1.0.0-beta.9"
textile = "1.0.0-beta.11"
enhancedeventbus = "2.0.0"
brigadier = "1.0.18"
dfu = "4.0.26"
Expand Down
86 changes: 45 additions & 41 deletions root.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,51 @@ plugins {
preprocess {
strictExtraMappings.set(true)

"1.21.10-neoforge"(1_21_10, "srg") {
"1.21.10-fabric"(1_21_10, "srg") {
"1.21.9-fabric"(1_21_09, "srg") {
"1.21.9-neoforge"(1_21_09, "srg") {
"1.21.8-neoforge"(1_21_08, "srg", file("versions/mappings/1.21.9-neoforge+1.21.8-neoforge.txt")) {
"1.21.8-fabric"(1_21_08, "srg") {
"1.21.7-fabric"(1_21_07, "srg") {
"1.21.7-neoforge"(1_21_07, "srg") {
"1.21.6-neoforge"(1_21_06, "srg") {
"1.21.6-fabric"(1_21_06, "srg") {
"1.21.5-fabric"(1_21_05, "srg", file("versions/mappings/1.21.6-fabric+1.21.5-fabric.txt")) {
"1.21.5-neoforge"(1_21_05, "srg") {
"1.21.4-neoforge"(1_21_04, "srg", file("versions/mappings/1.21.5-neoforge+1.21.4-neoforge.txt")) {
"1.21.4-fabric"(1_21_04, "srg") {
"1.21.3-fabric"(1_21_04, "srg") {
"1.21.3-neoforge"(1_21_03, "srg") {
"1.21.2-neoforge"(1_21_02, "srg") {
"1.21.2-fabric"(1_21_02, "srg") {
"1.21.1-fabric"(1_21_01, "srg", file("versions/mappings/1.21.2-fabric+1.21.1-fabric.txt")) {
"1.21.1-neoforge"(1_21_01, "srg") {
"1.20.6-neoforge"(1_20_06, "srg", file("versions/mappings/1.21.1-neoforge+1.20.6-neoforge.txt")) {
"1.20.6-fabric"(1_20_06, "srg") {
"1.20.4-fabric"(1_20_04, "srg") {
"1.20.4-neoforge"(1_20_04, "srg") {
"1.20.4-forge"(1_20_04, "srg", file("versions/mappings/1.20.4-neoforge+1.20.4-forge.txt")) {
"1.20.1-forge"(1_20_01, "srg", file("versions/mappings/1.20.4-forge+1.20.1-forge.txt")) {
"1.20.1-fabric"(1_20_01, "srg") {
"1.19.4-fabric"(1_19_04, "srg") {
"1.19.4-forge"(1_19_04, "srg") {
"1.19.2-forge"(1_19_02, "srg", file("versions/mappings/1.19.4-forge+1.19.2-forge.txt")) {
"1.19.2-fabric"(1_19_02, "srg") {
"1.18.2-fabric"(1_18_02, "srg", file("versions/mappings/1.19.2-fabric+1.18.2-fabric.txt")) {
"1.18.2-forge"(1_18_02, "srg") {
"1.17.1-forge"(1_17_01, "srg") {
"1.17.1-fabric"(1_17_01, "srg") {
"1.16.5-fabric"(1_16_05, "srg") {
"1.16.5-forge"(1_16_05, "srg") {
"1.12.2-forge"(1_12_02, "srg", file("versions/mappings/1.16.5-forge+1.12.2-forge.txt")) {
"1.12.2-fabric"(1_12_02, "srg") {
"1.8.9-fabric"(1_08_09, "srg") {
"1.8.9-forge"(1_08_09, "srg")
"1.21.11-fabric"(1_21_11, "srg") {
"1.21.11-neoforge"(1_21_11, "srg") {
"1.21.10-neoforge"(1_21_10, "srg") {
"1.21.10-fabric"(1_21_10, "srg") {
"1.21.9-fabric"(1_21_09, "srg") {
"1.21.9-neoforge"(1_21_09, "srg") {
"1.21.8-neoforge"(1_21_08, "srg", file("versions/mappings/1.21.9-neoforge+1.21.8-neoforge.txt")) {
"1.21.8-fabric"(1_21_08, "srg") {
"1.21.7-fabric"(1_21_07, "srg") {
"1.21.7-neoforge"(1_21_07, "srg") {
"1.21.6-neoforge"(1_21_06, "srg") {
"1.21.6-fabric"(1_21_06, "srg") {
"1.21.5-fabric"(1_21_05, "srg", file("versions/mappings/1.21.6-fabric+1.21.5-fabric.txt")) {
"1.21.5-neoforge"(1_21_05, "srg") {
"1.21.4-neoforge"(1_21_04, "srg", file("versions/mappings/1.21.5-neoforge+1.21.4-neoforge.txt")) {
"1.21.4-fabric"(1_21_04, "srg") {
"1.21.3-fabric"(1_21_04, "srg") {
"1.21.3-neoforge"(1_21_03, "srg") {
"1.21.2-neoforge"(1_21_02, "srg") {
"1.21.2-fabric"(1_21_02, "srg") {
"1.21.1-fabric"(1_21_01, "srg", file("versions/mappings/1.21.2-fabric+1.21.1-fabric.txt")) {
"1.21.1-neoforge"(1_21_01, "srg") {
"1.20.6-neoforge"(1_20_06, "srg", file("versions/mappings/1.21.1-neoforge+1.20.6-neoforge.txt")) {
"1.20.6-fabric"(1_20_06, "srg") {
"1.20.4-fabric"(1_20_04, "srg") {
"1.20.4-neoforge"(1_20_04, "srg") {
"1.20.4-forge"(1_20_04, "srg", file("versions/mappings/1.20.4-neoforge+1.20.4-forge.txt")) {
"1.20.1-forge"(1_20_01, "srg", file("versions/mappings/1.20.4-forge+1.20.1-forge.txt")) {
"1.20.1-fabric"(1_20_01, "srg") {
"1.19.4-fabric"(1_19_04, "srg") {
"1.19.4-forge"(1_19_04, "srg") {
"1.19.2-forge"(1_19_02, "srg", file("versions/mappings/1.19.4-forge+1.19.2-forge.txt")) {
"1.19.2-fabric"(1_19_02, "srg") {
"1.18.2-fabric"(1_18_02, "srg", file("versions/mappings/1.19.2-fabric+1.18.2-fabric.txt")) {
"1.18.2-forge"(1_18_02, "srg") {
"1.17.1-forge"(1_17_01, "srg") {
"1.17.1-fabric"(1_17_01, "srg") {
"1.16.5-fabric"(1_16_05, "srg") {
"1.16.5-forge"(1_16_05, "srg") {
"1.12.2-forge"(1_12_02, "srg", file("versions/mappings/1.16.5-forge+1.12.2-forge.txt")) {
"1.12.2-fabric"(1_12_02, "srg") {
"1.8.9-fabric"(1_08_09, "srg") {
"1.8.9-forge"(1_08_09, "srg")
}
}
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pluginManagement {

plugins {
kotlin("jvm") version("2.2.10")
id("dev.deftu.gradle.multiversion-root") version("2.64.0")
id("dev.deftu.gradle.multiversion-root") version("2.65.0")
}
}

Expand Down Expand Up @@ -92,6 +92,9 @@ listOf(

"1.21.10-neoforge",
"1.21.10-fabric",

"1.21.11-neoforge",
"1.21.11-fabric"
).forEach { version ->
include(":$version")
project(":$version").apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public object OmniClientChat {
playerHud?.apply {
clearTitles()
setTimes(timings.fadeIn, timings.stay, timings.fadeOut)
subtitle?.let(MCText::convert).let(this::setSubtitle)
subtitle?.let(MCText::convert)?.let(this::setSubtitle)
setTitle(MCText.convert(title))
}
//#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import dev.deftu.omnicore.api.client.client
import dev.deftu.omnicore.api.client.screen.currentScreen
import dev.deftu.omnicore.api.client.world
import net.minecraft.client.gui.screens.ConnectScreen
import net.minecraft.client.gui.screens.Screen
import net.minecraft.client.gui.screens.TitleScreen
import net.minecraft.client.gui.screens.multiplayer.JoinMultiplayerScreen

//#if MC >= 1.17.1
Expand Down Expand Up @@ -77,13 +79,14 @@ public val isMultiplayerBanned: Boolean
//#endif
}

public fun connectTo(entry: OmniServerInfo) {
@JvmOverloads
public fun connectTo(entry: OmniServerInfo, screen: Screen = defaultScreen()) {
val serverInfo = entry.toServerData()

//#if MC >= 1.17.1
val serverAddress = ServerAddress.parseString(entry.address)
ConnectScreen.startConnecting(
JoinMultiplayerScreen(currentScreen),
JoinMultiplayerScreen(screen),
client,
serverAddress,
serverInfo,
Expand All @@ -95,12 +98,16 @@ public fun connectTo(entry: OmniServerInfo) {
//#endif
)
//#else
//$$ currentScreen = ConnectScreen(JoinMultiplayerScreen(currentScreen), client, serverInfo)
//$$ currentScreen = ConnectScreen(JoinMultiplayerScreen(screen), client, serverInfo)
//#endif
}

@JvmOverloads
public fun connectTo(hostname: String, name: String = hostname, isLocal: Boolean = false) {
public fun connectTo(hostname: String, name: String = hostname, isLocal: Boolean = false, screen: Screen = defaultScreen()) {
val entry = OmniServerInfo(name, hostname, isLocal)
connectTo(entry)
connectTo(entry, screen)
}

private fun defaultScreen(): Screen {
return currentScreen ?: TitleScreen()
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ package dev.deftu.omnicore.api.client.options

import net.minecraft.sounds.SoundSource as VanillaSoundCategory

//#if MC >= 1.21.11
//$$ import net.minecraft.client.MusicToastDisplayState
//#endif

public object OmniSoundSettings {
public object Capabilities {
@JvmStatic
Expand Down Expand Up @@ -134,7 +138,9 @@ public object OmniSoundSettings {
@JvmStatic
public val isNowPlayingToastEnabled: Boolean
get() {
//#if MC >= 1.21.6
//#if MC >= 1.21.11
//$$ return unwrap(options.musicToast()) != MusicToastDisplayState.NEVER
//#elseif MC >= 1.21.6
return unwrap(options.showNowPlayingToast())
//#else
//$$ return false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ public object OmniVideoSettings {
@JvmStatic
public val renderMode: RenderMode
get() {
//#if MC >= 1.19.2
//#if MC >= 1.21.11
//$$ return RenderMode.from(unwrap(options.graphicsPreset()))
//#elseif MC >= 1.19.2
return RenderMode.from(unwrap(options.graphicsMode()))
//#elseif MC >= 1.16.5
//$$ return RenderMode.from(unwrap(options.graphicsMode))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public enum class RenderMode {
GraphicsStatus.FAST -> FAST
GraphicsStatus.FANCY -> FANCY
GraphicsStatus.FABULOUS -> FABULOUS
//#if MC >= 1.21.11
//$$ GraphicsPreset.CUSTOM -> FANCY // Default to FANCY for CUSTOM in newer versions
//#endif
}
}
//#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import net.minecraft.client.OptionInstance
internal inline val options: Options
get() = client.options

internal fun <T> unwrap(
internal fun <T : Any> unwrap(
//#if MC >= 1.19.2
option: OptionInstance<T>
//#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.mojang.blaze3d.vertex.VertexFormat

public enum class DrawMode {
LINES,
@Deprecated("No longer available as of Minecraft 1.21.11", replaceWith = ReplaceWith("LINES"))
LINE_STRIP,
TRIANGLES,
TRIANGLE_STRIP,
Expand All @@ -31,7 +32,9 @@ public enum class DrawMode {
get() {
return when (const) {
GL11.GL_LINES -> VertexFormat.Mode.LINES
//#if MC < 1.21.11
GL11.GL_LINE_STRIP -> VertexFormat.Mode.LINE_STRIP
//#endif
GL11.GL_TRIANGLES -> VertexFormat.Mode.TRIANGLES
GL11.GL_TRIANGLE_STRIP -> VertexFormat.Mode.TRIANGLE_STRIP
GL11.GL_TRIANGLE_FAN -> VertexFormat.Mode.TRIANGLE_FAN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ public object DrawModes {
public fun from(vanilla: VertexFormat.Mode): DrawMode {
return when (vanilla) {
VertexFormat.Mode.LINES -> DrawMode.LINES
//#if MC < 1.21.11
VertexFormat.Mode.LINE_STRIP -> DrawMode.LINE_STRIP
//#endif
VertexFormat.Mode.TRIANGLES -> DrawMode.TRIANGLES
VertexFormat.Mode.TRIANGLE_STRIP -> DrawMode.TRIANGLE_STRIP
VertexFormat.Mode.TRIANGLE_FAN -> DrawMode.TRIANGLE_FAN
Expand All @@ -49,7 +51,9 @@ public object DrawModes {
public fun vanilla(const: Int): VertexFormat.Mode {
return when (const) {
GL11.GL_LINES -> VertexFormat.Mode.LINES
//#if MC < 1.21.11
GL11.GL_LINE_STRIP -> VertexFormat.Mode.LINE_STRIP
//#endif
GL11.GL_TRIANGLES -> VertexFormat.Mode.TRIANGLES
GL11.GL_TRIANGLE_STRIP -> VertexFormat.Mode.TRIANGLE_STRIP
GL11.GL_TRIANGLE_FAN -> VertexFormat.Mode.TRIANGLE_FAN
Expand Down
Loading
Loading