Skip to content

Commit

Permalink
switch to old project setup until plugin is released
Browse files Browse the repository at this point in the history
  • Loading branch information
rlnt committed Sep 3, 2024
1 parent 0d7b16e commit 8300ff2
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 76 deletions.
47 changes: 7 additions & 40 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,23 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog],
and this project adheres to [Semantic Versioning].

## [1.1.6] - 2024-03-29
## [1.1.7] - 2024-09-03

### Changed

- switched to proper screen registration and removed mixin
- moved ME Requester Terminal model and textures to own namespace

### Fixed

- fixed ME Requester Terminal item not showing its face texture

## [1.1.5] - 2024-03-28

### Changed

- updated to new Applied Energistics version for API changes
- new minimum version is 17.12.1-beta
Initial 1.21.1 release!

### Fixed

- fixed ME Requester from disconnecting after world restart
- fixed connectable sides not being exposed correctly

## [1.1.4] - 2024-03-25

Initial 1.20.4 release!

### Added

- added an in-depth explanation to the AE2 guidebook

### Changed

- reworked registration logic
- switched to new API for drag and drop logic

### Removed

- removed platform specific code to allow better maintenance for single loader
- removed a lot of mixins
- fixed Requester handling jobs on different grids ([#21](https://github.com/AlmostReliable/merequester/issues/21))

### Known Bugs

- ME Requester Terminal doesn't render correctly as item but works fine in world
- ME Requester Terminal renders with an empty front face
- scroll bar renders little sections on its background
- scroll bar is always visible

<!-- Links -->
[keep a changelog]: https://keepachangelog.com/en/1.0.0/
[semantic versioning]: https://semver.org/spec/v2.0.0.html

<!-- Versions -->
[1.1.6]: https://github.com/AlmostReliable/merequester/releases/tag/v1.20.4-neoforge-1.1.6
[1.1.5]: https://github.com/AlmostReliable/merequester/releases/tag/v1.20.4-neoforge-1.1.5
[1.1.4]: https://github.com/AlmostReliable/merequester/releases/tag/v1.20.4-1.1.4
[1.1.7]: https://github.com/AlmostReliable/merequester/releases/tag/v1.20.1-neoforge-1.1.7
114 changes: 102 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,40 +1,130 @@
@file:Suppress("UnstableApiUsage")

val license: String by project
val loggingLevel: String by project
val mixinDebugExport: String by project
val mcVersion: String by project
val modVersion: String by project
val modPackage: String by project
val modId: String by project
val modName: String by project
val modAuthor: String by project
val modDescription: String by project
val neoVersion: String by project
val parchmentVersion: String by project
val aeVersion: String by project
val emiVersion: String by project
val githubUser: String by project
val githubRepo: String by project

plugins {
id("net.neoforged.moddev") version "2.0.+"
id("com.almostreliable.almostgradle")
id("com.github.gmazzo.buildconfig") version "4.0.4"
java
}

almostgradle.setup {
withSourcesJar = false
recipeViewers.emi.mavenRepository
base {
version = "$mcVersion-$modVersion"
group = modPackage
archivesName.set("$modId-neoforge")
}

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

neoForge {
version = neoVersion

mods {
create("merequester") {
modSourceSets.add(sourceSets.main)
}
}

runs {
configureEach {
gameDirectory = project.file("run")
systemProperties = mapOf(
"forge.logging.console.level" to loggingLevel,
"mixin.debug.export" to mixinDebugExport,
"guideDev.ae2guide.sources" to file("guidebook").absolutePath,
"guideDev.ae2guide.sourcesNamespace" to almostgradle.modId
"guideDev.ae2guide.sourcesNamespace" to modId
)
jvmArguments.addAll("-XX:+IgnoreUnrecognizedVMOptions", "-XX:+AllowEnhancedClassRedefinition")
}
create("client") {
client()
programArguments.addAll("--quickPlaySingleplayer", "New World")
}

create("guide") {
client()
systemProperty("guideDev.ae2guide.startupPage", "${almostgradle.modId}:${almostgradle.modId}.md")
systemProperty("guideDev.ae2guide.startupPage", "$modId:$modId.md")
}
create("server") {
server()
}
}

parchment {
minecraftVersion = "1.21"
mappingsVersion = parchmentVersion
}
}

repositories {
maven("https://modmaven.dev")
maven("https://modmaven.dev") // Applied Energistics 2
maven("https://maven.blamejared.com") // JEI
maven("https://maven.shedaniel.me") // REI
maven("https://maven.terraformersmc.com") // EMI
mavenLocal()
}

dependencies {
implementation("appeng:appliedenergistics2:${almostgradle.getProperty("aeVersion")}")
implementation("appeng:appliedenergistics2:$aeVersion")
runtimeOnly("dev.emi:emi-neoforge:$emiVersion+1.21")
}

tasks.withType<Jar> {
from("guidebook") {
into("assets/${almostgradle.modId}/ae2guide")
tasks {
processResources {
val resourceTargets = listOf("META-INF/neoforge.mods.toml", "pack.mcmeta")

val replaceProperties = mapOf(
"license" to license,
"mcVersion" to mcVersion,
"version" to project.version as String,
"modId" to modId,
"modName" to modName,
"modAuthor" to modAuthor,
"modDescription" to modDescription,
"neoVersion" to neoVersion,
"aeVersion" to aeVersion,
"githubUser" to githubUser,
"githubRepo" to githubRepo
)

println("[Process Resources] Replacing properties in resources: ")
replaceProperties.forEach { (key, value) -> println("\t -> $key = $value") }

inputs.properties(replaceProperties)
filesMatching(resourceTargets) {
expand(replaceProperties)
}
}

withType<JavaCompile> {
options.encoding = "UTF-8"
}

withType<Jar> {
from("guidebook") {
into("assets/$modId/ae2guide")
}
}
}

buildConfig {
buildConfigField("String", "MOD_ID", "\"$modId\"")
buildConfigField("String", "MOD_NAME", "\"$modName\"")
buildConfigField("String", "MOD_VERSION", "\"$version\"")
packageName(modPackage)
useJavaOutput()
}
40 changes: 22 additions & 18 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
group = com.almostreliable
# Project
license = GNU Lesser General Public License v3.0
loom.platform = neoforge

# Settings
loggingLevel = debug
mixinDebugExport = false

# Minecraft
mcVersion = 1.21.1

# Mod
modVersion = 1.1.7
modPackage = com.almostreliable.merequester
modId = merequester
modName = ME Requester
modVersion = 1.1.6
minecraftVersion = 1.21.1
neoforgeVersion = 21.1.36

modAuthor = Almost Reliable
modDescription = Keep items and fluids in your ME-System in stock.
license = GNU Lesser General Public License v3.0
githubUser = AlmostReliable
githubRepo = merequester
modDescription = Keep resources in your ME-System in stock.

# Project Dependencies
neoForge.parchment.minecraftVersion = 1.21
neoForge.parchment.mappingsVersion = 2024.07.28
neoVersion = 21.1.36
parchmentVersion = 2024.07.28

# Mod Dependencies
aeVersion = 19.0.18-beta
aeVersion = 19.0.20-beta
emiVersion = 1.1.12

# Settings
almostgradle.buildconfig.name = ModConstants
almostgradle.launchArgs.autoWorldJoin = true
almostgradle.recipeViewers.emi.runConfig = true
almostgradle.recipeViewers.emi.version = 1.1.12
almostgradle.recipeViewers.emi.minecraftVersion = 1.21
# Github
githubUser = AlmostReliable
githubRepo = merequester
6 changes: 2 additions & 4 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ plugins {
}

val modName: String by extra
val minecraftVersion: String by extra
rootProject.name = "${modName.replace(" ", "-")}-$minecraftVersion-NeoForge"
val mcVersion: String by extra
rootProject.name = "${modName.replace(" ", "-")}-$mcVersion-NeoForge"

enableFeaturePreview("STABLE_CONFIGURATION_CACHE")

includeBuild("../../almostgradle")
4 changes: 2 additions & 2 deletions src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ description = '''${modDescription}'''
[[dependencies."${modId}"]]
modId = "neoforge"
type = "REQUIRED"
versionRange = "[${neoforgeVersion},)"
versionRange = "[${neoVersion},)"
ordering = "NONE"
side = "BOTH"

[[dependencies."${modId}"]]
modId = "minecraft"
type = "REQUIRED"
versionRange = "[${minecraftVersion},)"
versionRange = "[${mcVersion},)"
ordering = "NONE"
side = "BOTH"

Expand Down

0 comments on commit 8300ff2

Please sign in to comment.