Added blocks, items and entities to language.yml to prepare for more manual translation options and renamed FileHandler to YamlFileHandler

This commit is contained in:
Artemis-the-gr8 2023-06-19 13:39:43 +02:00
parent 455427772a
commit c48f913f8a
5 changed files with 2466 additions and 27 deletions

View File

@ -2,7 +2,7 @@ package com.artemis.the.gr8.playerstats.core.config;
import com.artemis.the.gr8.playerstats.api.enums.Target;
import com.artemis.the.gr8.playerstats.api.enums.Unit;
import com.artemis.the.gr8.playerstats.core.utils.FileHandler;
import com.artemis.the.gr8.playerstats.core.utils.YamlFileHandler;
import com.artemis.the.gr8.playerstats.core.utils.MyLogger;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.FileConfiguration;
@ -11,7 +11,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.Map;
/** Handles all PlayerStats' config-settings. */
public final class ConfigHandler extends FileHandler {
public final class ConfigHandler extends YamlFileHandler {
private static volatile ConfigHandler instance;
private final int configVersion;

View File

@ -2,7 +2,7 @@ package com.artemis.the.gr8.playerstats.core.msg.msgutils;
import com.artemis.the.gr8.playerstats.core.Main;
import com.artemis.the.gr8.playerstats.core.utils.EnumHandler;
import com.artemis.the.gr8.playerstats.core.utils.FileHandler;
import com.artemis.the.gr8.playerstats.core.utils.YamlFileHandler;
import com.artemis.the.gr8.playerstats.api.enums.Unit;
import org.bukkit.Material;
import org.bukkit.Statistic;
@ -22,7 +22,7 @@ import java.util.regex.Pattern;
* A utility class that provides language keys to be
* put in a TranslatableComponent.
*/
public final class LanguageKeyHandler extends FileHandler {
public final class LanguageKeyHandler extends YamlFileHandler {
private static volatile LanguageKeyHandler instance;
private static HashMap<Statistic, String> statisticKeys;

View File

@ -18,7 +18,7 @@ import java.util.function.Predicate;
* calculations, and can retrieve the corresponding OfflinePlayer
* object for a given player-name.
*/
public final class OfflinePlayerHandler extends FileHandler {
public final class OfflinePlayerHandler extends YamlFileHandler {
private static volatile OfflinePlayerHandler instance;
private final ConfigHandler config;

View File

@ -14,13 +14,13 @@ import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
public abstract class FileHandler implements Reloadable {
public abstract class YamlFileHandler implements Reloadable {
private final String fileName;
private File file;
private FileConfiguration fileConfiguration;
public FileHandler(String fileName) {
public YamlFileHandler(String fileName) {
this.fileName = fileName;
loadFile();
}

File diff suppressed because it is too large Load Diff