Skip to content

Commit

Permalink
Switch to ModDevGradle
Browse files Browse the repository at this point in the history
  • Loading branch information
bl4ckscor3 committed Jan 1, 2025
1 parent 2001b09 commit a49ed11
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 32 deletions.
69 changes: 43 additions & 26 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'java-library'
id 'eclipse'
id 'idea'
id 'net.neoforged.gradle.userdev' version '7.0.165'
id 'net.neoforged.moddev' version '2.0.71'
}

import groovy.json.JsonOutput
Expand Down Expand Up @@ -34,32 +34,44 @@ sourceSets.main.resources {
srcDir 'src/generated/resources' //include generated files
}

minecraft.accessTransformers.file rootProject.file('src/main/resources/META-INF/accesstransformer.cfg')
neoForge {
version = "21.3.58"
validateAccessTransformers = true

runs {
configureEach {
systemProperty 'forge.logging.console.level', 'debug'
modSource project.sourceSets.main
}

client {
workingDirectory project.file('run/client')
}

server {
workingDirectory project.file('run/server')
argument '-nogui'
runs {
configureEach {
systemProperty 'forge.logging.console.level', 'debug'
ideName = "SC ${project.mc_version} " + ideName.get()
}

client {
client()
gameDirectory = project.file('run/client')
}

server {
server()
gameDirectory = project.file('run/server')
programArgument('-nogui')
}

data {
data()
gameDirectory = project.file('run/data')
programArguments.addAll('--mod', 'securitycraft', '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath())
}
}

data {
workingDirectory project.file('run/data')
arguments.addAll '--mod', 'securitycraft', '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
mods {
securitycraft {
sourceSet(sourceSets.main)
}
}
}

repositories {
maven {
url "https://cursemaven.com/"
url = "https://cursemaven.com/"
content {
includeGroup "curse.maven"
}
Expand All @@ -68,7 +80,7 @@ repositories {
exclusiveContent {
forRepository {
maven {
url "https://api.modrinth.com/maven"
url = "https://api.modrinth.com/maven"
}
}
filter {
Expand All @@ -78,26 +90,24 @@ repositories {
}

dependencies {
implementation 'net.neoforged:neoforge:21.3.54-beta'

// implementation "curse.maven:architectury-api-419699:5553800" //ftb teams dependency
// implementation "curse.maven:ftb-library-forge-404465:5557408" //ftb teams dependency
// implementation "curse.maven:ftb-teams-forge-404468:5448371"
// implementation "curse.maven:jei-238222:5567933"
// implementation "curse.maven:the-one-probe-245211:5502323"
implementation "curse.maven:jade-324717:5835088"
implementation "curse.maven:jade-324717:5846076"
implementation "curse.maven:betterf3-401648:5873289"
implementation "curse.maven:cloth-config-348521:5834708" //betterf3 dependency
implementation "curse.maven:wthit-forge-455982:5838416"
implementation "curse.maven:wthit-forge-455982:5897178"
implementation "curse.maven:badpackets-615134:5430629" //wthit dependency
// implementation "curse.maven:projecte-226410:3955047"
// implementation "curse.maven:embeddium-908741:5556146"
implementation "maven.modrinth:sodium:mc1.21.2-0.6.0-beta.3-neoforge" //incompatible with embeddium
implementation "maven.modrinth:sodium:mc1.21.3-0.6.5-neoforge" //incompatible with embeddium
}

tasks.named('jar', Jar).configure {
exclude('net/geforcemods/securitycraft/datagen/**') //exclude files from the built jar that are only used to generate the assets & data
archiveFileName = "[1.21.3] SecurityCraft v${version}.jar"
archiveFileName = "[${project.mc_version}] SecurityCraft v${version}.jar"
manifest {
attributes(["Specification-Title": "SecurityCraft",
"Specification-Vendor": "Geforce, bl4ckscor3, Redstone_Dubstep",
Expand All @@ -111,4 +121,11 @@ tasks.named('jar', Jar).configure {
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.release = 21
}

idea {
module {
downloadSources = true
downloadJavadoc = true
}
}
7 changes: 5 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
org.gradle.jvmargs=-Xmx3G -Dfile.encoding=UTF-8
org.gradle.daemon=false
neogradle.subsystems.parchment.minecraftVersion=1.21.3
neogradle.subsystems.parchment.mappingsVersion=2024.12.07
org.gradle.configuration-cache=true
neoForge.parchment.minecraftVersion=1.21.3
neoForge.parchment.mappingsVersion=2024.12.07

mc_version=1.21.3
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
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.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
4 changes: 3 additions & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -84,7 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ pluginManagement {
}

plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0'
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.9.0'
}
1 change: 0 additions & 1 deletion src/main/resources/META-INF/accesstransformer.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public net.minecraft.client.multiplayer.ClientChunkCache$Storage viewCenterZ
public net.minecraft.client.multiplayer.ClientChunkCache$Storage <init>(Lnet/minecraft/client/multiplayer/ClientChunkCache;I)V
public net.minecraft.client.multiplayer.ClientChunkCache$Storage getIndex(II)I
public net.minecraft.client.multiplayer.ClientChunkCache$Storage replace(ILnet/minecraft/world/level/chunk/LevelChunk;)V
public net.minecraft.client.multiplayer.ClientChunkCache$Storage replace(ILnet/minecraft/world/level/chunk/LevelChunk;Lnet/minecraft/world/level/chunk/LevelChunk;)Lnet/minecraft/world/level/chunk/LevelChunk;
public net.minecraft.client.multiplayer.ClientChunkCache$Storage inRange(II)Z
public net.minecraft.client.multiplayer.ClientChunkCache$Storage getChunk(I)Lnet/minecraft/world/level/chunk/LevelChunk;
public net.minecraft.world.item.StandingAndWallBlockItem wallBlock
Expand Down

0 comments on commit a49ed11

Please sign in to comment.