Skip to content

Commit

Permalink
1.21.1 porting start
Browse files Browse the repository at this point in the history
  • Loading branch information
BrokenK3yboard committed Jan 4, 2025
1 parent a63fa2f commit 5bdad28
Show file tree
Hide file tree
Showing 10 changed files with 104 additions and 111 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,7 @@ __pycache__
*.pyc

# Web
web/cached.php
web/cached.php

# Zeta for porting, remove later
Zeta
145 changes: 65 additions & 80 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net' }
maven { url = 'https://repo.spongepowered.org/maven' }
maven { url = 'https://maven.parchmentmc.org' }
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1+', changing: true
classpath group: 'org.spongepowered', name: 'mixingradle', version: '0.7-SNAPSHOT'
classpath group: 'org.parchmentmc.librarian.forgegradle', name: 'org.parchmentmc.librarian.forgegradle.gradle.plugin', version: '1.+'
maven {
url = "https://maven.minecraftforge.net"
}
}
}

plugins {
id 'com.diffplug.spotless' version '6.22.0'
id 'java-library'
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'pmd'
id 'com.diffplug.spotless' version '6.22.0'
id 'net.neoforged.gradle.userdev' version '7.0.142'
}

apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'org.parchmentmc.librarian.forgegradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: 'pmd'

jarJar.enable()

ext.configFile = file('build.properties')
Expand All @@ -36,45 +29,40 @@ archivesBaseName = config.mod_name

compileJava.options.compilerArgs << "-Xlint:all,-classfile,-processing,-deprecation"

java.toolchain.languageVersion = JavaLanguageVersion.of(17)
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))

if (System.getenv('BUILD_NUMBER') != null) {
version += "." + System.getenv('BUILD_NUMBER')
}

