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
13 changes: 13 additions & 0 deletions bootstrap/ornithe.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
plugins {
id("net.fabricmc.fabric-loom-remap")
id("ploceus")
id("oneconfig-bootstrap")
}

ploceus {
setIntermediaryGeneration(2)
}

dependencies {
mappings(ploceus.featherMappings(versionedCatalog.versions["feather.build"].requiredVersion))
}
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ allprojects {
repositories {
mavenCentral()
maven("https://maven.fabricmc.net/releases")
maven("https://maven.ornithemc.net/releases")
}
}

Expand Down
3 changes: 3 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ repositories {
mavenCentral()
gradlePluginPortal()
maven("https://maven.fabricmc.net/")
maven("https://maven.ornithemc.net/releases")
maven("https://repo.polyfrost.org/releases")
maven("https://maven.modmuss50.me/releases")
}
Expand All @@ -29,6 +30,8 @@ dependencies {
implementation(plugin(fabric.plugins.loom))
implementation(plugin(fabric.plugins.loom.remap))

implementation(plugin(ornithe.plugins.ploceus))

implementation(plugin(neoforge.plugins.moddev))

implementation("dev.kikugie.stonecutter:dev.kikugie.stonecutter.gradle.plugin:0.9")
Expand Down
3 changes: 3 additions & 0 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ dependencyResolutionManagement {
create("neoforge") {
from(files("../gradle/neoforge.versions.toml"))
}
create("ornithe") {
from(files("../gradle/ornithe.versions.toml"))
}
}
}

