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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 0 additions & 1 deletion .architectury-transformer/debug.log

This file was deleted.

5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Disable autocrlf on generated files, they always generate with LF
# Add any extra files or paths here to make git stop saying they
# are changed when only line endings change.
src/generated/**/.cache/cache text eol=lf
src/generated/**/*.json text eol=lf
63 changes: 19 additions & 44 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,30 @@
name: build
on: [ pull_request, push ]
name: Build

on: [push, pull_request]

jobs:
build:
strategy:
matrix:
java: [ 17 ]
runs-on: ubuntu-latest
steps:

- name: checkout repository
uses: actions/checkout@v2

- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v1
- name: Checkout repository
uses: actions/checkout@v4
with:
java-version: ${{ matrix.java }}
fetch-depth: 0
fetch-tags: true

- uses: actions/cache@v4
- name: Setup JDK 21
uses: actions/setup-java@v4
with:
path: |
~/.gradle/caches
~/.gradle/loom-cache
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle
java-version: '21'
distribution: 'temurin'

- name: make gradle wrapper executable
run: chmod +x ./gradlew

- name: datagen
run: ./gradlew runDatagen
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: build
run: ./gradlew build
# This is needed to be able to run ./gradlew below
# You can run `git update-index --chmod +x gradlew` then remove this step.
- name: Make Gradle wrapper executable
run: chmod +x ./gradlew

# Uncomment these lines to upload jars to github artifacts:
# - name: upload fabric artifact
# uses: actions/upload-artifact@v4
# with:
# name: fabric
# path: |
# fabric/build/libs/*.jar
# !**/*shadow*
# !**/*sources*
#
# - name: upload forge artifact
# uses: actions/upload-artifact@v4
# with:
# name: forge
# path: |
# forge/build/libs/*.jar
# !**/*shadow*
# !**/*sources*
- name: Build with Gradle
run: ./gradlew build
39 changes: 22 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
build/
# eclipse
bin
*.launch
.settings
.metadata
.classpath
.project

# idea
out
*.ipr
run/
*.iws
out/
*.iml
.gradle/
output/
bin/
libs/
generated/
.idea

.classpath
.project
.idea/
classes/
.metadata
.vscode
.settings
*.launch
/common/src/generated/resources/.cache
# gradle
build
.gradle

# other
eclipse
run
runs
run-data

repo
1 change: 0 additions & 1 deletion README.md

This file was deleted.

207 changes: 153 additions & 54 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,76 +1,175 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false
id "io.github.juuxel.loom-quiltflower" version "1.+" apply false // Quiltflower, a better decompiler
id "io.github.p03w.machete" version "1.+" // automatic jar compressing on build
id 'java-library'
id 'maven-publish'
id 'net.neoforged.moddev' version '2.0.107'
id 'idea'
}

architectury {
minecraft = rootProject.minecraft_version
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
}

subprojects {
apply plugin: "dev.architectury.loom"
version = mod_version
group = mod_group_id

loom {
silentMojangMappingsLicense()
}
repositories {
maven { url = "https://maven.createmod.net" } // Create, Ponder, Flywheel
maven { url = "https://maven.ithundxr.dev/snapshots" } // Registrate
maven { url = "https://maven.blamejared.com" } // JEI
}

repositories {
mavenCentral()
maven { url = "https://maven.shedaniel.me/" } // Cloth Config, REI
maven { url = "https://maven.blamejared.com/" } // JEI
maven { url = "https://maven.parchmentmc.org" } // Parchment mappings
maven { url = "https://maven.quiltmc.org/repository/release" } // Quilt Mappings
maven { url = "https://maven.tterrag.com" } // Registrate
maven { url = "https://maven.createmod.net" } // Create, Ponder, Flywheel
maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" } // ForgeConfigAPIPort
}
dependencies {
implementation("com.simibubi.create:create-${minecraft_version}:${create_version}:slim") { transitive = false }
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}")
implementation("mezz.jei:jei-${minecraft_version}-neoforge:${jei_version}")
}

base {
archivesName = mod_id
}

dependencies {
minecraft "com.mojang:minecraft:${minecraft_version}"
// layered mappings - Mojmap names, parchment and QM docs and parameters
mappings(loom.layered {
it.mappings("org.quiltmc:quilt-mappings:${minecraft_version}+build.${qm_version}:intermediary-v2")
// it.parchment("org.parchmentmc.data:parchment-${minecraft_version}:${parchment_version}@zip")
it.officialMojangMappings { nameSyntheticMembers = false }
})
// Mojang ships Java 21 to end users in 1.21.1, so mods should target Java 21.
java.toolchain.languageVersion = JavaLanguageVersion.of(21)

// see each subproject for dependencies.
neoForge {
// Specify the version of NeoForge to use.
version = project.neo_version

parchment {
mappingsVersion = project.parchment_mappings_version
minecraftVersion = project.parchment_minecraft_version
}
}

allprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"
apply plugin: "maven-publish"
// This line is optional. Access Transformers are automatically detected
// accessTransformers = project.files('src/main/resources/META-INF/accesstransformer.cfg')

archivesBaseName = rootProject.archives_base_name
group = rootProject.maven_group
// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
client {
client()

// Formats the mod version to include the loader, Minecraft version, and build number (if present)
// example: 1.0.0+fabric-1.18.2-100
String buildNumber = System.getenv("GITHUB_RUN_NUMBER")
version = "${mod_version}-${minecraft_version}-${project.name}" + (buildNumber != null ? "-${buildNumber}" : "")
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
}

repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
server {
server()
programArgument '--nogui'
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
}

// 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 {
type = "gameTestServer"
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
}

data {
data()

// example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
// gameDirectory = project.file('run-data')

// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}

// applies to all the run configs above
configureEach {
// 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
logLevel = org.slf4j.event.Level.DEBUG
}
}

tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
mods {
// define mod <-> source bindings
// these are used to tell the game which sources are for which mod
// multi mod projects should define one per mod
"${mod_id}" {
sourceSet(sourceSets.main)
}
}
}

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

java {
withSourcesJar()
// Sets up a dependency configuration called 'localRuntime'.
// This configuration should be used instead of 'runtimeOnly' to declare
// a dependency that will be present for runtime testing but that is
// "optional", meaning it will not be pulled by dependents of this mod.
configurations {
runtimeClasspath.extendsFrom localRuntime
}

// This block of code expands all declared replace properties in the specified resource targets.
// A missing property will result in an error. Properties are expanded using ${} Groovy notation.
var generateModMetadata = tasks.register("generateModMetadata", ProcessResources) {
var replaceProperties = [
minecraft_version : minecraft_version,
minecraft_version_range: minecraft_version_range,
neo_version : neo_version,
loader_version_range : loader_version_range,
mod_id : mod_id,
mod_name : mod_name,
mod_license : mod_license,
mod_version : mod_version,
mod_authors : mod_authors,
mod_description : mod_description
]
inputs.properties replaceProperties
expand replaceProperties
from "src/main/templates"
into "build/generated/sources/modMetadata"
}
// Include the output of "generateModMetadata" as an input directory for the build
// this works with both building through Gradle and the IDE.
sourceSets.main.resources.srcDir generateModMetadata
// To avoid having to run "generateModMetadata" manually, make it run on every project reload
neoForge.ideSyncTask generateModMetadata

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

tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}

machete {
// disable machete locally for faster builds
enabled = buildNumber != null
// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior.
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}
Loading