minecraft {
mappings channel: 'parchment', version: '2023.09.03-1.20.1'
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.

accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
configureEach {
property "mixin.debug.export", "true"
mods {
quark {
source sourceSets.main
}
}
}

client {
workingDirectory project.file('run')
}
runs {
// applies to all the run configs below
configureEach {
systemProperty "mixin.debug.export", "true"
// Recommended logging data for a userdev environment
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
systemProperty 'forge.logging.markers', 'REGISTRIES'

// Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
systemProperty 'forge.logging.console.level', 'debug'

modSource project.sourceSets.main
}

server {
workingDirectory project.file('runServer')
}
client {
workingDirectory project.file('run')
}
}

mixin {
add sourceSets.main, 'quark.mixins.refmap.json'
config 'quark.mixins.json'
config 'quark_integrations.mixins.json'
server {
workingDirectory project.file('runServer')
programArgument '--nogui'
}
}

repositories {
Expand Down Expand Up @@ -103,6 +91,12 @@ repositories {
maven { // Curios api
url = "https://maven.theillusivec4.top/"
}
maven {
url = "https://api.modrinth.com/maven"
}
maven {
url = "https://maven.minecraftforge.net"
}

maven {
name "jitpack"
Expand All @@ -111,34 +105,31 @@ repositories {
}

dependencies {
minecraft "net.minecraftforge:forge:${config.mc_version}-${deps.forge}"

compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:0.3.2"))
implementation("io.github.llamalad7:mixinextras-forge:0.3.2")
implementation "net.neoforged:neoforge:${deps.neoforge}"

//annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
//normal AP is broken!!
annotationProcessor 'net.fabricmc:sponge-mixin:0.12.5+mixin.0.8.5'

// annotationProcessor 'net.fabricmc:sponge-mixin:0.12.5+mixin.0.8.5'

//runtimeOnly fg.deobf("dev.emi:emi-forge:${deps.emi}")
runtimeOnly fg.deobf("curse.maven:spark-361579:${deps.spark}")
runtimeOnly "maven.modrinth:spark:${deps.spark}"

//implementation fg.deobf("org.violetmoon.zeta:Zeta:1.0-25a")
implementation fg.deobf("curse.maven:zeta-968868:5597406")
implementation fg.deobf("com.github.glitchfiend:TerraBlender-forge:${deps.terrablender}")
implementation fg.deobf("curse.maven:jei-238222:${deps.jei}")
implementation fg.deobf("curse.maven:flan-forge-493246:${deps.flan}")
implementation fg.deobf("curse.maven:lootr-361276:${deps.lootr}")
implementation fg.deobf("curse.maven:just-enough-resources-jer-240630:4689010")

runtimeOnly fg.deobf("curse.maven:nofog-296468:4601446")
runtimeOnly fg.deobf("curse.maven:woodworks-543610:5292418")
runtimeOnly fg.deobf("curse.maven:blueprint-382216:5292242")
runtimeOnly fg.deobf("curse.maven:farmers-delight-398521:5051242")

runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:${deps.curios}")
compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:${deps.curios}:api")
// implementation fg.deobf("curse.maven:zeta-968868:5597406")
implementation project (':Zeta') // Replace with maven link
implementation "com.github.glitchfiend:TerraBlender-neoforge:${deps.terrablender}"
implementation "curse.maven:jei-238222:${deps.jei}"
// implementation fg.deobf("curse.maven:flan-forge-493246:${deps.flan}")
implementation "curse.maven:lootr-361276:${deps.lootr}"
// implementation fg.deobf("curse.maven:just-enough-resources-jer-240630:4689010")

runtimeOnly "curse.maven:nofog-296468:5438578"
// runtimeOnly fg.deobf("curse.maven:woodworks-543610:5292418")
// runtimeOnly fg.deobf("curse.maven:blueprint-382216:5292242")
runtimeOnly "curse.maven:farmers-delight-398521:5962800"

// runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:${deps.curios}")
// compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:${deps.curios}:api")
}

spotless {
Expand All @@ -156,7 +147,7 @@ spotless {
pmd {
toolVersion '6.42.0'
incrementalAnalysis.set(true)
ruleSets.clear()
ruleSets = new ArrayList()
ruleSetFiles = files("spotless/pmd-ruleset.xml")
}

Expand Down Expand Up @@ -209,7 +200,7 @@ def parseConfig(File config) {
}

jar {
classifier "pure" // Jar without jar-in-jar
archiveClassifier = "pure" // Jar without jar-in-jar

manifest {
attributes([
Expand All @@ -232,17 +223,12 @@ jar {
}

task sourcesJar(type: Jar) {
classifier "sources"
archiveClassifier = "sources"
from sourceSets.main.allJava
}

task deobfJar(type: Jar) {
classifier "deobf"
from sourceSets.main.output
}

tasks.jarJar.configure {
classifier "" // "Main" jar should be the one with jar-in-jar
archiveClassifier = "" // "Main" jar should be the one with jar-in-jar

exclude "**/*.bat"
exclude "**/*.psd"
Expand All @@ -253,7 +239,6 @@ tasks.jarJar.configure {

artifacts {
archives sourcesJar
archives deobfJar
}

publish.dependsOn(project.tasks.getByName("assemble"))
Expand Down Expand Up @@ -282,10 +267,10 @@ publishing {
}

artifact sourcesJar {
classifier 'sources'
archiveClassifier = 'sources'
}

jarJar.component(it)
// jarJar.component(it)
}
}

Expand Down
4 changes: 2 additions & 2 deletions build.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#Sun Aug 04 07:47:28 UTC 2024
mapping_version=1.20.1
mapping_version=1.21
version=4.0
mod_name=Quark
mc_version=1.20.1
mc_version=1.21.1
mapping_channel=official
mod_id=quark
build_number=461
Expand Down
11 changes: 5 additions & 6 deletions dependencies.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
forge=47.1.3
zeta=1.0-19
jei=4712868
terrablender=1.20.1-3.0.0.169
neoforge=21.1.93
jei=5846880
terrablender=1.21.1-4.1.0.5
flan=5290172
lootr=4608503
lootr=5893109
emi=1.0.24+1.20.1
spark=4738952
spark=1.10.109-neoforge
curios=5.6.1+1.20.1
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-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
10 changes: 10 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
maven { url = 'https://maven.neoforged.net/releases' }
}
}

rootProject.name = 'Quark'
include ':Zeta' // Dev only; remove from prod
6 changes: 2 additions & 4 deletions src/main/java/org/violetmoon/quark/base/Quark.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,19 @@
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.crafting.RecipeManager;
import net.minecraftforge.fml.common.Mod;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.MixinEnvironment;
import org.violetmoon.quark.base.proxy.ClientProxy;
import org.violetmoon.quark.base.proxy.CommonProxy;
import org.violetmoon.quark.integration.claim.FlanIntegration;
import org.violetmoon.quark.integration.claim.IClaimIntegration;
import org.violetmoon.quark.integration.lootr.ILootrIntegration;
import org.violetmoon.quark.integration.lootr.LootrIntegration;
import org.violetmoon.quark.integration.terrablender.AbstractUndergroundBiomeHandler;
import org.violetmoon.quark.integration.terrablender.TerrablenderUndergroundBiomeHandler;
import org.violetmoon.quark.integration.terrablender.VanillaUndergroundBiomeHandler;
import org.violetmoon.zeta.Zeta;
import org.violetmoon.zeta.multiloader.Env;
import org.violetmoon.zeta.util.Utils;
import org.violetmoon.zetaimplforge.ForgeZeta;

@Mod(Quark.MOD_ID)
Expand All @@ -35,9 +31,11 @@ public class Quark {
public static Quark instance;
public static CommonProxy proxy;

/*
public static final IClaimIntegration FLAN_INTEGRATION = ZETA.modIntegration("flan",
() -> FlanIntegration::new,
() -> IClaimIntegration.Dummy::new);
*/

public static final ILootrIntegration LOOTR_INTEGRATION = ZETA.modIntegration("lootr",
() -> LootrIntegration::new,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
modLoader="javafml"
loaderVersion="[41,)"
loaderVersion="[3,)"
issueTrackerURL="https://github.com/VazkiiMods/Quark"
license="https://github.com/VazkiiMods/Quark/blob/master/LICENSE.md"

Expand All @@ -10,30 +10,28 @@ version="${file.jarVersion}"
authors="Vazkii, WireSegal, MCVinnyq, Sully"
description='''Small things, improving Minecraft bit by bit.'''

[[dependencies.quark]]
modId="forge"
mandatory=true
versionRange="[43.0.8,)"
ordering="AFTER"
side="BOTH"
[[mixins]]
config="quark.mixins.json"

file="META-INF/accesstransformer.cfg"

[[dependencies.quark]]
modId="zeta"
mandatory=true
versionRange="[1.0-20,2.0)"
ordering="AFTER"
modId="neoforge"
type="required"
versionRange="[21.0.10,)"
ordering="NONE"
side="BOTH"

[[dependencies.quark]]
modId="curios"
mandatory=false
versionRange="[5.6.1,)"
modId="zeta"
type="required"
versionRange="[1.0,2.0)"
ordering="AFTER"
side="BOTH"

[[dependencies.quark]]
modId="lootr"
mandatory=false
versionRange="[0.4.24.61,)"
versionRange="[1.10.34.86,)"
ordering="AFTER"
side="BOTH"
2 changes: 1 addition & 1 deletion src/main/resources/quark.mixins.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"minVersion": "0.8",
"required": true,
"compatibilityLevel": "JAVA_17",
"compatibilityLevel": "JAVA_21",
"refmap": "quark.mixins.refmap.json",
"package": "org.violetmoon.quark.mixin.mixins",
"plugin": "org.violetmoon.zeta.mixin.plugin.InterfaceDelegateMixinPlugin",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/quark_integrations.mixins.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"minVersion": "0.8",
"required": false,
"compatibilityLevel": "JAVA_17",
"compatibilityLevel": "JAVA_21",
"refmap": "quark.mixins.refmap.json",
"package": "org.violetmoon.quark.integration.mixin",
"mixins": [
Expand Down

0 comments on commit 5bdad28

Please sign in to comment.