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

[Neoforge] Create 1.21 Neoforge Version of oωo (owo-lib) #283

Draft
wants to merge 56 commits into
base: 1.21
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
cdbf7c5
Initial Commit
Dragon-Seeker Jun 30, 2024
1ae4013
Fix networking
Dragon-Seeker Jul 3, 2024
6ae2767
Re enable OwoFreezer
Dragon-Seeker Jul 3, 2024
d1cd598
[endec] fix "hilarious" typo which causes asymmetric serialization in…
gliscowo Jun 30, 2024
0012112
Add fun aw
Dragon-Seeker Jul 5, 2024
589cf91
Fix incorrect mod id within toml for dependencies
Dragon-Seeker Jul 5, 2024
3680fbe
Adjust archive name
Dragon-Seeker Jul 5, 2024
2999d35
Push fix for uwu config UI model
Dragon-Seeker Jul 5, 2024
9509a67
Use Latest endec version
Dragon-Seeker Jul 5, 2024
ddae897
Fix register event hook for item groups
Dragon-Seeker Jul 5, 2024
cd8c85e
Merge branch '1.21' into 1.21-Neo
Dragon-Seeker Jul 5, 2024
b5be637
Add AT from AW and remove converting AW file
Dragon-Seeker Jul 7, 2024
c13cb50
Adjust ItemGroup API for Suppliers
Dragon-Seeker Jul 7, 2024
c4964a3
i mald so hard
BasiqueEvangelist Jul 9, 2024
9dee815
Merge pull request #1 from BasiqueEvangelist/neo-remove-rich-translat…
Dragon-Seeker Jul 9, 2024
c8c99de
Adjust Item Group Behavior to be supplied based
Dragon-Seeker Jul 10, 2024
4bfb435
Update Arch loom to try and fix latest mixin issues with neo
Dragon-Seeker Jul 10, 2024
106136b
use newer ffapi and remove extras
BasiqueEvangelist Jul 21, 2024
d930e82
reset ReiUIAdapter to vanilla owo
BasiqueEvangelist Jul 21, 2024
bf18008
re-add uses of PacketByteBufs
BasiqueEvangelist Jul 21, 2024
a0c02dd
update some testmod code
BasiqueEvangelist Jul 21, 2024
f8aca8c
mfw indentation
BasiqueEvangelist Jul 21, 2024
fdb3a33
make more stuff conform to vanilla owo
BasiqueEvangelist Jul 21, 2024
f1a13c4
remove OwoModMenuPlugin
BasiqueEvangelist Jul 21, 2024
d5743ca
fix some weird code
BasiqueEvangelist Jul 21, 2024
7725cc7
fix item rendering? :thonk:
BasiqueEvangelist Jul 21, 2024
e83cb71
Merge pull request #2 from BasiqueEvangelist/1.21-Neo-modernization
Dragon-Seeker Jul 31, 2024
7977709
Merge branch '1.21' into 1.21-Neo
Dragon-Seeker Sep 9, 2024
860152a
Fix issues with missing interface injection and various item setting …
Dragon-Seeker Sep 9, 2024
6174e96
Fix issues with missing interface injection and various item setting …
Dragon-Seeker Sep 9, 2024
2ebe4ec
Fix incorrect registry add callback and fix issues with using wrong c…
Dragon-Seeker Sep 9, 2024
d87b740
Bump FFAPI and Neo version
Dragon-Seeker Sep 9, 2024
a7640b5
Merge branch '1.21-Neo' of https://github.com/Dragon-Seeker/owo-lib i…
Dragon-Seeker Sep 9, 2024
94afcc2
Fix various issues with port to neo
Dragon-Seeker Sep 10, 2024
aac272c
Merge branch '1.21' into 1.21-Neo
Dragon-Seeker Sep 17, 2024
f9b4db9
Fix import issues
Dragon-Seeker Sep 17, 2024
3b59acf
Cleanup gradle and various dev files combined with bumping version
Dragon-Seeker Sep 24, 2024
3a388e0
Fix setting up IConfigScreenFactory within main mod initializer inste…
Dragon-Seeker Sep 25, 2024
850173c
Bump Version 0.12.14-beta.2
Dragon-Seeker Sep 25, 2024
fe7a1bc
Update endec version due to issues with neo
Dragon-Seeker Sep 30, 2024
1da9de2
Bump version 0.12.14-beta.3
Dragon-Seeker Sep 30, 2024
0aa6690
Update AT to be in mojmap
Dragon-Seeker Oct 2, 2024
d2de308
Bump version 0.12.14-beta.4
Dragon-Seeker Oct 3, 2024
68a25c2
Merge branch '1.21' into 1.21-Neo
Dragon-Seeker Oct 3, 2024
30559f0
Update Dependency handling and require FFAPI instead of JIJ
Dragon-Seeker Oct 8, 2024
ff42a68
Merge branch '1.21' into 1.21-Neo
Dragon-Seeker Oct 8, 2024
e360c46
Adjust Dependency for FFAPI due to issues with other unused modules
Dragon-Seeker Oct 18, 2024
9a79886
Add provides field provide other alternative mod ids for owo
Dragon-Seeker Oct 20, 2024
15dacbf
Get AT fully working and publish both AT and Interface Injection file…
Dragon-Seeker Oct 20, 2024
85ca36d
Update code to use Accessor for addDrawableChild
Dragon-Seeker Oct 22, 2024
98ed024
Bump version 0.12.15-beta.5
Dragon-Seeker Oct 22, 2024
1decaa4
Add temp fix for concurrent modification issues with Neoforge networking
Dragon-Seeker Oct 23, 2024
69a4c54
Bump version 0.12.15-beta.5
Dragon-Seeker Oct 23, 2024
3cffcf7
Adjust publishing to use Neos moddev and pull in loom jars
Dragon-Seeker Oct 23, 2024
70eca53
Fix building issues
Dragon-Seeker Oct 24, 2024
6970c30
Bump beta 6
Dragon-Seeker Oct 24, 2024
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
88 changes: 59 additions & 29 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,32 +1,46 @@
//file:noinspection GradlePackageVersionRange
plugins {
id 'fabric-loom' version '1.6-SNAPSHOT'
id "dev.architectury.loom" version "1.7.410"
id 'maven-publish'
}

