Skip to content

Commit 6802bfe

Browse files
committed
Fix fluid types not being localized
1 parent 0d71d67 commit 6802bfe

File tree

4 files changed

+31
-11
lines changed

4 files changed

+31
-11
lines changed

build.gradle

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ plugins {
33
id 'eclipse'
44
id 'idea'
55
id 'maven-publish'
6-
id 'net.neoforged.gradle.userdev' version '7.0.57'
7-
// id 'org.parchmentmc.librarian.forgegradle' version '1.+'
6+
id 'net.neoforged.gradle.userdev' version '7.0.93'
87
}
98

109
version = mod_version
@@ -73,6 +72,18 @@ runs {
7372
// Include resources generated by data generators.
7473
sourceSets.main.resources { srcDir 'src/generated/resources' }
7574

75+
repositories {
76+
maven {
77+
// location of the maven that hosts JEI files since January 2023
78+
name = "Jared's maven"
79+
url = "https://maven.blamejared.com/"
80+
}
81+
maven {
82+
// location of a maven mirror for JEI files, as a fallback
83+
name = "ModMaven"
84+
url = "https://modmaven.dev"
85+
}
86+
}
7687

7788
dependencies {
7889
// Specify the version of Minecraft to use.
@@ -87,7 +98,7 @@ dependencies {
8798
// The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
8899
// compileOnly "mezz.jei:jei-${mc_version}-common-api:${jei_version}"
89100
// compileOnly "mezz.jei:jei-${mc_version}-forge-api:${jei_version}"
90-
// runtimeOnly "mezz.jei:jei-${mc_version}-forge:${jei_version}"
101+
runtimeOnly("mezz.jei:jei-${minecraft_version}-neoforge:${jei_version}")
91102

92103
// Example mod dependency using a mod jar from ./libs with a flat dir repository
93104
// This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar

gradle.properties

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ minecraft_version=1.20.4
1313
# as they do not follow standard versioning conventions.
1414
minecraft_version_range=[1.20.2,1.21)
1515
# The Neo version must agree with the Minecraft version to get a valid artifact
16-
neo_version=20.4.73-beta
16+
neo_version=20.4.160-beta
1717
# The Neo version range can use any version of Neo as bounds or match the loader version range
1818
neo_version_range=[20.4.25,)
1919
# The loader version range can only use the major version of Neo/FML as bounds
2020
loader_version_range=[1,)
2121

22+
jei_version=17.3.0.49
23+
2224
# Parchment properties
2325
neogradle.subsystems.parchment.minecraftVersion=1.20.3
2426
neogradle.subsystems.parchment.mappingsVersion=2023.12.31
@@ -33,7 +35,7 @@ mod_name=Modular Materials
3335
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
3436
mod_license=LGPL-3.0
3537
# The mod version. See https://semver.org/
36-
mod_version=0.14.3-beta
38+
mod_version=0.14.4-beta
3739
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
3840
# This should match the base package used for the mod sources.
3941
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html

src/main/java/glowredman/modularmaterials/client/AssetHandler.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,13 @@ private static void generateLangFile() {
227227
}
228228

229229
for(MetaFluid fluid : MM_Reference.FLUIDS) {
230-
String key = "fluid." + MM_Reference.MODID + "." + fluid.registryName.getPath();
231-
if(!lang.containsKey(key)) {
232-
lang.put(key, fluid.getLocalizedName());
230+
String keyNormal = "fluid." + MM_Reference.MODID + "." + fluid.registryName.getPath();
231+
if(!lang.containsKey(keyNormal)) {
232+
lang.put(keyNormal, fluid.getLocalizedName());
233+
}
234+
String keyType = "fluid_type." + MM_Reference.MODID + "." + fluid.registryName.getPath();
235+
if(!lang.containsKey(keyType)) {
236+
lang.put(keyType, fluid.getLocalizedName());
233237
}
234238
}
235239

@@ -277,6 +281,7 @@ private static void generateLangFile() {
277281

278282
for(MetaFluid fluid : MM_Reference.FLUIDS) {
279283
lang.put("fluid." + MM_Reference.MODID + "." + fluid.registryName.getPath(), fluid.getLocalizedName());
284+
lang.put("fluid_type." + MM_Reference.MODID + "." + fluid.registryName.getPath(), fluid.getLocalizedName());
280285
}
281286

282287
for(MetaBlock block : MM_Reference.BLOCKS) {

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ description='''${mod_description}'''
4444
[[dependencies.${mod_id}]] #optional
4545
# the modid of the dependency
4646
modId="neoforge" #mandatory
47-
# Does this dependency have to exist - if not, ordering below must be specified
48-
mandatory=true #mandatory
47+
# The type of the dependency. Can be one of "required", "optional", "incompatible" or "discouraged" (case insensitive).
48+
# 'required' requires the mod to exist, 'optional' does not
49+
# 'incompatible' will prevent the game from loading when the mod exists, and 'discouraged' will show a warning
50+
type="required" #mandatory
4951
# The version range of the dependency
5052
versionRange="${neo_version_range}" #mandatory
5153
# An ordering relationship for the dependency - BEFORE or AFTER required if the dependency is not mandatory
@@ -57,7 +59,7 @@ description='''${mod_description}'''
5759
# Here's another dependency
5860
[[dependencies.${mod_id}]]
5961
modId="minecraft"
60-
mandatory=true
62+
type="required"
6163
# This version range declares a minimum of the current minecraft version up to but not including the next major version
6264
versionRange="${minecraft_version_range}"
6365
ordering="NONE"

0 commit comments

Comments
 (0)