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
  •  
  •  
  •  
11 changes: 5 additions & 6 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Absent by Design
# Absent by Design

A Minecraft mod built on the Forge API [https://files.minecraftforge.net/](https://files.minecraftforge.net)

Project page with releases: https://www.curseforge.com/minecraft/mc-mods/absent-by-design

https://modrinth.com/mod/absent-by-design
[![CurseForge](https://img.shields.io/badge/CurseForge-F16436?style=flat-square&logo=curseforge&logoColor=white)](https://www.curseforge.com/minecraft/mc-mods/absent-by-design)
[![Modrinth](https://img.shields.io/badge/Modrinth-1bd96a?style=flat-square&logo=modrinth&logoColor=white)](https://modrinth.com/mod/absent-by-design)



Expand All @@ -15,7 +14,7 @@ https://modrinth.com/mod/absent-by-design

[![Build](https://github.com/Lothrazar/AbsentByDesign/actions/workflows/build.yml/badge.svg)](https://github.com/Lothrazar/AbsentByDesign/actions/workflows/build.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
[![Discord](https://img.shields.io/discord/749302798797242449.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/uWZ3jf56fV)
[![links](https://img.shields.io/badge/more-links-ff69b4.svg)](https://allmylinks.com/lothrazar)
[![Twitter Badge](https://img.shields.io/badge/contact-twitter-blue.svg)](https://twitter.com/lothrazar)

[![Support](https://img.shields.io/badge/Patreon-Support-orange.svg?logo=Patreon)](https://www.patreon.com/Lothrazar)

7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ bin
*.launch
.settings
.metadata
.classpath
.cla*
.project

# idea
Expand All @@ -16,11 +16,10 @@ out
# gradle
build
.gradle
deploy.properties

# other
run
logs
libs

# Files from Forge MDK
forge*changelog.txt
repo
360 changes: 201 additions & 159 deletions build.gradle

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions deploy.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

# absolute paths to copyJar after 'publish'.

# destinations=C:/temp,C:/Users/USER/Desktop,C:/Users/USER/AppData/Roaming/.minecraft/mods
destinations=C:/temp
41 changes: 18 additions & 23 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
# 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
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.configuration-cache=true

mod_id=absentbydesign
curse_id=305840
#read more on this at https://github.com/neoforged/NeoGradle/blob/NG_7.0/README.md#apply-parchment-mappings
# you can also find the latest versions at: https://parchmentmc.org/docs/getting-started
parchment_minecraft_version=1.21.1
parchment_mappings_version=2024.11.17

mod_version=1.9.1
# your properties
# https://www.curseforge.com/minecraft/mc-mods/flib

neo_version=47.1.104
forge_version=47.1.104
minecraft_version=1.21.1
neo_version=21.1.222

mod_name=Absent by Design
mod_group_id=com.lothrazar.absentbydesign
loader_version_range=[1,)

mod_license=SeeGithub
mod_authors=Lothrazar
mod_description=mod
minecraft_version_range=[1.20.1,)
loader_version_range=[47,)
mapping_channel=official
minecraft_version=1.20.1
mapping_version=1.20.1
mc_version=1.20.1

# flib_version=1.0.0



flib_file=5495793
flib_version=0.0.14
jei_version=15.3.0.4
# 15.12.2.52
patchouli_version=93
jei_version=19.27.0.340
curios_version=9.5.1
crafttweaker_version=21.0.38
115 changes: 115 additions & 0 deletions gradle/deploy.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
// ---------------------------------------------------------------------------
// deployLocal — copies the built JAR to every folder listed in deploy.properties
// deploy.properties is gitignored; each developer maintains their own copy.
//
// Runs automatically after 'publish' via finalizedBy.
// Can also be run standalone with: gradlew deployLocal
// (depends only on 'jar' so it won't trigger a full publish cycle standalone)
// ---------------------------------------------------------------------------
def deployProps = new Properties()
def deployFile = rootProject.file('deploy.properties')
if (deployFile.exists()) {
deployFile.withInputStream { deployProps.load(it) }
}

tasks.register('deployLocal') {
description = 'Copies build jar to all destinations in deploy.properties'
group = 'distribution'
dependsOn 'jar'

def jarFile = layout.buildDirectory.file("libs/${base.archivesName.get()}-${version}.jar")

def destinations = deployProps.getProperty('destinations', '')
.split(',')
.collect { it.trim() }
.findAll { it }

onlyIf { !destinations.isEmpty() }

// doLast avoids configuration cache errors from project.copy() references
doLast {
def source = jarFile.get().asFile
destinations.each { dest ->
def destDir = new File(dest)
destDir.mkdirs()
java.nio.file.Files.copy(
source.toPath(),
new File(destDir, source.name).toPath(),
java.nio.file.StandardCopyOption.REPLACE_EXISTING
)
logger.lifecycle("Deployed ${source.name} -> ${dest}")
}
}
}

tasks.named('publish') {
finalizedBy 'deployLocal'
}

// ---------------------------------------------------------------------------
// publishCurseForge / publishModrinth / release / publishAll
// API keys are read from ~/.gradle/gradle.properties, deploy.properties, or env vars.
//
// ~/.gradle/gradle.properties (recommended):
// curseforge_api_key=...
// modrinth_token=...
//
// Run individually:
// gradlew publishCurseForge
// gradlew publishModrinth
// Run all at once:
// gradlew publishAll
// ---------------------------------------------------------------------------
apply plugin: 'com.modrinth.minotaur'

def changelogText = (new groovy.json.JsonSlurper().parse(file('update.json'))[minecraft_version]?[mod_version] ?: '') as String
def mrToken = findProperty('modrinth_token') ?: deployProps.getProperty('modrinth_token', '') ?: System.getenv('MODRINTH_TOKEN') ?: ''

// Exposed as ext so publishCurseForge in build.gradle can read them after apply from:
ext.cfApiKey = findProperty('curseforge_api_key') ?: deployProps.getProperty('curseforge_api_key', '') ?: System.getenv('CURSEFORGE_API_KEY') ?: ''
ext.changelog = changelogText

// --- Modrinth ---
modrinth {
token = mrToken
projectId = modrinth_id
versionNumber = project.version
versionType = 'release'
uploadFile = jar
gameVersions = [minecraft_version]
loaders = ['neoforge']
changelog = changelogText
}

// important: unlike curseforge, modrinth has no problem with you making many copies of the same version
//so we have to hand roll up our own checke
tasks.named('modrinth').configure {
notCompatibleWithConfigurationCache('Minotaur is not configuration-cache compatible')

doFirst {
def versions = new groovy.json.JsonSlurper()
.parse(new URI("https://api.modrinth.com/v2/project/${modrinth_id}/version").toURL())
if (versions.any { it.version_number == project.version }) {
throw new GradleException("Modrinth version ${modrinth_id}-${project.version} already exists — bump mod_version before publishing.")
}
}
}

tasks.register('publishModrinth') {
group = 'publishing'
description = 'Uploads the mod jar to Modrinth.'
dependsOn 'modrinth'
}

// --- Combined tasks ---
tasks.register('release') {
group = 'publishing'
description = 'Publishes to CurseForge, Modrinth, and Maven.'
dependsOn 'publishCurseForge', 'publishModrinth', 'publish'
}

//tasks.register('publishAll') {
// group = 'publishing'
// description = 'Uploads to CurseForge and Modrinth, and deploys locally.'
// dependsOn 'publishCurseForge', 'publishModrinth', 'deployLocal'
//}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
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-9.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
37 changes: 22 additions & 15 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 14 additions & 12 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading