Skip to content

Commit

Permalink
Update to NeoForge 1.20.4
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Jun 15, 2024
1 parent 0349feb commit f05d717
Show file tree
Hide file tree
Showing 14 changed files with 116 additions and 173 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ jobs:
SIGN_STOREPASS: ${{ secrets.SIGN_STOREPASS }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_KEY: ${{ secrets.MAVEN_KEY }}
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 'Test'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
doc/info.txt
/build
/run
/runs

# Ignore project specific files
.classpath
Expand All @@ -17,6 +18,7 @@ repo/*
*.iws
out/*
keystore.jks
.idea

# Ignore mac-specific file(s)
.DS_Store
Expand Down
123 changes: 57 additions & 66 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
plugins {
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
id 'com.matthewprenger.cursegradle' version '1.4.0'
id 'net.neoforged.gradle.userdev' version '7.0.97'
id 'net.darkhax.curseforgegradle' version '1.0.8'
id 'com.github.kt3k.coveralls' version '2.8.2'
id 'com.diffplug.spotless' version '5.14.3'
}

apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'idea'
apply plugin: 'maven-publish'
apply plugin: 'jacoco'

import net.minecraftforge.gradle.common.tasks.SignJar
import net.neoforged.gradle.common.tasks.PotentiallySignJar

// Determine build number
String build_number = "DEV" // this will be referenced as simply build_number from now on.
Expand All @@ -27,7 +26,10 @@ logger.lifecycle "BUILDING VERSION: " + build_number
// Set mod details
version = project.mod_version
group = "org.cyclops.integratedterminalscompat"
archivesBaseName = "IntegratedTerminals-Compat"
archivesBaseName = "IntegratedTerminals-Compat-${project.minecraft_version}-neoforge"
base {
archivesName = archivesBaseName
}

// Set Java details
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
Expand All @@ -48,6 +50,7 @@ sourceSets {
main
test
}
sourceSets.main.resources { srcDir 'src/generated/resources' }

configurations {
modLib
Expand All @@ -67,8 +70,8 @@ repositories {
name "Cyclops Repo"
url "https://maven.pkg.github.com/CyclopsMC/packages"
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("MAVEN_USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("MAVEN_KEY")
username = project.findProperty("gpr.user") ?: System.getenv("MAVEN_USERNAME") ?: System.getenv("GITHUB_USER")
password = project.findProperty("gpr.key") ?: System.getenv("MAVEN_KEY") ?: System.getenv("GITHUB_TOKEN")
}
}
maven {
Expand All @@ -86,109 +89,92 @@ repositories {
}

dependencies {
minecraft "net.minecraftforge:forge:${project.minecraft_version}-${project.forge_version}"
implementation "net.neoforged:neoforge:${project.neoforge_version}"

// Add something like 'cyclopscore_version_local=0.1.0-DEV' to your secrets.properties if you want to use a custom local CyclopsCore version.
if(secrets.cyclopscore_version_local) {
implementation "org.cyclops.cyclopscore:cyclopscore:${project.minecraft_version}-${secrets.cyclopscore_version_local}:deobf"
implementation "org.cyclops.cyclopscore:cyclopscore-${project.minecraft_version}-neoforge:${secrets.cyclopscore_version_local}:deobf"
} else {
implementation "org.cyclops.cyclopscore:cyclopscore:${project.minecraft_version}-${project.cyclopscore_version}:deobf"
implementation "org.cyclops.cyclopscore:cyclopscore-${project.minecraft_version}-neoforge:${project.cyclopscore_version}:deobf"
}

// Add something like 'integrateddynamics_version_local=0.1.0-DEV' to your secrets.properties if you want to use a custom local Integrated Tunnels Compat version.
if(secrets.integrateddynamics_version_local) {
implementation ("org.cyclops.integrateddynamics:integrateddynamics:${secrets.integrateddynamics_version_local}:deobf") {
implementation ("org.cyclops.integrateddynamics:integrateddynamics-${project.minecraft_version}-neoforge:${secrets.integrateddynamics_version_local}:deobf") {
transitive = false
}
} else {
implementation ("org.cyclops.integrateddynamics:integrateddynamics:${project.integrateddynamics_version}:deobf") {
implementation ("org.cyclops.integrateddynamics:integrateddynamics-${project.minecraft_version}-neoforge:${project.integrateddynamics_version}:deobf") {
transitive = false
}
}

// Add something like 'integratedterminals_version_local=0.1.0-DEV' to your secrets.properties if you want to use a custom local Integrated Tunnels Compat version.
if(secrets.integratedterminals_version_local) {
implementation ("org.cyclops.integratedterminals:integratedterminals:${secrets.integratedterminals_version_local}:deobf") {
implementation ("org.cyclops.integratedterminals:integratedterminals-${project.minecraft_version}-neoforge:${secrets.integratedterminals_version_local}:deobf") {
transitive = false
}
} else {
implementation ("org.cyclops.integratedterminals:integratedterminals:${project.integratedterminals_version}:deobf") {
implementation ("org.cyclops.integratedterminals:integratedterminals-${project.minecraft_version}-neoforge:${project.integratedterminals_version}:deobf") {
transitive = false
}
}

if(secrets.commoncapabilities_version_local) {
implementation ("org.cyclops.commoncapabilities:commoncapabilities:${secrets.commoncapabilities_version_local}:deobf") {
implementation ("org.cyclops.commoncapabilities:commoncapabilities-${project.minecraft_version}-neoforge:${secrets.commoncapabilities_version_local}:deobf") {
transitive = false
}
} else {
implementation ("org.cyclops.commoncapabilities:commoncapabilities:${project.commoncapabilities_version}:deobf") { // https://dl.bintray.com/cyclopsmc/dev/org/cyclops/commoncapabilities/CommonCapabilities/
implementation ("org.cyclops.commoncapabilities:commoncapabilities-${project.minecraft_version}-neoforge:${project.commoncapabilities_version}:deobf") { // https://dl.bintray.com/cyclopsmc/dev/org/cyclops/commoncapabilities/CommonCapabilities/
transitive = false
}
}

modLib "com.google.re2j:re2j:1.1"
modLib ("io.netty:netty-codec-http:4.1.77.Final") {
transitive = false
}

implementation fg.deobf("mezz.jei:jei-${project.jei_version}") // https://maven.blamejared.com/mezz/jei/ https://dvs1.progwml6.com/jenkins/
implementation("mezz.jei:jei-${project.minecraft_version}-neoforge:${project.jei_version}") // https://maven.blamejared.com/mezz/jei/ https://dvs1.progwml6.com/jenkins/

//runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:${project.curios_version}") // https://maven.theillusivec4.top/top/theillusivec4/curios/curios-forge/
compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:${project.curios_version}:api")
compileOnly("top.theillusivec4.curios:curios-neoforge:${project.curios_version}:api")
}

minecraft {
mappings channel: "official", version: "${project.minecraft_version}"

runs {
client {
workingDirectory project.file('run')
//property 'forge.logging.markers', 'REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
mods {
integratedterminalscompat {
source sourceSets.main
}
}
runs {
configureEach {
systemProperty 'forge.logging.markers', 'REGISTRIES'
systemProperty 'forge.logging.console.level', 'debug'
systemProperty 'forge.logging.console.level', 'debug'
modSource project.sourceSets.main

lazyToken('minecraft_classpath') {
configurations.modLib.copyRecursive().resolve().collect { it.absolutePath }.join(File.pathSeparator)
}
dependencies {
runtime project.configurations.modLib
}
}

client {
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
}

server {
workingDirectory project.file('run')
property 'forge.logging.console.level', 'debug'
mods {
integratedterminalscompat {
source sourceSets.main
}
}

lazyToken('minecraft_classpath') {
configurations.modLib.copyRecursive().resolve().collect { it.absolutePath }.join(File.pathSeparator)
}
}
server {
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
programArgument '--nogui'
}

data {
workingDirectory project.file('run')
property 'forge.logging.console.level', 'debug'
args '--mod', 'integratedterminalscompat', '--all', '--output', file('src/generated/resources/')
mods {
integratedterminalscompat {
source sourceSets.main
}
}
gameTestServer {
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
}

lazyToken('minecraft_classpath') {
configurations.modLib.copyRecursive().resolve().collect { it.absolutePath }.join(File.pathSeparator)
}
}
data {
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
}

if (build_number.equals("RELEASE"))
version = "${project.minecraft_version}-${project.mod_version}"
version = "${project.mod_version}"
else
version = "${project.minecraft_version}-${project.mod_version}-${build_number}"
version = "${project.mod_version}-${build_number}"

jar {
manifest {
Expand All @@ -204,7 +190,9 @@ jar {
}
}

task signJar(type: SignJar, dependsOn: jar) {
task signJar(type: PotentiallySignJar, dependsOn: jar) {
dependsOn(tasks.jar)

onlyIf {
System.getenv().SIGN_KEYSTORE
}
Expand All @@ -213,10 +201,9 @@ task signJar(type: SignJar, dependsOn: jar) {
alias = System.getenv().SIGN_ALIAS
storePass = System.getenv().SIGN_STOREPASS
keyPass = System.getenv().SIGN_KEYPASS
inputFile = jar.archivePath
outputFile = jar.archivePath
input = jar.archivePath
output = jar.archivePath
}
build.dependsOn signJar

task deobfJar(type: Jar) {
from sourceSets.main.output
Expand Down Expand Up @@ -317,3 +304,7 @@ tasks.register('updateGitHooks', Copy) {
into './.git/hooks'
}
compileJava.dependsOn updateGitHooks

tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}
17 changes: 9 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
mod_id=integratedterminals-compat
mod_version=1.0.0
minecraft_version=1.20.1
forge_version=47.0.1
cyclopscore_version=1.18.4-340
minecraft_version=1.20.4
neoforge_version=20.4.160-beta
cyclopscore_version=1.19.0-423
release_type=release
fingerprint=bd0353b3e8a2810d60dd584e256e364bc3bedd44

integrateddynamics_version=1.20.1-1.16.7-575
integratedterminals_version=1.20.1-1.4.8-281
commoncapabilities_version=1.20.1-2.9.0-98
curios_version=1.19.4-5.1.5.3
jei_version=1.20.1-forge:15.1.0.19
integrateddynamics_version=1.21.2-740
integratedterminals_version=1.4.12-326
commoncapabilities_version=2.9.1-116
curios_version=7.3.4+1.20.4
jei_version=17.3.0.52

# Workaround for Spotless bug
# https://github.com/diffplug/spotless/issues/834
Expand Down
6 changes: 2 additions & 4 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
maven {
name = 'MinecraftForge'
url = 'https://maven.minecraftforge.net/'
}
maven { url = 'https://maven.neoforged.net/releases' }
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package org.cyclops.integratedterminalscompat;

import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.common.Mod;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.api.distmarker.OnlyIn;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.common.Mod;
import org.apache.logging.log4j.Level;
import org.cyclops.cyclopscore.config.ConfigHandler;
import org.cyclops.cyclopscore.init.ModBaseVersionable;
import org.cyclops.cyclopscore.modcompat.ModCompatLoader;
import org.cyclops.cyclopscore.proxy.IClientProxy;
import org.cyclops.cyclopscore.proxy.ICommonProxy;
import org.cyclops.integratedterminalscompat.modcompat.curios.CuriosCompat;
import org.cyclops.integratedterminalscompat.proxy.ClientProxy;
import org.cyclops.integratedterminalscompat.proxy.CommonProxy;

Expand All @@ -23,16 +22,8 @@ public class IntegratedTerminalsCompat extends ModBaseVersionable<IntegratedTerm

public static IntegratedTerminalsCompat _instance;

public IntegratedTerminalsCompat() {
super(Reference.MOD_ID, (instance) -> _instance = instance);
}

@Override
protected void loadModCompats(ModCompatLoader modCompatLoader) {
super.loadModCompats(modCompatLoader);

// Mod compats
modCompatLoader.addModCompat(new CuriosCompat());
public IntegratedTerminalsCompat(IEventBus modEventBus) {
super(Reference.MOD_ID, (instance) -> _instance = instance, modEventBus);
}

@Override
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit f05d717

Please sign in to comment.