Update Language class to no longer use deprecated features

This commit is contained in:
GeorgH93 2021-05-31 22:12:23 +02:00
parent 736e7d5b19
commit 18650d561b
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8

View File

@ -19,9 +19,11 @@
import at.pcgamingfreaks.Version; import at.pcgamingfreaks.Version;
import at.pcgamingfreaks.YamlFileManager; import at.pcgamingfreaks.YamlFileManager;
import at.pcgamingfreaks.YamlFileUpdateMethod;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -33,11 +35,16 @@ public class Language extends at.pcgamingfreaks.Bukkit.Language
public Language(final @NotNull JavaPlugin plugin) public Language(final @NotNull JavaPlugin plugin)
{ {
super(plugin, LANG_VERSION, LANG_VERSION); super(plugin, new Version(LANG_VERSION));
} }
@Override @Override
protected void doUpdate() {} protected @Nullable YamlFileUpdateMethod getYamlUpdateMode()
{
YamlFileUpdateMethod mode = super.getYamlUpdateMode();
if(mode == YamlFileUpdateMethod.UPDATE) mode = YamlFileUpdateMethod.UPGRADE;
return mode;
}
@Override @Override
protected void doUpgrade(final @NotNull YamlFileManager oldLang) protected void doUpgrade(final @NotNull YamlFileManager oldLang)