Skip to content

Commit

Permalink
Forge 1.20.3 (#643)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rakambda authored Dec 8, 2023
1 parent e5025d7 commit 68ab8f6
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 72 deletions.
15 changes: 6 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ allprojects {

java.toolchain.languageVersion = JavaLanguageVersion.of(17)

tasks.withType(JavaCompile) {
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
options.compilerArgs = ["-Xlint:deprecation"]
}
Expand Down Expand Up @@ -56,7 +56,7 @@ allprojects {
}
}

if (version == null || version.equals("unspecified")) {
if (version == null || version == "unspecified") {
try {
def details = versionDetails()
if (details.commitDistance > 0) {
Expand Down Expand Up @@ -84,7 +84,8 @@ if (version.contains("a") || version.contains("dev")) {
isAlpha = true
}

task buildJar(type: Jar, group: "modding") {
tasks.register('buildJar', Jar) {
group("Modding")
dependsOn(assemble)
dependsOn(":common:build")
if (project.includeFabric.toBoolean()) {
Expand All @@ -94,10 +95,6 @@ task buildJar(type: Jar, group: "modding") {
dependsOn(":forge:build")
}

if (project.includeForge.toBoolean()) {
finalizedBy(":forge:signJar")
}

duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from {
zipTree("common/build/libs/common-${project.version}.jar")
Expand Down Expand Up @@ -181,7 +178,7 @@ curseforge {
}

afterEvaluate {
tasks["curseforge${project.curseforge_project_id}"].dependsOn("buildJar")
tasks.named("curseforge${project.curseforge_project_id}").get().dependsOn("buildJar")
}
}

Expand Down Expand Up @@ -216,7 +213,7 @@ modrinth {
}

afterEvaluate {
tasks["modrinth"].dependsOn("buildJar")
tasks.named("modrinth").get().dependsOn("buildJar")
}
}

Expand Down
60 changes: 7 additions & 53 deletions forge/build.gradle
Original file line number Diff line number Diff line change
@@ -1,69 +1,40 @@
import net.minecraftforge.gradle.common.tasks.SignJar

plugins {
alias(libs.plugins.forge)
}

minecraft {
mappings channel: "official", version: "${libs.versions.forgeMappingsVersion.get()}"
mappings channel: "official", version: "${libs.versions.minecraftVersion.get()}"
copyIdeResources = true

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

runs {
configureEach {
property "forge.logging.markers", "REGISTRIES"
property "forge.logging.console.level", "error"
}

client {
taskName "runFTForgeClient"
workingDirectory project.file("./run/client")
property "forge.logging.markers", "REGISTRIES"
property "forge.logging.console.level", "debug"
property "forge.enabledGameTestNamespaces", "fallingtree"
mods {
fallingtree {
source sourceSets.main
}
}
}

server {
taskName "runFTForgeServer"
workingDirectory project.file("./run/server")
property "forge.logging.markers", "REGISTRIES"
property "forge.logging.console.level", "info"
property "forge.enabledGameTestNamespaces", "fallingtree"
args "--nogui"
mods {
fallingtree {
source sourceSets.main
}
}
}

gameTestServer {
taskName "runFTForgeTestServer"
workingDirectory project.file("./run/test")
property "forge.logging.markers", "REGISTRIES"
property "forge.logging.console.level", "debug"
property "forge.enabledGameTestNamespaces", "fallingtree"

mods {
fallingtree {
source sourceSets.main
}
}
}

data {
taskName "runFTForgeData"
workingDirectory project.file("./run/data")
property "forge.logging.markers", "REGISTRIES"
property "forge.logging.console.level", "debug"
args '--mod', 'fallingtree', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')

mods {
fallingtree {
source sourceSets.main
}
}
}
}
}
Expand Down Expand Up @@ -97,26 +68,9 @@ processResources {

from "src/main/resources", "../common/src/main/resources"

filesMatching("META-INF/mods.toml") {
filesMatching(["META-INF/mods.toml", "pack.mcmeta"]) {
expand project.properties
}
}

jar.finalizedBy('reobfJar')

task signJar(type: SignJar, dependsOn: rootProject.buildJar, group: "modding") {
onlyIf {
project.hasProperty("forgeKeyStore")
&& project.hasProperty("forgeKeyStoreAlias")
&& project.hasProperty("forgeKeyStorePass")
&& project.hasProperty("forgeKeyStoreKeyPass")
&& rootProject.file(project.findProperty("forgeKeyStore")).exists()
}

keyStore = project.findProperty("forgeKeyStore") == null ? null : rootProject.file(project.findProperty("forgeKeyStore")).absolutePath
alias = project.findProperty("forgeKeyStoreAlias")
storePass = project.findProperty("forgeKeyStorePass")
keyPass = project.findProperty("forgeKeyStoreKeyPass")
inputFile = rootProject.jar.getArchiveFile()
outputFile = rootProject.jar.getArchiveFile()
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import fr.rakambda.fallingtree.common.wrapper.IBlockEntity;
import fr.rakambda.fallingtree.common.wrapper.IBlockPos;
import fr.rakambda.fallingtree.common.wrapper.IBlockState;
import fr.rakambda.fallingtree.common.wrapper.IComponent;
import fr.rakambda.fallingtree.common.wrapper.IItemStack;
import fr.rakambda.fallingtree.common.wrapper.ILevel;
import fr.rakambda.fallingtree.common.wrapper.IPlayer;
Expand Down Expand Up @@ -39,6 +40,7 @@ public void playerDestroy(@NotNull ILevel level, @NotNull IPlayer player, @NotNu
raw.playerDestroy((Level) level.getRaw(), (Player) player.getRaw(), (BlockPos) blockPos.getRaw(), (BlockState) blockState.getRaw(), entity, (ItemStack) itemStack.getRaw());
}

@NotNull
@Override
public IComponent getAsComponent(){
return new ComponentWrapper(raw.getName());
Expand Down
4 changes: 2 additions & 2 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 = "[48,)"
loaderVersion = "[49,)"
issueTrackerURL = "https://github.com/${repoUser}/${repoName}/issues"
license = "LGPL-3.0"

Expand All @@ -15,7 +15,7 @@ authors = "Rakambda"
[[dependencies.fallingtree]]
modId = "forge"
mandatory = true
versionRange = "[48,)"
versionRange = "[49,)"
ordering = "NONE"
side = "BOTH"
[[dependencies.fallingtree]]
Expand Down
2 changes: 1 addition & 1 deletion forge/src/main/resources/pack.mcmeta
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"description": {
"text": "FallingTree"
},
"pack_format": 15
"pack_format": 22
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ org.gradle.daemon=false
modId=fallingtree
modName=FallingTree
includeFabric=true
includeForge=false
includeForge=true
# Repository
repoUser=Rakambda
repoName=FallingTree
Expand Down
9 changes: 4 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@ log4j2-version = "2.22.0"

# Minecraft / Loaders
minecraftVersion = "1.20.3"
fabric-loader-version = "0.15.0"
fabric-loader-version = "0.15.1"
fabric-api-version = "0.91.1+1.20.3"
forge-version = "1.20.2-48.0.1"
forgeMappingsVersion = "1.20.2"
forge-version = "1.20.3-49.0.2"

# Mod dependencies
modmenu-version = "9.0.0-pre.1"
clothConfigVersion = "12.0.111"

fabric-loom-version = "1.3.2"
forge-plugin-version = "6.0.8"
fabric-loom-version = "1.4+"
forge-plugin-version = "[6.0.16,6.2)"
curse-version = "1.4.0"
modrinth-version = "2.8.7"
names-version = "0.50.0"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 4 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ pluginManagement {
}
}

plugins {
id("org.gradle.toolchains.foojay-resolver-convention").version("0.7.0")
}

val includeFabric: String by settings
val includeForge: String by settings

Expand Down

0 comments on commit 68ab8f6

Please sign in to comment.