Expand Down
33 changes: 26 additions & 7 deletions buildSrc/src/main/kotlin/oneconfig-bootstrap.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ repositories {
maven("https://repo.hypixel.net/repository/Hypixel/") {
content { includeGroupAndSubgroups("net.hypixel") }
}
maven("https://maven.axolotlclient.com/releases") {
content { includeGroup("io.github.moehreag.hypixel") }
}
maven("https://maven.deftu.dev/releases") {
content { includeGroupAndSubgroups("dev.deftu") }
}
Expand Down Expand Up @@ -46,19 +49,19 @@ group = "${rootProject.group}.bootstrap"
version = rootProject.version

val node = project.name
val isOrnithe = node.endsWith("-ornithe")
val platformPath = ":minecraft:$node"

dependencies {
"minecraft"("com.mojang:minecraft:${versionedCatalog.versions["minecraft"]}")
}

evaluationDependsOn(platformPath)

afterEvaluate {
gradle.projectsEvaluated {
val platform = rootProject.project(platformPath)

fun isExcluded(group: String?, name: String) =
(group == "net.fabricmc" && (name == "fabric-loader")) || group == "net.fabricmc.fabric-api"
(group == "net.fabricmc" && (name == "fabric-loader")) || group == "net.fabricmc.fabric-api" ||
(isOrnithe && ((group == "io.github.moehreag" && name == "legacy-lwjgl3") || group == "net.ornithemc.osl-gen2"))

val seen = HashSet<String>()

Expand Down Expand Up @@ -129,8 +132,10 @@ afterEvaluate {

val hypixelFabricMod = if (versionedCatalog.versions["minecraft"].requiredVersion.startsWith("26")) {
"maven.modrinth:hypixel-mod-api:1.0.2+build.1+mc26.1"
} else {
} else if (versionedCatalog.versions["minecraft"].requiredVersion.startsWith("1.21")) {
"maven.modrinth:hypixel-mod-api:1.0.1+build.1+mc1.21"
} else {
"org.polyfrost:mod-api-fabric:1.0.2+build.1+mc1.8.9"
}
(dependencies.add("include", hypixelFabricMod) as ExternalModuleDependency).isTransitive = false
}
Expand Down Expand Up @@ -183,6 +188,15 @@ tasks.matching { it.name == "publishModrinth" }.configureEach {
dependsOn(validateChangelog)
}

if (!isOrnithe) {
tasks.publishMods.configure {
enabled = false
}
tasks.matching { it.name == "publishModrinth" }.configureEach {
enabled = false
}
}

publishMods {
file = tasks.named<AbstractArchiveTask>(publishJarTaskName).flatMap { it.archiveFile }

Expand All @@ -191,7 +205,7 @@ publishMods {
changelog = changelogs
type = STABLE

modLoaders.add("fabric")
modLoaders.add(if (isOrnithe) "ornithe" else "fabric")

dryRun = modrinthId == null || modrinthToken == null

Expand All @@ -202,7 +216,12 @@ publishMods {

minecraftVersions.addAll(minecraftVersion)

requires("fabric-api")
if (isOrnithe) {
requires("osl")
requires("moehreag-legacy-lwjgl3")
} else {
requires("fabric-api")
}
requires("fabric-language-kotlin")
findProperty("publish.modrinth.compose-bundle")
?.toString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,7 @@ publishMods {
projectId = modrinthId
accessToken = modrinthToken.orEmpty()

minecraftVersions.addAll(listOf(
"1.21.1",
"1.21.4",
"1.21.5",
"1.21.8",
"1.21.10",
"1.21.11",
"26.1",
"26.1.1",
"26.1.2",
"26.2-rc-2"
))
minecraftVersions.add("1.8.9")

requires("fabric-language-kotlin")
}
Expand Down
25 changes: 21 additions & 4 deletions buildSrc/src/main/kotlin/oneconfig-setup.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ fun DependencyHandlerScope.handleApiDep(
this.handleApiDep(project.provider { dependency }, isMod, transitive)
}

if (loader != "fabric") {
if (loader == "neoforge") {
configurations {
val localRuntime = create("localRuntime")
named("runtimeClasspath") { this.extendsFrom(localRuntime) }
Expand Down Expand Up @@ -236,7 +236,7 @@ dependencies {
handleApiDep(versionedCatalog.bundles["nightconfig"])
handleApiDep(versionedCatalog["snakeyaml"])
handleApiDep(versionedCatalog["java-objc-bridge"])
val hypixelModApiVersion = if (stonecutter.eval(stonecutter.current.version, ">= 26.1")) "1.0.2" else "1.0.1"
val hypixelModApiVersion = if (stonecutter.eval(stonecutter.current.version, ">= 26.1") || loader == "ornithe") "1.0.2" else "1.0.1"
handleApiDep("net.hypixel:mod-api:$hypixelModApiVersion")
handleApiDep(versionedCatalog["hypixel-data"])

Expand All @@ -252,6 +252,8 @@ dependencies {
} else {
"modImplementation"(hypixelFabricMod) { isTransitive = false }
}
} else if (loader == "ornithe") {
"modLocalRuntime"("org.polyfrost:mod-api-fabric:1.0.2+build.1+mc1.8.9") { isTransitive = false }
}

handleApiDep(versionedCatalog["mixin-squared"])
Expand All @@ -278,7 +280,7 @@ dependencies {

val libsCatalog = rootProject.extensions.getByType<VersionCatalogsExtension>().named("libs")
when (loader) {
"fabric" -> "modRuntimeOnly"(libsCatalog.findLibrary("devauth-fabric").get())
"fabric", "ornithe" -> "modRuntimeOnly"(libsCatalog.findLibrary("devauth-fabric").get())
"neoforge" -> "runtimeOnly"(libsCatalog.findLibrary("devauth-neoforge").get())
}

Expand Down Expand Up @@ -378,6 +380,15 @@ afterEvaluate {
}
}

if (loader != "ornithe") {
tasks.withType<PublishToMavenRepository>().configureEach {
enabled = false
}
tasks.withType<PublishToMavenLocal>().configureEach {
enabled = false
}
}

tasks.withType<ProcessResources>() {
val range = if (versionedCatalog.versions.has("minecraft.range")) {
versionedCatalog.versions.get("minecraft.range").toString()
Expand All @@ -395,9 +406,15 @@ tasks.withType<ProcessResources>() {

this.inputs.properties(fabricProperties)

this.filesMatching("fabric.mod.json") {
this.filesMatching(if (loader == "ornithe") "ornithe.mod.json" else "fabric.mod.json") {
expand(fabricProperties)
}
if (loader == "ornithe") {
exclude("fabric.mod.json")
eachFile { if (path == "ornithe.mod.json") path = "fabric.mod.json" }
} else {
exclude("ornithe.mod.json")
}

val mixinCompat = if (stonecutter.eval(stonecutter.current.version, ">= 26.1")) "JAVA_25" else "JAVA_21"
this.inputs.property("mixin_compat", mixinCompat)
Expand Down
2 changes: 2 additions & 0 deletions gradle/common/1.8.9.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[versions]
minecraft = "1.8.9"
12 changes: 12 additions & 0 deletions gradle/ornithe.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[versions]
loader = "0.19.3"
osl = "0.21.0-alpha.34"
feather_build = "1"
ploceus = "1.17.4"

[libraries]
fabric-loader = { module = "net.fabricmc:fabric-loader", version.ref = "loader" }
fabric-loader-junit = { module = "net.fabricmc:fabric-loader-junit", version.ref = "loader" }

[plugins]
ploceus = { id = "ploceus", version.ref = "ploceus" }
5 changes: 5 additions & 0 deletions gradle/ornithe/1.8.9.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[versions]
legacy-lwjgl3 = "1.4.4"

[libraries]
legacy-lwjgl3 = { module = "io.github.moehreag:legacy-lwjgl3", version.ref = "legacy-lwjgl3" }
43 changes: 43 additions & 0 deletions mappings/feather-overrides.tiny
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
tiny 2 0 intermediary named
c net/minecraft/unmapped/C_49122968 net/minecraft/text/Formatting
m ()Ljava/lang/String; m_85650466 serialize
c net/minecraft/unmapped/C_05113611 net/minecraft/unmapped/C_05113611
m ()Z m_33616981 isSameThread
c net/minecraft/unmapped/C_70668269 net/minecraft/unmapped/C_70668269
m ()Z m_33616981 isSameThread
c net/minecraft/client/Minecraft net/minecraft/client/Minecraft
f Lnet/minecraft/unmapped/C_24654288; f_81460813 hitResult
f Lnet/minecraft/unmapped/C_34399650; f_26407825 level
m (Lnet/minecraft/unmapped/C_85740840;)V m_52715402 setScreen
m ()Z m_33616981 isSameThread
m (Z)V m_77225877 continueAttack
m ()I m_53086118 getFramerateLimit
m ()Lnet/minecraft/unmapped/C_06196994; m_17688331 getMainRenderTarget
m ()V m_61857590 startUseItem
c net/minecraft/unmapped/C_23708450 net/minecraft/client/KeyMapping
m ()Z m_70603120 isDown
c net/minecraft/unmapped/C_76792751 net/minecraft/client/Options
f [Lnet/minecraft/unmapped/C_23708450; f_41636781 keyMappings
f Lnet/minecraft/unmapped/C_23708450; f_34423269 keyPlayerList
c net/minecraft/unmapped/C_85740840 net/minecraft/client/gui/screen/Screen
m ()Z m_94022149 isPauseScreen
c net/minecraft/unmapped/C_67960412 net/minecraft/client/gui/screens/LevelLoadingScreen
c net/minecraft/unmapped/C_36550219 net/minecraft/client/gui/screens/options/controls/KeyBindsList
c net/minecraft/unmapped/C_36550219$C_66337664 net/minecraft/client/gui/screens/options/controls/KeyBindsList$KeyEntry
c net/minecraft/unmapped/C_67645866 net/minecraft/client/gui/screens/options/controls/KeyBindsScreen
f Lnet/minecraft/unmapped/C_23708450; f_46607866 selectedKey
c net/minecraft/unmapped/C_34399650 net/minecraft/client/multiplayer/ClientLevel
c net/minecraft/unmapped/C_57778754 net/minecraft/client/player/LocalPlayer
c net/minecraft/unmapped/C_30593188 net/minecraft/world/scores/Objective
c net/minecraft/unmapped/C_97595263 net/minecraft/world/scores/PlayerTeam
c net/minecraft/unmapped/C_73166169 net/minecraft/world/scores/Scoreboard
m (Lnet/minecraft/unmapped/C_97595263;)V m_18544454 removePlayerTeam
c net/minecraft/server/MinecraftServer net/minecraft/server/MinecraftServer
m ()Z m_33616981 isSameThread
c net/minecraft/unmapped/C_82920792 net/minecraft/client/render/texture/TextureManager
m (Lnet/minecraft/unmapped/C_22168528;)Lnet/minecraft/unmapped/C_65241354; m_17123242 getTexture
c net/minecraft/unmapped/C_95503740 net/minecraft/client/sound/system/SoundManager
m (Lnet/minecraft/unmapped/C_28706180;F)V m_88002341 updateSourceVolume
m (Lnet/minecraft/unmapped/C_53396390;)Z m_92956382 isActive
c net/minecraft/unmapped/C_98888256 net/minecraft/item/Item
m ()Ljava/lang/String; m_27822537 getDescriptionId
49 changes: 49 additions & 0 deletions minecraft/ornithe.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
plugins {
id("net.fabricmc.fabric-loom-remap")
id("ploceus")
`oneconfig-fabric`
}

repositories {
exclusiveContent {
forRepository { mavenCentral() }
filter { includeGroup("org.lwjgl") }
}

maven("https://maven.axolotlclient.com/releases") {
content {
includeGroup("io.github.moehreag")
includeGroup("io.github.moehreag.legacy-lwjgl3")
includeGroup("io.github.moehreag.hypixel")
}
}
}

ploceus {
setIntermediaryGeneration(2)
}

loom {
accessWidenerPath.set(rootProject.file("minecraft/src/main/resources/oneconfigv1.classtweaker"))
}

dependencies {
modImplementation(versionedCatalog["fabric-language-kotlin"])
modImplementation(versionedCatalog["fabric-loader"])

mappings(loom.layered {
mappings(ploceus.featherMappings(versionedCatalog.versions["feather.build"].requiredVersion))
mappings(rootProject.file("mappings/feather-overrides.tiny"))
})
ploceus.dependOsl(versionedCatalog.versions["osl"].requiredVersion)

configurations.configureEach {
exclude(group = "org.lwjgl.lwjgl")
}

modApi(versionedCatalog["legacy-lwjgl3"]) {
exclude(group = "net.ornithemc.osl-gen2")
}

api("com.mojang:brigadier:1.0.18")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.mojang.blaze3d.platform;

//? if = 1.8.9 {
/*import io.github.moehreag.legacylwjgl3.util.IMEManager;

public final class TextInputManager {
private static final TextInputManager INSTANCE = new TextInputManager();

public static TextInputManager getInstance() {
return INSTANCE;
}

public void startTextInput() {
IMEManager.getInstance().startTextInput();
}

public void stopTextInput() {
IMEManager.getInstance().stopTextInput();
}
}
*///?}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ public final class HypixelApiInternalsImpl implements HypixelApiInternals {
public HypixelApiInternalsImpl() {
LOGGER.info("Registering Hypixel API hello/disconnect handlers");
HypixelModAPI.getInstance().createHandler(ClientboundHelloPacket.class, p -> onHypixel = true);
//? if > 1.8.9 {
ClientPlayConnectionEvents.DISCONNECT.register((handler, client) -> onHypixel = false);
//?} else
//ClientConnectionEvents.DISCONNECT.register(context -> onHypixel = false);
}

@Override
Expand Down
Loading
Loading