base {
archivesName = project.archives_base_name
}

allprojects {
if (project.name == "owo-neo-publish") return;

apply plugin: "java"
apply plugin: "fabric-loom"
apply plugin: "dev.architectury.loom"
apply plugin: "maven-publish"

def ENV = System.getenv()

version = "${project.mod_version}+${rootProject.minecraft_base_version}"
group = rootProject.maven_group

repositories {
maven { url 'https://maven.neoforged.net/releases/' }
}

dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
mappings "net.fabricmc:yarn:${rootProject.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${rootProject.loader_version}"
mappings loom.layered {
it.mappings("net.fabricmc:yarn:${rootProject.yarn_mappings}:v2")
it.mappings("dev.architectury:yarn-mappings-patch-neoforge:1.21+build.4")
}
//modImplementation "net.fabricmc:fabric-loader:${rootProject.loader_version}"

modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
neoForge "net.neoforged:neoforge:${project.neoforge_version}"
//modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
}

processResources {
inputs.property "version", project.version
filteringCharset "UTF-8"

filesMatching("fabric.mod.json") {
filesMatching("META-INF/neoforge.mods.toml") {
expand "version": project.version
}
}
Expand All @@ -49,9 +63,6 @@ allprojects {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
archivesBaseName = project.archives_base_name
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
}

Expand All @@ -62,12 +73,6 @@ allprojects {
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}

repositories {
maven {
url ENV.MAVEN_URL
Expand All @@ -90,7 +95,8 @@ repositories {
}
}
maven { url "https://maven.nucleoid.xyz/" }
maven { url 'https://maven.wispforest.io' }
maven { url 'https://maven.wispforest.io/releases' }
maven { url "https://maven.su5ed.dev/releases" }
mavenLocal()
}

Expand All @@ -107,38 +113,62 @@ loom {
client()
ideConfigGenerated project.rootProject == project
name = "Testmod Client"
mods {
create("uwu") {
sourceSet sourceSets.testmod
}
create("owo"){
sourceSet sourceSets.main
}
}
source sourceSets.testmod
}
testmodServer {
server()
ideConfigGenerated project.rootProject == project
name = "Testmod Server"
mods {
create("uwu") {
sourceSet sourceSets.testmod
}
create("owo"){
sourceSet sourceSets.main
}
}
source sourceSets.testmod
}
}

accessWidenerPath = file("src/main/resources/owo.accesswidener")

neoForge {
// TODO: Figure out within the future
// publish file("src/main/resources/interfaces.json")
// publish file("src/main/resources/META-INF/owo.accesstransformer.cfg")
}
}

