Skip to content

Commit

Permalink
Fix fluid types not being localized
Browse files Browse the repository at this point in the history
  • Loading branch information
glowredman committed Feb 16, 2024
1 parent 0d71d67 commit 6802bfe
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
17 changes: 14 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ plugins {
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version '7.0.57'
// id 'org.parchmentmc.librarian.forgegradle' version '1.+'
id 'net.neoforged.gradle.userdev' version '7.0.93'
}

version = mod_version
Expand Down Expand Up @@ -73,6 +72,18 @@ runs {
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }

repositories {
maven {
// location of the maven that hosts JEI files since January 2023
name = "Jared's maven"
url = "https://maven.blamejared.com/"
}
maven {
// location of a maven mirror for JEI files, as a fallback
name = "ModMaven"
url = "https://modmaven.dev"
}
}

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

// Example mod dependency using a mod jar from ./libs with a flat dir repository
// This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar
Expand Down
6 changes: 4 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ minecraft_version=1.20.4
# as they do not follow standard versioning conventions.
minecraft_version_range=[1.20.2,1.21)
# The Neo version must agree with the Minecraft version to get a valid artifact
neo_version=20.4.73-beta
neo_version=20.4.160-beta
# The Neo version range can use any version of Neo as bounds or match the loader version range
neo_version_range=[20.4.25,)
# The loader version range can only use the major version of Neo/FML as bounds
loader_version_range=[1,)

jei_version=17.3.0.49

# Parchment properties
neogradle.subsystems.parchment.minecraftVersion=1.20.3
neogradle.subsystems.parchment.mappingsVersion=2023.12.31
Expand All @@ -33,7 +35,7 @@ mod_name=Modular Materials
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=LGPL-3.0
# The mod version. See https://semver.org/
mod_version=0.14.3-beta
mod_version=0.14.4-beta
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,13 @@ private static void generateLangFile() {
}

for(MetaFluid fluid : MM_Reference.FLUIDS) {
String key = "fluid." + MM_Reference.MODID + "." + fluid.registryName.getPath();
if(!lang.containsKey(key)) {
lang.put(key, fluid.getLocalizedName());
String keyNormal = "fluid." + MM_Reference.MODID + "." + fluid.registryName.getPath();
if(!lang.containsKey(keyNormal)) {
lang.put(keyNormal, fluid.getLocalizedName());
}
String keyType = "fluid_type." + MM_Reference.MODID + "." + fluid.registryName.getPath();
if(!lang.containsKey(keyType)) {
lang.put(keyType, fluid.getLocalizedName());
}
}

Expand Down Expand Up @@ -277,6 +281,7 @@ private static void generateLangFile() {

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

for(MetaBlock block : MM_Reference.BLOCKS) {
Expand Down
8 changes: 5 additions & 3 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ description='''${mod_description}'''
[[dependencies.${mod_id}]] #optional
# the modid of the dependency
modId="neoforge" #mandatory
# Does this dependency have to exist - if not, ordering below must be specified
mandatory=true #mandatory
# The type of the dependency. Can be one of "required", "optional", "incompatible" or "discouraged" (case insensitive).
# 'required' requires the mod to exist, 'optional' does not
# 'incompatible' will prevent the game from loading when the mod exists, and 'discouraged' will show a warning
type="required" #mandatory
# The version range of the dependency
versionRange="${neo_version_range}" #mandatory
# An ordering relationship for the dependency - BEFORE or AFTER required if the dependency is not mandatory
Expand All @@ -57,7 +59,7 @@ description='''${mod_description}'''
# Here's another dependency
[[dependencies.${mod_id}]]
modId="minecraft"
mandatory=true
type="required"
# This version range declares a minimum of the current minecraft version up to but not including the next major version
versionRange="${minecraft_version_range}"
ordering="NONE"
Expand Down

0 comments on commit 6802bfe

Please sign in to comment.