mirror of
https://github.com/Oth3r/Sit.git
synced 2025-09-19 16:03:22 +02:00
otterlib 0.2.1.0 port
This commit is contained in:
parent
6dcd99c12a
commit
7a54b0a75a
1 changed files with 3 additions and 19 deletions
|
@ -2,14 +2,11 @@ package one.oth3r.sit.file;
|
||||||
|
|
||||||
import net.minecraft.server.network.ServerPlayerEntity;
|
import net.minecraft.server.network.ServerPlayerEntity;
|
||||||
import one.oth3r.otterlib.file.LanguageReader;
|
import one.oth3r.otterlib.file.LanguageReader;
|
||||||
|
import one.oth3r.otterlib.file.ResourceReader;
|
||||||
import one.oth3r.sit.Sit;
|
import one.oth3r.sit.Sit;
|
||||||
import one.oth3r.sit.utl.Data;
|
import one.oth3r.sit.utl.Data;
|
||||||
import one.oth3r.sit.utl.Utl;
|
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.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -64,7 +61,8 @@ public class FileData {
|
||||||
|
|
||||||
/// the language / text system for the mod
|
/// the language / text system for the mod
|
||||||
private static final LanguageReader langReader = new LanguageReader(
|
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() {
|
public static LanguageReader getLangReader() {
|
||||||
return langReader;
|
return langReader;
|
||||||
|
@ -93,20 +91,6 @@ public class FileData {
|
||||||
getServerConfig().save();
|
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 class Defaults {
|
||||||
public static final ArrayList<SittingBlock> SITTING_BLOCKS = new ArrayList<>(Arrays.asList(
|
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),
|
new SittingBlock(new ArrayList<>(),new ArrayList<>(Arrays.asList("#minecraft:campfires")), new ArrayList<>(Arrays.asList("lit=false")),.437),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue