Skip to content

Commit

Permalink
Neo / 1.20.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunekaer committed Jan 7, 2024
1 parent c36830f commit db3eff9
Show file tree
Hide file tree
Showing 16 changed files with 199 additions and 80 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Changelog

Updated CI / Build Script
NeoForge & 1.20.4
26 changes: 20 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.2-SNAPSHOT" apply false
id "me.modmuss50.mod-publish-plugin" version "0.3.0"
id "dev.architectury.loom" version "1.4-SNAPSHOT" apply false
id "me.modmuss50.mod-publish-plugin" version "0.4.5"
}

architectury {
Expand All @@ -10,7 +10,7 @@ architectury {

subprojects {
apply plugin: "dev.architectury.loom"
apply from: "https://files.latmod.com/public/markdown-git-changelog.gradle"
apply plugin: "maven-publish"

loom {
silentMojangMappingsLicense()
Expand All @@ -30,7 +30,7 @@ allprojects {
def ENV = System.getenv()

archivesBaseName = rootProject.archives_base_name
version = "${mod_version}-build.${ENV.GITHUB_RUN_NUMBER ?: 9999}+mc${minecraft_version}"
version = rootProject.mod_version
group = rootProject.maven_group

repositories {
Expand All @@ -54,16 +54,22 @@ publishMods {

def fabricOptions = publishOptions {
file = project.provider { project(":fabric").tasks.remapJar }.flatMap { it.archiveFile }
displayName = "${project.name} Fabric ${mod_version}+mc${minecraft_version}"
displayName = "[FABRIC][${minecraft_version}] ${project.name} ${mod_version}"
modLoaders.add("fabric")
}

def forgeOptions = publishOptions {
file = project.provider { project(":forge").tasks.remapJar }.flatMap { it.archiveFile }
displayName = "${project.name} Forge ${mod_version}+mc${minecraft_version}"
displayName = "[FORGE][${minecraft_version}] ${project.name} ${mod_version}"
modLoaders.add("forge")
}

def neoForge = publishOptions {
file = project.provider { project(":neoforge").tasks.remapJar }.flatMap { it.archiveFile }
displayName = "[NEOFORGE][${minecraft_version}] ${project.name} ${mod_version}"
modLoaders.add("neoforge")
}

def curseForgeOptions = curseforgeOptions {
accessToken = providers.environmentVariable("CURSE_TOKEN")
projectId = "${curseforge_id}"
Expand All @@ -87,6 +93,10 @@ publishMods {
from(curseForgeOptions, forgeOptions)
}

curseforge("curseforgeNeoForge") {
from(curseForgeOptions, neoForge)
}

if (providers.environmentVariable("MODRINTH_TOKEN").getOrNull() != null) {
modrinth("modrinthFabric") {
from(modrinthOptions, fabricOptions)
Expand All @@ -98,5 +108,9 @@ publishMods {
modrinth("modrinthForge") {
from(modrinthOptions, forgeOptions)
}

modrinth("modrinthNeoforge") {
from(modrinthOptions, neoForge)
}
}
}
16 changes: 1 addition & 15 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,11 @@ dependencies {
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
}

def ENV = System.getenv()

publishing {
publications {
mavenCommon(MavenPublication) {
artifactId = rootProject.archives_base_name + "-" + project.name
artifactId = "${rootProject.archivesBaseName}-${project.name}"
from components.java
}
}

repositories {
if (ENV.NANITE_TOKEN) {
maven {
url "https://maven.nanite.dev/releases"
credentials {
username = "nanite"
password = "${ENV.NANITE_TOKEN}"
}
}
}
}
}
24 changes: 12 additions & 12 deletions common/src/main/resources/flatbedrock-common.mixins.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"required": true,
"minVersion": "0.8",
"package": "com.sunekaer.flatbedrock.mixin",
"compatibilityLevel": "JAVA_17",
"client": [
],
"mixins": [
"FlatBedrockMixin"
],
"injectors": {
"defaultRequire": 1
}
"required": true,
"minVersion": "0.8",
"package": "com.sunekaer.flatbedrock.mixin",
"compatibilityLevel": "JAVA_17",
"client": [
],
"mixins": [
"FlatBedrockMixin"
],
"injectors": {
"defaultRequire": 1
}
}
16 changes: 1 addition & 15 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,25 +67,11 @@ components.java {
}
}

def ENV = System.getenv()

publishing {
publications {
mavenFabric(MavenPublication) {
artifactId = rootProject.archivesBaseName + "-" + project.name
artifactId = "${rootProject.archivesBaseName}-${project.name}"
from components.java
}
}

repositories {
if (ENV.NANITE_TOKEN) {
maven {
url "https://maven.nanite.dev/releases"
credentials {
username = "nanite"
password = "${ENV.NANITE_TOKEN}"
}
}
}
}
}
2 changes: 1 addition & 1 deletion fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
],
"depends": {
"fabric": "*",
"minecraft": ">=1.19.2"
"minecraft": ">=1.20.4"
}
}
22 changes: 7 additions & 15 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ configurations {
}

dependencies {
forge "net.minecraftforge:forge:${rootProject.forge_version}"
forge "net.minecraftforge:forge:${rootProject.minecraft_version}-${rootProject.forge_version}"

common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive = false }
Expand Down Expand Up @@ -73,25 +73,17 @@ components.java {
}
}

def ENV = System.getenv()
sourceSets.each {
def dir = layout.buildDirectory.dir("sourcesSets/$it.name")
it.output.resourcesDir = dir
it.java.destinationDirectory = dir
}

publishing {
publications {
mavenForge(MavenPublication) {
artifactId = rootProject.archives_base_name + "-" + project.name
artifactId = "${rootProject.archivesBaseName}-${project.name}"
from components.java
}
}

repositories {
if (ENV.NANITE_TOKEN) {
maven {
url "https://maven.nanite.dev/releases"
credentials {
username = "nanite"
password = "${ENV.NANITE_TOKEN}"
}
}
}
}
}
6 changes: 3 additions & 3 deletions forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
modLoader="javafml"
loaderVersion="[43,)"
loaderVersion="[49,)"
issueTrackerURL="https://github.com/nanite/Flat-Bedrock/issues"
license="MIT License"
[[mods]]
Expand All @@ -12,12 +12,12 @@ This mod changes the vanilia bedrock generator to make flat bedrock in the overw
[[dependencies.flatbedrock]]
modId="forge"
mandatory=true
versionRange="[43,)"
versionRange="[49,)"
ordering="NONE"
side="BOTH"
[[dependencies.flatbedrock]]
modId="minecraft"
mandatory=true
versionRange="[1.19.2,)"
versionRange="[1.20.4,)"
ordering="NONE"
side="BOTH"
32 changes: 21 additions & 11 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
org.gradle.jvmargs=-Xmx2048M
org.gradle.jvmargs=-Xmx8G
org.gradle.daemon=false

minecraft_version=1.20.1
enabled_platforms=fabric,forge
enabled_platforms=fabric,forge,neoforge

archives_base_name=flatbedrock
mod_version=3.0.1
mod_version=84.0.0
maven_group=com.sunekaer.mods

architectury_version=9.0.8
curseforge_id=398623
modrinth_id=ZYLnkiVu

fabric_loader_version=0.14.21
fabric_api_version=0.83.1+1.20.1
# Dependencies
minecraft_version=1.20.4

forge_version=1.20.1-47.0.4
# ForgeGradle
forge_gradle_version=6.0.18
# NeoForgeGradle
neoforge_gradle_version=7.0.80
# Mod loaders
# NeoForge
neoforge_version=20.4.80-beta
# Forge
forge_version=49.0.14

curseforge_id=398623
modrinth_id=ZYLnkiVu
maven_url=https://maven.nanite.dev/
fabric_loader_version=0.15.3
fabric_api_version=0.91.2+1.20.4

# Architectury
architectury_version=11.0.10
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.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
81 changes: 81 additions & 0 deletions neoforge/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
plugins {
id "com.github.johnrengelman.shadow" version "8.1.1"
}

architectury {
platformSetupLoomIde()
neoForge()
}

repositories {
maven {
url "https://maven.saps.dev/mirror"
}
}

loom {
accessWidenerPath = project(":common").loom.accessWidenerPath
}

configurations {
common
shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this.
compileClasspath.extendsFrom common
runtimeClasspath.extendsFrom common
developmentForge.extendsFrom common
}

dependencies {
neoForge "net.neoforged:neoforge:${rootProject.neoforge_version}"

common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive = false }
}

processResources {
inputs.property "version", project.version

filesMatching("META-INF/mods.toml") {
expand "version": project.version
}
}

shadowJar {
exclude "fabric.mod.json"
exclude "architectury.common.json"

configurations = [project.configurations.shadowCommon]
setArchiveClassifier("dev-shadow")
}

remapJar {
input.set shadowJar.archiveFile
dependsOn shadowJar
archiveBaseName.set "${rootProject.archives_base_name}-${project.name}"
setArchiveClassifier(null)
}

jar {
setArchiveClassifier("dev")
}

sourcesJar {
def commonSources = project(":common").sourcesJar
dependsOn commonSources
from commonSources.archiveFile.map { zipTree(it) }
}

components.java {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
}
}

publishing {
publications {
mavenNeoForge(MavenPublication) {
artifactId = "${rootProject.archivesBaseName}-${project.name}"
from components.java
}
}
}
1 change: 1 addition & 0 deletions neoforge/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
loom.platform=neoforge
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.sunekaer.flatbedrock.neo;

import com.sunekaer.flatbedrock.FlatBedrock;
import net.neoforged.fml.common.Mod;

@Mod(FlatBedrock.MOD_ID)
public class FlatBedrockNeo {
public FlatBedrockNeo() {
FlatBedrock.init();
}
}
Loading

0 comments on commit db3eff9

Please sign in to comment.