dependencies {
// modLocalRuntime("me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}")
modCompileOnly("me.shedaniel:RoughlyEnoughItems-default-plugin:${project.rei_version}")
modCompileOnly("me.shedaniel:RoughlyEnoughItems-api-fabric:${project.rei_version}")
//implementation("org.sinytra:forgified-fabric-loader:${project.loader_version}")
//modImplementation("org.sinytra.forgified-fabric-api:forgified-fabric-api:${project.fabric_version}")

modCompileOnly("dev.emi:emi-fabric:${project.emi_version}")
// modLocalRuntime("dev.emi:emi-fabric:${project.emi_version}")
//modLocalRuntime("me.shedaniel:RoughlyEnoughItems-neoforge:${project.rei_version}")
modCompileOnly("me.shedaniel:RoughlyEnoughItems-default-plugin:${project.rei_version}")
modCompileOnly("me.shedaniel:RoughlyEnoughItems-api-neoforge:${project.rei_version}")

modCompileOnly("com.terraformersmc:modmenu:${project.modmenu_version}")
modLocalRuntime("com.terraformersmc:modmenu:${project.modmenu_version}")
modCompileOnly("dev.emi:emi-neoforge:${project.emi_version}")

include api("io.wispforest:endec:0.1.5")
include api("io.wispforest.endec:netty:0.1.2")
include api("io.wispforest.endec:gson:0.1.3")
include api("io.wispforest.endec:jankson:0.1.3")
forgeRuntimeLibrary(include(api("io.wispforest:endec:0.1.8")))
forgeRuntimeLibrary(include(api("io.wispforest.endec:netty:0.1.4")))
forgeRuntimeLibrary(include(api("io.wispforest.endec:gson:0.1.5")))
forgeRuntimeLibrary(include(api("io.wispforest.endec:jankson:0.1.5")))

include api("blue.endless:jankson:${project.jankson_version}")
forgeRuntimeLibrary(include(api("blue.endless:jankson:${project.jankson_version}")))

modCompileOnly("xyz.nucleoid:server-translations-api:${project.stapi_version}")
include implementation("org.sinytra:forgified-fabric-loader:${project.loader_version}:full")
include modApi("org.sinytra.forgified-fabric-api:fabric-api-base:0.4.42+d1308dedd1") { exclude group: "fabric-api" }
include modApi("org.sinytra.forgified-fabric-api:fabric-networking-api-v1:4.2.2+a92978fd19") { exclude group: "fabric-api" }
include modApi("org.sinytra.forgified-fabric-api:fabric-screen-api-v1:2.0.24+79a4c2b0d1") { exclude group: "fabric-api" }

testmodImplementation sourceSets.main.output
testmodAnnotationProcessor sourceSets.main.output
Expand Down
17 changes: 11 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx2G

loom.platform=neoforge

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_base_version=1.21
minecraft_version=1.21
minecraft_version=1.21.1
yarn_mappings=1.21+build.2
loader_version=0.15.11
loader_version=2.5.29+0.16.0+1.21
# Mod Properties
mod_version=0.12.15
mod_version=0.12.15-beta.6
maven_group=io.wispforest
archives_base_name=owo-lib
archives_base_name=owo-lib-neoforge

# Dependencies
fabric_version=0.100.1+1.21
fabric_version=0.104.0+2.0.14+1.21.1
neoforge_version=21.1.57

# https://maven.shedaniel.me/me/shedaniel/RoughlyEnoughItems-fabric/
rei_version=15.0.728

# https://maven.terraformersmc.com/releases/dev/emi/emi-fabric/
emi_version=1.1.6+1.20.6
emi_version=1.1.7+1.21

# https://search.maven.org/artifact/blue.endless/jankson
jankson_version=1.2.2
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
135 changes: 135 additions & 0 deletions owo-neo-publish/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
import org.gradle.jvm.tasks.Jar;

plugins {
// Apply the plugin. You can find the latest version at https://projects.neoforged.net/neoforged/ModDevGradle
id("net.neoforged.moddev") version "2.0.42-beta"
id("maven-publish")
}

apply(plugin = "maven-publish")

version = "${rootProject.property("mod_version")}+${rootProject.property("minecraft_base_version")}"
group = rootProject.property("maven_group")!!

val ENV = System.getenv()

repositories {
maven("https://maven.terraformersmc.com/releases/")
maven("https://maven.shedaniel.me/")
maven {
url = uri("https://api.modrinth.com/maven")
content {
includeGroup("maven.modrinth")
}
}
maven("https://maven.nucleoid.xyz/")
maven("https://maven.wispforest.io/releases")
maven("https://maven.su5ed.dev/releases")
mavenLocal()
}

dependencies {
implementation(rootProject)

api("io.wispforest:endec:0.1.8")
api("io.wispforest.endec:netty:0.1.4")
api("io.wispforest.endec:gson:0.1.5")
api("io.wispforest.endec:jankson:0.1.5")

api("blue.endless:jankson:${project.property("jankson_version")}")

api("org.sinytra:forgified-fabric-loader:${project.property("loader_version")}:full")
api("org.sinytra.forgified-fabric-api:fabric-api-base:0.4.42+d1308dedd1") { exclude(group = "fabric-api") }
api("org.sinytra.forgified-fabric-api:fabric-networking-api-v1:4.2.2+a92978fd19") { exclude(group = "fabric-api") }
api("org.sinytra.forgified-fabric-api:fabric-screen-api-v1:2.0.24+79a4c2b0d1") { exclude(group = "fabric-api") }
}

neoForge {
// We currently only support NeoForge versions later than 21.0.x
// See https://projects.neoforged.net/neoforged/neoforge for the latest updates
version = rootProject.property("neoforge_version").toString()

// Validate AT files and raise errors when they have invalid targets
// This option is false by default, but turning it on is recommended
validateAccessTransformers = true

accessTransformers {
from(rootProject.file("src/main/resources/META-INF/owo.accesstransformer.cfg"))
publish(rootProject.file("src/main/resources/META-INF/owo.accesstransformer.cfg"))
}

interfaceInjectionData {
from(rootProject.file("src/main/resources/interfaces.json"))
publish(rootProject.file("src/main/resources/interfaces.json"))
}
}

val targetJavaVersion = 21
tasks.withType<JavaCompile>().configureEach {
this.options.encoding = "UTF-8"
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
this.options.release = targetJavaVersion
}
}

