Skip to content

Commit 1a1e059

Browse files
committed
switch to old project setup until plugin is released
1 parent 0d7b16e commit 1a1e059

File tree

10 files changed

+144
-85
lines changed

10 files changed

+144
-85
lines changed

CHANGELOG.md

+7-40
Original file line numberDiff line numberDiff line change
@@ -5,56 +5,23 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog],
66
and this project adheres to [Semantic Versioning].
77

8-
## [1.1.6] - 2024-03-29
8+
## [1.1.7] - 2024-09-03
99

10-
### Changed
11-
12-
- switched to proper screen registration and removed mixin
13-
- moved ME Requester Terminal model and textures to own namespace
14-
15-
### Fixed
16-
17-
- fixed ME Requester Terminal item not showing its face texture
18-
19-
## [1.1.5] - 2024-03-28
20-
21-
### Changed
22-
23-
- updated to new Applied Energistics version for API changes
24-
- new minimum version is 17.12.1-beta
10+
Initial 1.21.1 release!
2511

2612
### Fixed
2713

28-
- fixed ME Requester from disconnecting after world restart
29-
- fixed connectable sides not being exposed correctly
30-
31-
## [1.1.4] - 2024-03-25
32-
33-
Initial 1.20.4 release!
34-
35-
### Added
36-
37-
- added an in-depth explanation to the AE2 guidebook
38-
39-
### Changed
40-
41-
- reworked registration logic
42-
- switched to new API for drag and drop logic
43-
44-
### Removed
45-
46-
- removed platform specific code to allow better maintenance for single loader
47-
- removed a lot of mixins
14+
- fixed Requester handling jobs on different grids ([#21](https://github.com/AlmostReliable/merequester/issues/21))
4815

4916
### Known Bugs
5017

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

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

5726
<!-- Versions -->
58-
[1.1.6]: https://github.com/AlmostReliable/merequester/releases/tag/v1.20.4-neoforge-1.1.6
59-
[1.1.5]: https://github.com/AlmostReliable/merequester/releases/tag/v1.20.4-neoforge-1.1.5
60-
[1.1.4]: https://github.com/AlmostReliable/merequester/releases/tag/v1.20.4-1.1.4
27+
[1.1.7]: https://github.com/AlmostReliable/merequester/releases/tag/v1.20.1-neoforge-1.1.7

build.gradle.kts

+102-12
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,130 @@
1+
@file:Suppress("UnstableApiUsage")
2+
3+
val license: String by project
4+
val loggingLevel: String by project
5+
val mixinDebugExport: String by project
6+
val mcVersion: String by project
7+
val modVersion: String by project
8+
val modPackage: String by project
9+
val modId: String by project
10+
val modName: String by project
11+
val modAuthor: String by project
12+
val modDescription: String by project
13+
val neoVersion: String by project
14+
val parchmentVersion: String by project
15+
val aeVersion: String by project
16+
val emiVersion: String by project
17+
val githubUser: String by project
18+
val githubRepo: String by project
19+
120
plugins {
221
id("net.neoforged.moddev") version "2.0.+"
3-
id("com.almostreliable.almostgradle")
22+
id("com.github.gmazzo.buildconfig") version "4.0.4"
23+
java
424
}
525

6-
almostgradle.setup {
7-
withSourcesJar = false
8-
recipeViewers.emi.mavenRepository
26+
base {
27+
version = "$mcVersion-$modVersion"
28+
group = modPackage
29+
archivesName.set("$modId-neoforge")
930
}
1031

32+
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
33+
1134
neoForge {
35+
version = neoVersion
36+
37+
mods {
38+
create("merequester") {
39+
modSourceSets.add(sourceSets.main)
40+
}
41+
}
42+
1243
runs {
1344
configureEach {
45+
gameDirectory = project.file("run")
1446
systemProperties = mapOf(
47+
"forge.logging.console.level" to loggingLevel,
48+
"mixin.debug.export" to mixinDebugExport,
1549
"guideDev.ae2guide.sources" to file("guidebook").absolutePath,
16-
"guideDev.ae2guide.sourcesNamespace" to almostgradle.modId
50+
"guideDev.ae2guide.sourcesNamespace" to modId
1751
)
52+
jvmArguments.addAll("-XX:+IgnoreUnrecognizedVMOptions", "-XX:+AllowEnhancedClassRedefinition")
53+
}
54+
create("client") {
55+
client()
56+
programArguments.addAll("--quickPlaySingleplayer", "New World")
1857
}
19-
2058
create("guide") {
2159
client()
22-
systemProperty("guideDev.ae2guide.startupPage", "${almostgradle.modId}:${almostgradle.modId}.md")
60+
systemProperty("guideDev.ae2guide.startupPage", "$modId:$modId.md")
61+
}
62+
create("server") {
63+
server()
2364
}
2465
}
66+
67+
parchment {
68+
minecraftVersion = "1.21"
69+
mappingsVersion = parchmentVersion
70+
}
2571
}
2672

2773
repositories {
28-
maven("https://modmaven.dev")
74+
maven("https://modmaven.dev") // Applied Energistics 2
75+
maven("https://maven.blamejared.com") // JEI
76+
maven("https://maven.shedaniel.me") // REI
77+
maven("https://maven.terraformersmc.com") // EMI
2978
mavenLocal()
3079
}
3180

3281
dependencies {
33-
implementation("appeng:appliedenergistics2:${almostgradle.getProperty("aeVersion")}")
82+
implementation("appeng:appliedenergistics2:$aeVersion")
83+
runtimeOnly("dev.emi:emi-neoforge:$emiVersion+1.21")
3484
}
3585

36-
tasks.withType<Jar> {
37-
from("guidebook") {
38-
into("assets/${almostgradle.modId}/ae2guide")
86+
tasks {
87+
processResources {
88+
val resourceTargets = listOf("META-INF/neoforge.mods.toml", "pack.mcmeta")
89+
90+
val replaceProperties = mapOf(
91+
"license" to license,
92+
"mcVersion" to mcVersion,
93+
"version" to project.version as String,
94+
"modId" to modId,
95+
"modName" to modName,
96+
"modAuthor" to modAuthor,
97+
"modDescription" to modDescription,
98+
"neoVersion" to neoVersion,
99+
"aeVersion" to aeVersion,
100+
"githubUser" to githubUser,
101+
"githubRepo" to githubRepo
102+
)
103+
104+
println("[Process Resources] Replacing properties in resources: ")
105+
replaceProperties.forEach { (key, value) -> println("\t -> $key = $value") }
106+
107+
inputs.properties(replaceProperties)
108+
filesMatching(resourceTargets) {
109+
expand(replaceProperties)
110+
}
111+
}
112+
113+
withType<JavaCompile> {
114+
options.encoding = "UTF-8"
115+
}
116+
117+
withType<Jar> {
118+
from("guidebook") {
119+
into("assets/$modId/ae2guide")
120+
}
39121
}
40122
}
123+
124+
buildConfig {
125+
buildConfigField("String", "MOD_ID", "\"$modId\"")
126+
buildConfigField("String", "MOD_NAME", "\"$modName\"")
127+
buildConfigField("String", "MOD_VERSION", "\"$version\"")
128+
packageName(modPackage)
129+
useJavaOutput()
130+
}

gradle.properties

+22-18
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
1-
group = com.almostreliable
1+
# Project
2+
license = GNU Lesser General Public License v3.0
3+
loom.platform = neoforge
4+
5+
# Settings
6+
loggingLevel = debug
7+
mixinDebugExport = false
8+
9+
# Minecraft
10+
mcVersion = 1.21.1
11+
12+
# Mod
13+
modVersion = 1.1.7
14+
modPackage = com.almostreliable.merequester
215
modId = merequester
316
modName = ME Requester
4-
modVersion = 1.1.6
5-
minecraftVersion = 1.21.1
6-
neoforgeVersion = 21.1.36
7-
817
modAuthor = Almost Reliable
9-
modDescription = Keep items and fluids in your ME-System in stock.
10-
license = GNU Lesser General Public License v3.0
11-
githubUser = AlmostReliable
12-
githubRepo = merequester
18+
modDescription = Keep resources in your ME-System in stock.
1319

1420
# Project Dependencies
15-
neoForge.parchment.minecraftVersion = 1.21
16-
neoForge.parchment.mappingsVersion = 2024.07.28
21+
neoVersion = 21.1.36
22+
parchmentVersion = 2024.07.28
1723

1824
# Mod Dependencies
19-
aeVersion = 19.0.18-beta
25+
aeVersion = 19.0.20-beta
26+
emiVersion = 1.1.12
2027

21-
# Settings
22-
almostgradle.buildconfig.name = ModConstants
23-
almostgradle.launchArgs.autoWorldJoin = true
24-
almostgradle.recipeViewers.emi.runConfig = true
25-
almostgradle.recipeViewers.emi.version = 1.1.12
26-
almostgradle.recipeViewers.emi.minecraftVersion = 1.21
28+
# Github
29+
githubUser = AlmostReliable
30+
githubRepo = merequester

settings.gradle.kts

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ plugins {
33
}
44

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

99
enableFeaturePreview("STABLE_CONFIGURATION_CACHE")
10-
11-
includeBuild("../../almostgradle")

src/main/java/com/almostreliable/merequester/MERequester.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import net.neoforged.fml.config.ModConfig;
1111
import org.slf4j.Logger;
1212

13-
@Mod(ModConstants.MOD_ID)
13+
@Mod(BuildConfig.MOD_ID)
1414
public final class MERequester {
1515

1616
public static final Logger LOGGER = LogUtils.getLogger();

src/main/java/com/almostreliable/merequester/MERequesterClient.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import net.neoforged.neoforge.client.event.RegisterColorHandlersEvent;
1515
import net.neoforged.neoforge.client.event.RegisterMenuScreensEvent;
1616

17-
@Mod(value = ModConstants.MOD_ID, dist = Dist.CLIENT)
17+
@Mod(value = BuildConfig.MOD_ID, dist = Dist.CLIENT)
1818
public final class MERequesterClient {
1919

2020
public MERequesterClient(IEventBus modEventBus) {

src/main/java/com/almostreliable/merequester/Registration.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030

3131
public final class Registration {
3232

33-
public static final DeferredRegister.Blocks BLOCKS = DeferredRegister.createBlocks(ModConstants.MOD_ID);
34-
public static final DeferredRegister.Items ITEMS = DeferredRegister.createItems(ModConstants.MOD_ID);
33+
public static final DeferredRegister.Blocks BLOCKS = DeferredRegister.createBlocks(BuildConfig.MOD_ID);
34+
public static final DeferredRegister.Items ITEMS = DeferredRegister.createItems(BuildConfig.MOD_ID);
3535
public static final DeferredRegister<BlockEntityType<?>> BLOCK_ENTITY_TYPES = DeferredRegister.create(
3636
Registries.BLOCK_ENTITY_TYPE,
37-
ModConstants.MOD_ID
37+
BuildConfig.MOD_ID
3838
);
3939

4040
public static final DeferredBlock<RequesterBlock> REQUESTER_BLOCK = BLOCKS.registerBlock(

src/main/java/com/almostreliable/merequester/Utils.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public final class Utils {
1414
private Utils() {}
1515

1616
public static ResourceLocation getRL(String path) {
17-
return ResourceLocation.fromNamespaceAndPath(ModConstants.MOD_ID, path);
17+
return ResourceLocation.fromNamespaceAndPath(BuildConfig.MOD_ID, path);
1818
}
1919

2020
public static int fillColorAlpha(ChatFormatting color) {
@@ -23,7 +23,7 @@ public static int fillColorAlpha(ChatFormatting color) {
2323
}
2424

2525
public static MutableComponent translate(String type, String key, Object... args) {
26-
return Component.translatable(String.format("%s.%s.%s", type, ModConstants.MOD_ID, key), args);
26+
return Component.translatable(String.format("%s.%s.%s", type, BuildConfig.MOD_ID, key), args);
2727
}
2828

2929
public static String translateAsString(String type, String key) {

src/main/java/com/almostreliable/merequester/data/MERequesterData.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import net.minecraft.core.component.DataComponentType;
44
import net.minecraft.network.codec.ByteBufCodecs;
55

6-
import com.almostreliable.merequester.ModConstants;
6+
import com.almostreliable.merequester.BuildConfig;
77

88
import net.neoforged.neoforge.registries.DeferredRegister;
99

@@ -15,7 +15,7 @@ public final class MERequesterData {
1515
private MERequesterData() {}
1616

1717
public static final DeferredRegister.DataComponents DR = DeferredRegister
18-
.createDataComponents(ModConstants.MOD_ID);
18+
.createDataComponents(BuildConfig.MOD_ID);
1919

2020
public static final DataComponentType<List<MERequesterRequest>> EXPORTED_REQUESTER_REQUESTS = register("exported_requests", builder -> {
2121
builder.persistent(MERequesterRequest.CODEC.listOf())

src/main/resources/META-INF/neoforge.mods.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ description = '''${modDescription}'''
1717
[[dependencies."${modId}"]]
1818
modId = "neoforge"
1919
type = "REQUIRED"
20-
versionRange = "[${neoforgeVersion},)"
20+
versionRange = "[${neoVersion},)"
2121
ordering = "NONE"
2222
side = "BOTH"
2323

2424
[[dependencies."${modId}"]]
2525
modId = "minecraft"
2626
type = "REQUIRED"
27-
versionRange = "[${minecraftVersion},)"
27+
versionRange = "[${mcVersion},)"
2828
ordering = "NONE"
2929
side = "BOTH"
3030

0 commit comments

Comments
 (0)