Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
build/

# Forge Gradle
run/
runs/

# InteliJ
.idea/**/dictionaries
Expand Down
219 changes: 79 additions & 140 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@ plugins {
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle' version '[6.0.18,6.2)'
id 'org.spongepowered.mixin' version '0.7.+'
id 'net.neoforged.gradle.userdev' version '7.0.165'
}

tasks.named('wrapper', Wrapper).configure {
// Define wrapper values here so as to not have to always do so when updating gradlew.properties.
// Switching this to Wrapper.DistributionType.ALL will download the full gradle sources that comes with
// documentation attached on cursor hover of gradle classes and methods. However, this comes with increased
// file size for Gradle. If you do switch this to ALL, run the Gradle wrapper task twice afterwards.
// (Verify by checking gradle/wrapper/gradle-wrapper.properties to see if distributionUrl now points to `-all`)
distributionType = Wrapper.DistributionType.BIN
}

version = mod_version
Expand All @@ -14,110 +22,58 @@ base {
}

// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
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'}"
minecraft {
// The mappings can be changed at any time and must be in the following format.
// Channel: Version:
// official MCVersion Official field/method names from Mojang mapping files
// parchment YYYY.MM.DD-MCVersion Open community-sourced parameter names and javadocs layered on top of official
//
// You must be aware of the Mojang license when using the 'official' or 'parchment' mappings.
// See more information here: https://github.com/NeoForged/NeoForm/blob/main/Mojang.md
//
// Parchment is an unofficial project maintained by ParchmentMC, separate from MinecraftForge
// Additional setup is needed to use their mappings: https://parchmentmc.org/docs/getting-started
//
// Use non-default mappings at your own risk. They may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: mapping_channel, version: mapping_version

// When true, this property will have all Eclipse/IntelliJ IDEA run configurations run the "prepareX" task for the given run configuration before launching the game.
// In most cases, it is not necessary to enable.
// enableEclipsePrepareRuns = true
// enableIdeaPrepareRuns = true

// This property allows configuring Gradle's ProcessResources task(s) to run on IDE output locations before launching the game.
// It is REQUIRED to be set to true for this template to function.
// See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html
copyIdeResources = true

// When true, this property will add the folder name of all declared run configurations to generated IDE run configurations.
// The folder name can be set on a run configuration using the "folderName" property.
// By default, the folder name of a run configuration is the name of the Gradle project containing it.
// generateRunFolders = true

// This property enables access transformers for use in development.
// They will be applied to the Minecraft artifact.
// The access transformer file can be anywhere in the project.
// However, it must be at "META-INF/accesstransformer.cfg" in the final mod jar to be loaded by Forge.
// This default location is a best practice to automatically put the file in the right place in the final jar.
// See https://docs.neoforged.net/docs/1.20.x/advanced/accesstransformers/ for more information.

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

// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
// applies to all the run configs below
configureEach {
workingDirectory project.file('run')

// 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.
property '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
property 'forge.logging.console.level', 'debug'

mods {
"${mod_id}" {
//noinspection GroovyAssignabilityCheck
source sourceSets.main
}
}
}

client {
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
property 'forge.enabledGameTestNamespaces', mod_id
}

server {
property 'forge.enabledGameTestNamespaces', mod_id
args '--nogui'
}

// This run config launches GameTestServer and runs all registered gametests, then exits.
// By default, the server will crash when no gametests are provided.
// The gametest system is also enabled by default for other run configs under the /test command.
gameTestServer {
property 'forge.enabledGameTestNamespaces', mod_id
}

data {
// example of overriding the workingDirectory set in configureEach above
workingDirectory project.file('run-data')

// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
}
runs {
configureEach {
systemProperty 'forge.logging.markers', 'REGISTRIES'
systemProperty 'forge.logging.console.level', 'debug'
modSource project.sourceSets.main
}
client {
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
}
server {
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
programArgument '--nogui'
}
gameTestServer {
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
}
data {
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
}


// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }

repositories {
maven { url = "https://maven.createmod.net" } // Create, Ponder, Flywheel
maven { url = "https://maven.tterrag.com" } // Registrate
maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" } // ForgeConfigAPIPort
maven { url = "https://maven.createmod.net" } // Ponder, Flywheel
maven { url = "https://mvn.devos.one/snapshots" } // Registrate
maven { url = "https://maven.blamejared.com" } // JEI, Vazkii's Mods
maven { url = "https://harleyoconnor.com/maven" } // Dynamic Trees
maven { url = "https://maven.theillusivec4.top/" } // Curios API
maven { url = "https://maven.squiddev.cc" } // CC: Tweaked
maven { url = "https://www.cursemaven.com" }
maven { url = "https://api.modrinth.com/maven" }
maven { url = "https://maven.saps.dev/releases" } // FTB Mods
maven { url = "https://maven.architectury.dev" } // Arch API
maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven" } // NeoForge config api port, needed by ponder
maven {
url = "https://jm.gserv.me/repository/maven-public" // JourneyMap
content {
includeGroup "info.journeymap"
includeGroup "mysticdrew"
}
}
}

dependencies {
implementation "net.neoforged:neoforge:${neo_version}"
}

dependencies {
Expand All @@ -126,15 +82,15 @@ dependencies {
// The "userdev" classifier will be requested and setup by NeoGradle.
// If the group id is "net.minecraft" and the artifact id is one of ["client", "server", "joined"],
// then special handling is done to allow a setup of a vanilla dependency without the use of an external repository.
minecraft "net.neoforged:forge:${minecraft_version}-${neo_version}"
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
implementation(fg.deobf("com.simibubi.create:create-${minecraft_version}:${create_version}:slim") { transitive = false })
implementation(fg.deobf("net.createmod.ponder:Ponder-Forge-${minecraft_version}:${ponder_version}"))
compileOnly(fg.deobf("dev.engine-room.flywheel:flywheel-forge-api-${minecraft_version}:${flywheel_version}"))
runtimeOnly(fg.deobf("dev.engine-room.flywheel:flywheel-forge-${minecraft_version}:${flywheel_version}"))
implementation(fg.deobf("com.tterrag.registrate:Registrate:${registrate_version}"))
compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:0.4.1"))
implementation("io.github.llamalad7:mixinextras-forge:0.4.1")
// minecraft "net.neoforged:forge:${minecraft_version}-${neo_version}"
// annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
implementation "com.simibubi.create:create-${minecraft_version}:${create_version}:slim"
implementation "net.createmod.ponder:Ponder-NeoForge-${minecraft_version}:${ponder_version}"
compileOnly "dev.engine-room.flywheel:flywheel-neoforge-api-${minecraft_version}:${flywheel_version}"
runtimeOnly "dev.engine-room.flywheel:flywheel-neoforge-${minecraft_version}:${flywheel_version}"
implementation "com.tterrag.registrate:Registrate:${registrate_version}"
// compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:0.4.1"))
// implementation("io.github.llamalad7:mixinextras-forge:0.4.1")

// Example mod dependency with JEI - using fg.deobf() ensures the dependency is remapped to your development mappings
// The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
Expand Down Expand Up @@ -166,52 +122,35 @@ tasks.withType(ProcessResources).configureEach {
]
inputs.properties replaceProperties

filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
expand replaceProperties + [project: project]
filesMatching(['META-INF/neoforge.mods.toml']) {
expand replaceProperties
}
}

// Example for how to get properties into the manifest for reading at runtime.
tasks.named('jar', Jar).configure {
manifest {
attributes([
'Specification-Title' : mod_id,
'Specification-Vendor' : mod_authors,
'Specification-Version' : '1', // We are version 1 of ourselves
'Implementation-Title' : project.name,
'Implementation-Version' : project.jar.archiveVersion,
'Implementation-Vendor' : mod_authors,
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}

// This is the preferred method to reobfuscate your jar file
finalizedBy 'reobfJar'
}

mixin {
add sourceSets.main, "mixins.${mod_id}.refmap.json"
config "${mod_id}.mixins.json"
}
//mixin {
// add sourceSets.main, "mixins.${mod_id}.refmap.json"
// config "${mod_id}.mixins.json"
//}

// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing:
// tasks.named('publish').configure {
// dependsOn 'reobfJar'
// }

// Example configuration to allow publishing using the maven-publish plugin
publishing {
publications {
register('mavenJava', MavenPublication) {
artifact jar
}
}
repositories {
maven {
url "file://${project.projectDir}/mcmodsrepo"
}
}
}
//publishing {
// publications {
// register('mavenJava', MavenPublication) {
// artifact jar
// }
// }
// repositories {
// maven {
// url "file://${project.projectDir}/mcmodsrepo"
// }
// }
//}

tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
Expand Down
48 changes: 21 additions & 27 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,32 +1,26 @@
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs = -Xmx3G
org.gradle.daemon = false

minecraft_version = 1.20.1
minecraft_version_range = [1.20,1.21)
neo_version = 47.1.25
neo_version_range = [47.1,)
loader_version_range = [47,)

create_version = 6.0.2-52
ponder_version = 1.0.51
flywheel_version = 1.0.1
registrate_version = MC1.20-1.3.3

mapping_channel = official
mapping_version = 1.20.1


mod_id = createendertransmission
mod_name = Create Ender Transmission
mod_license = All Right Reserved
mod_version = 2.1.0-1.20.1
mod_group_id = com.forsteri.createendertransmission
mod_authors = Forsteri
pack_format_number = 15

mod_description = \
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
minecraft_version=1.21.1
minecraft_version_range=[1.21,1.21.1)
neo_version=21.1.125
neo_version_range=[21.1.125,)
loader_version_range=[4,)
create_version=6.0.2-36
ponder_version=1.0.44
flywheel_version=1.0.1-11
registrate_version=MC1.21-1.3.0+50
parchment_minecraft_version=1.21.1
parchment_mappings_version=2024.11.17
mod_id=createendertransmission
mod_name=Create Ender Transmission
mod_license=All Right Reserved
mod_version=2.1.1-1.21.1
mod_group_id=com.forsteri.createendertransmission
mod_authors=Forsteri
pack_format_number=15
mod_description=\
"Non-dimensional Machanines \
\
Have you ever feel like you have lost your mind at formating networks?\
Expand Down
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Mar 08 16:36:28 CST 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
14 changes: 0 additions & 14 deletions src/generated/resources/.cache/cache

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"createendertransmission:energy_transmitter"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"createendertransmission:energy_transmitter"
]
}

This file was deleted.

Loading
Loading