//tasks.getByName("build") {
// onlyIf("test") {
// false;
// }
//}

java {
val javaVersion = JavaVersion.toVersion(targetJavaVersion)
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
base.archivesName.set(rootProject.property("archives_base_name").toString())
withSourcesJar()

val data: MutableMap<String, Set<PublishArtifact>> = mutableMapOf();

for (cfg in rootProject.configurations) {
if (cfg.name.equals("runtimeElements")) continue;

with(cfg.artifacts) {
val publishArtifact = this.filter {
publishArtifact -> return@filter publishArtifact.file.name.contains("owo-lib");
}.toSet()

data[cfg.name] = publishArtifact

if (!publishArtifact.isEmpty()) this.removeAll(publishArtifact);
}
}

for (cfg in project.configurations) {
with(cfg.artifacts) {
this.filter {
publishArtifact -> return@filter publishArtifact.file.name.contains("owo-lib");
}.toSet().let {
publishArtifact -> this.removeAll(publishArtifact)
}

data[cfg.name]?.let { this.addAll(it) }
}
}
}

publishing {
publications {
create<MavenPublication>("mavenCommon") {
this.from(components["java"])

artifactId = rootProject.property("archives_base_name").toString()
}
}
repositories {
maven {
url = uri(ENV["MAVEN_URL"]!!)
credentials {
username = ENV["MAVEN_USER"]
password = ENV["MAVEN_PASSWORD"]
}
}
}
}
2 changes: 2 additions & 0 deletions owo-neo-publish/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx2G=
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ protected void done() {

@Override
protected Void doInBackground() {
try {
OwoSentinel.downloadAndInstall(logger);
} catch (Exception e) {
logger.accept("Download failed!");
OwoSentinel.LOGGER.error("Download failed", e);
}
// try {
// OwoSentinel.downloadAndInstall(logger);
// } catch (Exception e) {
// logger.accept("Download failed!");
// OwoSentinel.LOGGER.error("Download failed", e);
// }
return null;
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
package io.wispforest.owosentinel;

import net.fabricmc.loader.api.LanguageAdapter;
import net.fabricmc.loader.api.ModContainer;
import cpw.mods.modlauncher.api.NamedPath;
import cpw.mods.modlauncher.serviceapi.ITransformerDiscoveryService;

public class Maldenhagen implements LanguageAdapter {
import java.nio.file.Path;
import java.util.List;

public class Maldenhagen implements ITransformerDiscoveryService {
@Override
public <T> T create(ModContainer mod, String value, Class<T> type) {
throw new UnsupportedOperationException();
public List<NamedPath> candidates(Path gameDirectory) {
return List.of();
}

static {
OwoSentinel.launch();
@Override
public void earlyInitialization(String launchTarget, String[] arguments) {
//OwoSentinel.launch();
}
}
Loading