mirror of
https://github.com/itHotL/PlayerStats.git
synced 2024-12-01 13:23:28 +01:00
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:
parent
455427772a
commit
c48f913f8a
@ -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.Target;
|
||||||
import com.artemis.the.gr8.playerstats.api.enums.Unit;
|
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 com.artemis.the.gr8.playerstats.core.utils.MyLogger;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
@ -11,7 +11,7 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/** Handles all PlayerStats' config-settings. */
|
/** Handles all PlayerStats' config-settings. */
|
||||||
public final class ConfigHandler extends FileHandler {
|
public final class ConfigHandler extends YamlFileHandler {
|
||||||
|
|
||||||
private static volatile ConfigHandler instance;
|
private static volatile ConfigHandler instance;
|
||||||
private final int configVersion;
|
private final int configVersion;
|
||||||
|
@ -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.Main;
|
||||||
import com.artemis.the.gr8.playerstats.core.utils.EnumHandler;
|
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 com.artemis.the.gr8.playerstats.api.enums.Unit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Statistic;
|
import org.bukkit.Statistic;
|
||||||
@ -22,7 +22,7 @@ import java.util.regex.Pattern;
|
|||||||
* A utility class that provides language keys to be
|
* A utility class that provides language keys to be
|
||||||
* put in a TranslatableComponent.
|
* put in a TranslatableComponent.
|
||||||
*/
|
*/
|
||||||
public final class LanguageKeyHandler extends FileHandler {
|
public final class LanguageKeyHandler extends YamlFileHandler {
|
||||||
|
|
||||||
private static volatile LanguageKeyHandler instance;
|
private static volatile LanguageKeyHandler instance;
|
||||||
private static HashMap<Statistic, String> statisticKeys;
|
private static HashMap<Statistic, String> statisticKeys;
|
||||||
|
@ -18,7 +18,7 @@ import java.util.function.Predicate;
|
|||||||
* calculations, and can retrieve the corresponding OfflinePlayer
|
* calculations, and can retrieve the corresponding OfflinePlayer
|
||||||
* object for a given player-name.
|
* object for a given player-name.
|
||||||
*/
|
*/
|
||||||
public final class OfflinePlayerHandler extends FileHandler {
|
public final class OfflinePlayerHandler extends YamlFileHandler {
|
||||||
|
|
||||||
private static volatile OfflinePlayerHandler instance;
|
private static volatile OfflinePlayerHandler instance;
|
||||||
private final ConfigHandler config;
|
private final ConfigHandler config;
|
||||||
|
@ -14,13 +14,13 @@ import java.util.Map;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public abstract class FileHandler implements Reloadable {
|
public abstract class YamlFileHandler implements Reloadable {
|
||||||
|
|
||||||
private final String fileName;
|
private final String fileName;
|
||||||
private File file;
|
private File file;
|
||||||
private FileConfiguration fileConfiguration;
|
private FileConfiguration fileConfiguration;
|
||||||
|
|
||||||
public FileHandler(String fileName) {
|
public YamlFileHandler(String fileName) {
|
||||||
this.fileName = fileName;
|
this.fileName = fileName;
|
||||||
loadFile();
|
loadFile();
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user