Compare commits

...

2 commits

Author SHA1 Message Date
Oth3r
71eb10a2a0
v1.2.4.5 2025-06-24 14:00:33 -05:00
Oth3r
7a54b0a75a
otterlib 0.2.1.0 port 2025-06-24 13:50:23 -05:00
3 changed files with 9 additions and 21 deletions

View file

@ -1,3 +1,7 @@
# v1.2.4.5
* bumped OtterLib version to `0.2.1.0`
* fixed default languages files not being able to be loaded
# v1.2.4.4
* bumped OtterLib version to `0.2.0.0`
* now relies on OtterLib Language Reader

View file

@ -13,12 +13,12 @@ yarn_mappings=1.21.6+build.1
loader_version=0.16.14
# Mod Properties
mod_version=1.2.4.4+1.21.6
mod_version=1.2.4.5+1.21.6
maven_group=one.oth3r
file_name=sit!
# Dependencies
fabric_version=0.127.1+1.21.6
modmenu_version=15.0.0-beta.1
otterlib_version=0.2.0.0+1.21.6-fabric
otterlib_version=0.2.1.0+1.21.6-fabric
otterlib_max_version=0.3.0.0+1.21.6-fabric

View file

@ -2,14 +2,11 @@ package one.oth3r.sit.file;
import net.minecraft.server.network.ServerPlayerEntity;
import one.oth3r.otterlib.file.LanguageReader;
import one.oth3r.otterlib.file.ResourceReader;
import one.oth3r.sit.Sit;
import one.oth3r.sit.utl.Data;
import one.oth3r.sit.utl.Utl;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@ -64,7 +61,8 @@ public class FileData {
/// the language / text system for the mod
private static final LanguageReader langReader = new LanguageReader(
getLangPath(),Path.of(Data.CONFIG_DIR),"en_us","en_us");
new ResourceReader("assets/sit-oth3r/lang/",Sit.class.getClassLoader()),
new ResourceReader(Data.CONFIG_DIR),"en_us","en_us");
public static LanguageReader getLangReader() {
return langReader;
@ -93,20 +91,6 @@ public class FileData {
getServerConfig().save();
}
private static Path getLangPath() {
ClassLoader classLoader = Sit.class.getClassLoader();
URL resource = classLoader.getResource("assets/sit-oth3r/lang/");
if (resource == null) {
throw new RuntimeException("Language file not found.");
}
try {
return Paths.get(resource.toURI());
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
}
public static class Defaults {
public static final ArrayList<SittingBlock> SITTING_BLOCKS = new ArrayList<>(Arrays.asList(
new SittingBlock(new ArrayList<>(),new ArrayList<>(Arrays.asList("#minecraft:campfires")), new ArrayList<>(Arrays.asList("lit=false")),.437),