feat: add basic data loading and translations

This commit is contained in:
Sekwah 2023-04-07 00:04:42 +01:00
parent 53a4deb9ab
commit 9545f75a46
No known key found for this signature in database
GPG Key ID: 9E0D654FC942286D
17 changed files with 545 additions and 92 deletions

View File

@ -1,27 +1,61 @@
package com.sekwah.advancedportals.core;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.sekwah.advancedportals.core.config.CoreModule;
import com.sekwah.advancedportals.core.data.DataStorage;
import com.sekwah.advancedportals.core.module.AdvancedPortalsModule;
import com.sekwah.advancedportals.core.repository.ConfigRepository;
import com.sekwah.advancedportals.core.util.InfoLogger;
import com.sekwah.advancedportals.core.util.Lang;
import java.io.File;
public class AdvancedPortalsCore {
/**
* https://github.com/google/guice/wiki/GettingStarted
*
*/
private Injector injector = Guice.createInjector(new CoreModule(this));
private final InfoLogger infoLogger;
private final DataStorage dataStorage;
private final AdvancedPortalsModule module;
private final ConfigRepository configRepository;
public AdvancedPortalsCore(File dataStorageLoc, InfoLogger infoLogger) {
this.dataStorage = new DataStorage(dataStorageLoc);
this.infoLogger = infoLogger;
this.module = new AdvancedPortalsModule(this);
this.configRepository = module.getInjector().getInstance(ConfigRepository.class);
module.getInjector().injectMembers(Lang.instance);
}
/**
* For some platforms we could do this on construction but this just allows for a bit more control
*/
public void onEnable() {
AdvancedPortalsModule module = new AdvancedPortalsModule(this);
injector = module.getInjector();
//AdvancedPortalsModule module = new AdvancedPortalsModule(this);
this.dataStorage.copyDefaultFile("lang/en_GB.lang", false);
this.loadPortalConfig();
Lang.loadLanguage(configRepository.getTranslation());
this.infoLogger.log(Lang.translate("logger.pluginenable"));
}
/**
* Loads the portal config into the memory and saves from the memory to check in case certain things have changed
* (basically if values are missing or whatever)
*/
public void loadPortalConfig() {
this.configRepository.loadConfig(this.dataStorage);
this.dataStorage.storeJson(this.configRepository, "config.json");
}
public void onDisable() {
this.infoLogger.log(Lang.translate("logger.plugindisable"));
}
public InfoLogger getInfoLogger() {
return this.infoLogger;
}
public DataStorage getDataStorage() {
return this.dataStorage;
}
}

View File

@ -1,38 +0,0 @@
package com.sekwah.advancedportals.core;
import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.sekwah.advancedportals.core.config.Config;
import com.sekwah.advancedportals.core.config.ConfigHandler;
import javax.annotation.Nonnull;
public class AdvancedPortalsModule extends AbstractModule {
private Injector injector;
private AdvancedPortalsCore advancedPortalsCore;
public AdvancedPortalsModule(AdvancedPortalsCore advancedPortalsCore) {
this.advancedPortalsCore = advancedPortalsCore;
}
@Override
protected void configure() {
// Instances
bind(AdvancedPortalsCore.class).toInstance(advancedPortalsCore);
// Providers
bind(Config.class).toProvider(ConfigHandler.class);
}
public Injector createInjector() {
return Guice.createInjector(this);
}
@Nonnull
public Injector getInjector() {
return injector;
}
}

View File

@ -2,7 +2,7 @@ package com.sekwah.advancedportals.core.config;
import com.google.inject.Provider;
public class ConfigHandler implements Provider<Config> {
public class ConfigProvider implements Provider<Config> {
@Override
public Config get() {
return null;

View File

@ -1,33 +0,0 @@
package com.sekwah.advancedportals.core.config;
import com.google.inject.AbstractModule;
import com.google.inject.Provides;
import com.sekwah.advancedportals.core.AdvancedPortalsCore;
public class CoreModule extends AbstractModule {
private final AdvancedPortalsCore portalsCore;
/**
* Parts provided by the core module. Check the implementation for its individual integrations.
* @param portalsCore
*/
public CoreModule(AdvancedPortalsCore portalsCore) {
this.portalsCore = portalsCore;
}
@Override
protected void configure() {
// bind(IPortalRepository.class).to(PortalRepository.class).in(Scopes.SINGLETON);
// bind(IDestinationRepository.class).to(DestinationRepository.class).in(Scopes.SINGLETON);
// bind(IPortalRepository.class).to(PortalRepository.class).in(Scopes.SINGLETON);
// bind(ConfigRepository.class).to(ConfigRepositoryImpl.class).in(Scopes.SINGLETON);
//bindListener(Matchers.Any(), new Log4JTypeListenr());
}
// https://github.com/google/guice/wiki/GettingStarted
@Provides
AdvancedPortalsCore providePortalsCore() {
return this.portalsCore;
}
}

View File

@ -4,7 +4,7 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.inject.Inject;
import com.sekwah.advancedportals.core.AdvancedPortalsCore;
import com.sekwah.advancedportals.util.InfoLogger;
import com.sekwah.advancedportals.core.util.InfoLogger;
import java.io.*;
import java.lang.reflect.InvocationTargetException;

View File

@ -0,0 +1,48 @@
package com.sekwah.advancedportals.core.module;
import com.google.inject.*;
import com.sekwah.advancedportals.core.AdvancedPortalsCore;
import com.sekwah.advancedportals.core.config.Config;
import com.sekwah.advancedportals.core.config.ConfigProvider;
import com.sekwah.advancedportals.core.data.DataStorage;
import com.sekwah.advancedportals.core.repository.ConfigRepository;
import com.sekwah.advancedportals.core.repository.ConfigRepositoryImpl;
import com.sekwah.advancedportals.core.util.InfoLogger;
import javax.annotation.Nonnull;
public class AdvancedPortalsModule extends AbstractModule {
private Injector injector;
private AdvancedPortalsCore advancedPortalsCore;
public AdvancedPortalsModule(AdvancedPortalsCore advancedPortalsCore) {
this.advancedPortalsCore = advancedPortalsCore;
createInjector();
}
@Override
protected void configure() {
// Instances
bind(AdvancedPortalsCore.class).toInstance(advancedPortalsCore);
bind(InfoLogger.class).toInstance(advancedPortalsCore.getInfoLogger());
bind(DataStorage.class).toInstance(advancedPortalsCore.getDataStorage());
bind(ConfigRepository.class).to(ConfigRepositoryImpl.class).in(Scopes.SINGLETON);
// Providers
bind(Config.class).toProvider(ConfigProvider.class);
}
public Injector createInjector() {
if(injector == null) {
injector = Guice.createInjector(this);
}
return injector;
}
@Nonnull
public Injector getInjector() {
return injector;
}
}

View File

@ -0,0 +1,16 @@
package com.sekwah.advancedportals.core.repository;
import com.sekwah.advancedportals.core.data.DataStorage;
public interface ConfigRepository {
boolean getUseOnlySpecialAxe();
void setUseOnlySpecialAxe(boolean useOnlyServerMadeAxe);
String getTranslation();
String getSelectorMaterial();
void loadConfig(DataStorage dataStorage);
}

View File

@ -0,0 +1,50 @@
package com.sekwah.advancedportals.core.repository;
import com.google.inject.Singleton;
import com.sekwah.advancedportals.core.config.Config;
import com.sekwah.advancedportals.core.data.DataStorage;
import java.util.HashMap;
@Singleton
public class ConfigRepositoryImpl implements ConfigRepository {
private HashMap<String, Config> configs;
private Config config;
public ConfigRepositoryImpl() {
configs = new HashMap<String,Config>();
}
public <T> T getValue(String output) {
try {
return (T) configs.get(output);
} catch (ClassCastException ignored) {
}
return null;
}
public boolean getUseOnlySpecialAxe() {
return this.config.useOnlySpecialAxe;
}
public void setUseOnlySpecialAxe(boolean useOnlyServerMadeAxe) {
this.config.useOnlySpecialAxe = useOnlyServerMadeAxe;
}
public String getTranslation() {
return this.config.translationFile;
}
public String getSelectorMaterial() {
return this.config.selectorMaterial;
}
@Override
public void loadConfig(DataStorage dataStorage) {
this.config = dataStorage.loadJson(Config.class, "config.json");
}
}

View File

@ -1,4 +1,4 @@
package com.sekwah.advancedportals.util;
package com.sekwah.advancedportals.core.util;
public abstract class InfoLogger {

View File

@ -1,4 +1,4 @@
package com.sekwah.advancedportals.util;
package com.sekwah.advancedportals.core.util;
import com.google.inject.Inject;
import com.sekwah.advancedportals.core.AdvancedPortalsCore;
@ -22,7 +22,7 @@ import java.util.Scanner;
*/
public class Lang {
private static final Lang instance = new Lang();
public static final Lang instance = new Lang();
private final HashMap<String, String> languageMap = new HashMap<>();
@Inject

View File

@ -1,4 +1,4 @@
package com.sekwah.advancedportals.util;
package com.sekwah.advancedportals.core.util;
import com.sekwah.advancedportals.core.data.DataTag;

View File

@ -0,0 +1,91 @@
# Same as default minecraft lang files but can handle comments if a # is the first character
# Anything not set in translations will be defaulted back to the en_GB file.
# The default en_GB will always be loaded before any other file, even if you make a new en_GB so that new strings
# do not have blank values possibly making new features unusable.
#
# The format of included strings is %(number of argument)$s (starts at 1 not 0)
# So the order of variables being inserted into the string is not a set order. Just like minecraft
#
# For colors use \u00A7 or § (can be entered by holding alt and pressing 2 then 1 on the numpad)
# http://minecraft.gamepedia.com/Formatting_codes
#
# Also note that some debug messages may not be listed here for translation.
#
# German - Translation by enterih from Minecityelan.net
# Falls ihr ein Fehler oder Unschönheit findet meldet es auf Github und markiert mich mit @Sprungente
#
translatedata.lastchange=1.0.0
translatedata.translationsoutdated= Einige Übersetzungen von \u00A7e%1$s\u00A7c sind nicht aktuell.
translatedata.replacecommand= Verwende \u00A7e/portal transupdate\u00A7c um eine standard \u00A7ede_DE\u00A7c Datei zu erstellen.
translatedata.replaced= Eine neue \u00A7ede_DE\u00A7a wurde in den ordner kopiert.
messageprefix.positive=\u00A7a[\u00A7eAdvancedPortals\u00A7a]
messageprefix.negative=\u00A7c[\u00A77AdvancedPortals\u00A7c]
logger.pluginenable=Advanced Portals wurde erfolgreich aktiviert!
logger.plugindisable=Advanced portals wurde deaktiviert!
logger.plugincrafterror=Diese Version von Craftbukkit/Spigot wird derzeit nicht unterstützt oder etwas ist schief gelaufen. Bitte melde die diese Nachricht mit der Versionnummer mit dem Log in unserem Github (auf Englisch) v:%1$s
command.noargs= Du musst einen Sub-Command angeben. Bitte benutze \u00A7e/%1$s help \u00A7c. Falls du eine Liste von möglichen Sub_Command willst.
command.subcommand.invalid= Das ist ein ungültiger Sub-Command.
command.help.header=\u00A7e--------------- \u00A7a%1$s Hilfe - Seite %2$s of %3$s\u00A7e ---------------
command.help.subcommandheader=\u00A7e--------- \u00A7a%1$s Hilfe - %2$s\u00A7e ---------
command.help.invalidhelp= \u00A7e%1$s\u00A7c ist keine gültige Seitennummer oder Sub-Command.
command.reload.help=Ladet die Portal-Dateien neu
command.reload.detailedhelp=Lade alle Portal-Dateien von den Dateien im Dateiordner neu.
command.reload.reloaded= Alle Advanced Portals Dateien wurden neugeladet
command.create.help=Erstellt Portale
command.create.error= Beim Portal erstellen ist ein Fehler aufgetreten:
command.create.console= Du kannst kein Portal erstellen. Überprüfe die Konsole.
command.create.detailedhelp=Das Format ist /portal create (name) [tag:tagvalue] .Liste die einzelnen Tags nach Create im Format tag:Wert. Wenn dein Wert Leerzeichen benötigt, dann verwende tag:"Wert mit Leerzeichen".
command.create.complete= Das Portal wurde erfolgreich erstellt.
command.createdesti.help=Erstelle Destinationen
command.createdesti.error= Beim erstellen der Destination ist ein Fehler aufgetreten:
command.createdesti.console= Du kannst keine Destination erstellen. Überprüfe die Konsole.
command.createdesti.detailedhelp= Das Format ist /desti create (name) [tag:tagvalue] .Liste die einzelnen Tags nach Create im Format tag:Wert. Wenn dein Wert Leerzeichen benötigt, dann verwende tag:"Wert mit Leerzeichen
command.createdesti.complete= Die Destination wurde erfolgreich erstellt.
command.create.tags=\u00A7aTags:
command.playeronly= Dieser Befehl muss von einem Spieler ausgeführt werden.
command.remove.noname= Du musst den Namen des Portals eingeben, sonst kannst zu es nicht löschen.
command.remove.error= Das Entfernen des Portales wurde blockiert:
command.remove.noname=Es gibt kein Portal mit diesem Namen
command.remove.invalidselection= Die Portalauswahl die du hattest ist nicht länger gültig.
command.remove.noselection=Du hast kein Portal ausgewählt
command.remove.complete= Das Portal wurde erfolgreich entfernt.
command.selector= Du hast den Portal-Selektor bekommen.
command.selector.help= Gibt dir eine Portal-Selektor
command.selector.detailedhelp= Gibt dir einen Portal-Selektor um Portalregionen auszuwählen.
command.portalblock= Du hast dir einen \u00A7ePortal Block\u00A7a gegeben!
command.endportalblock= Du hast dir einen \u00A78End Portal Block Placer\u00A7a gegeben!
command.gatewayblock= Du hast dir einen \u00A78Gateway Block Placer\u00A7a gegeben!
portal.error.invalidselection=Du beide pos1 und pos2 ausgewählt haben. Ansonsten kannst kein Portal erstellen.
portal.error.takenname=Ein anderes Portal trägt bereits diesen Namen.
portal.error.selection.differentworlds= Die ausgewählten Positionen müssen in der gleichen Welt sein.
desti.info.noargs=\u00A7cEs wurde kein tag angegeben
command.error.noname= Es wurde kein Name angegeben.
desti.error.takenname= Der Namen, den du dem Portal geben möchtes, ist bereits vergeben.
error.notplayer=Nur Spieler können das machen.
portal.selector.poschange=\u00A7eDu hast pos%1$s X:%2$s Y:%3$s Z:%4$s ausgewählt
command.trans.help=Kopiere die Übersetzung, um die Standardeinstellungen wiederherzustellen
command.version.help=Sagt dir die aktuelle Version von Advanced Portals
command.subcommand.nopermission= Du hast dafür keine Berechigung. Verwende \u00A7e/%1$s help \u00A7c wenn du eine Liste von möglichen Befehlen sehen möchtest.

View File

@ -0,0 +1,89 @@
# Same as default minecraft lang files but can handle comments if a # is the first character
# Anything not set in translations will be defaulted back to the en_GB file.
# The default en_GB will always be loaded before any other file, even if you make a new en_GB so that new strings
# do not have blank values possibly making new features unusable.
#
# The format of included strings is %(number of argument)$s (starts at 1 not 0)
# So the order of variables being inserted into the string is not a set order. Just like minecraft
#
# For colors use \u00A7 or § (can be entered by holding alt and pressing 2 then 1 on the numpad)
# http://minecraft.gamepedia.com/Formatting_codes
#
# Also note that some debug messages may not be listed here for translation.
#
translatedata.lastchange=1.0.0
translatedata.translationsoutdated= Some of the translations from the current translation file \u00A7e%1$s\u00A7c are out of date.
translatedata.replacecommand= Use \u00A7e/portal transupdate\u00A7c to copy out a new default \u00A7een_GB\u00A7c file.
translatedata.replaced= A new \u00A7een_GB\u00A7a file has been copied to the data folder.
messageprefix.positive=\u00A7a[\u00A7eAdvancedPortals\u00A7a]
messageprefix.negative=\u00A7c[\u00A77AdvancedPortals\u00A7c]
logger.pluginenable=Advanced portals have been enabled!
logger.plugindisable=Advanced portals are being disabled!
logger.plugincrafterror=This version of craftbukkit is not yet supported or something went wrong, please post this message with the version number and the above stacktrace in an issue on GitHub v:%1$s
command.noargs= Sorry but you need to specify a sub command, please use \u00A7e/%1$s help \u00A7cif you would like a list of possible subcommands.
command.subcommand.invalid= Sorry but that is not a valid sub command.
command.help.header=\u00A7e--------------- \u00A7a%1$s Help - Page %2$s of %3$s\u00A7e ---------------
command.help.subcommandheader=\u00A7e--------- \u00A7a%1$s Help - %2$s\u00A7e ---------
command.help.invalidhelp= Sorry but \u00A7e%1$s\u00A7c is not a valid page number or sub command.
command.reload.help=Reloads portal data
command.reload.detailedhelp=Reloads all portal data from files in the data folder
command.reload.reloaded= All Advanced Portals data reloaded
command.create.help=Creates portals
command.create.error= There was an error making the portal:
command.create.console= You cannot create a portal using the console.
command.create.detailedhelp=Format is /portal create (name) [tag:tagvalue] List tags after create in the format tag:value, if your value needs spaces use the format tag:"value with spaces"
command.create.complete= The portal has been successfully created.
command.createdesti.help=Creates destinations
command.createdesti.error= There was an error making the destination
command.createdesti.console= You cannot create a destination using the console.
command.createdesti.detailedhelp=Format is /desti create (name) [tag:tagvalue] List tags after create in the format tag:value, if your value needs spaces use the format tag:"value with spaces"
command.createdesti.complete= The destination has been successfully created.
command.create.tags=\u00A7aTags:
command.playeronly= Sorry but that command can only be run by a player.
command.remove.noname= You need to give the name of the portal you want to remove.
command.remove.error= Removing the portal was blocked:
command.remove.noname=No portal by that name was found
command.remove.invalidselection=The portal selection you had is no longer valid
command.remove.noselection=You don't have a portal selected
command.remove.complete= The portal has been successfully removed.
command.selector= You have been given a portal selector.
command.selector.help=Gives you a portal region selector
command.selector.detailedhelp=Gives you a portal selector to select the regions for making portals.
command.portalblock= You have been given a \u00A7ePortal Block\u00A7a!
command.endportalblock= You have been given a \u00A78End Portal Block Placer\u00A7a!
command.gatewayblock= You have been given a \u00A78Gateway Block Placer\u00A7a!
portal.error.invalidselection=You must have both pos1 and pos2 selected to create a portal.
portal.error.takenname=The name given for the portal is already taken.
portal.error.selection.differentworlds=Both the selected points need to be in the same world.
desti.info.noargs=\u00A7cNo tags were given
command.error.noname= No name has been given.
desti.error.takenname=The name given for the portal is already taken.
error.notplayer=Only players can do that.
portal.selector.poschange=\u00A7eYou have selected pos%1$s X:%2$s Y:%3$s Z:%4$s
command.trans.help=Copy translation new default translation file
command.version.help=Returns the current version of the plugin
command.subcommand.nopermission= Sorry but you don't have permission for that, please use \u00A7e/%1$s help \u00A7cif you would like a list of possible sub commands.

View File

@ -0,0 +1,88 @@
# Same as default minecraft lang files but can handle comments if a # is the first character
# Anything not set in translations will be defaulted back to the en_GB file.
# The default en_GB will always be loaded before any other file, even if you make a new en_GB so that new strings
# do not have blank values possibly making new features unusable.
#
# The format of included strings is %(number of argument)$s (starts at 1 not 0)
# So the order of variables being inserted into the string is not a set order. Just like minecraft
#
# For colors use \u00A7 or § (can be entered by holding alt and pressing 2 then 1 on the numpad)
# http://minecraft.gamepedia.com/Formatting_codes
#
# Also note that some debug messages may not be listed here for translation.
#
translatedata.lastchange=1.0.0
translatedata.translationsoutdated=Certaines des traductions du fichier de traduction actuel \u00A7e%1$s\u00A7c sont dépassées.
translatedata.replacecommand= Utilisez \u00A7e/portal transupdate\u00A7c pour copier un nouveau fichier par défaut de traduction \u00A7een_GB\u00A7c.
translatedata.replaced= Un nouveau fichier \u00A7een_GB\u00A7a a bien été enregistré.
messageprefix.positive=\u00A7c[\u00A77AdvancedPortals\u00A7c]
messageprefix.negative=\u00A7c[\u00A77AdvancedPortals\u00A7c]
logger.pluginenable=Advanced portals a bien été activé !
logger.plugindisable=Advanced portals a bien été désactivé !
logger.plugincrafterror=Cette version craftbukkit n'est pas supportée, veuillez poster ce message avec le numéro de version et la pile ci-dessus dans un numéro sur GitHub: v:%1$s
command.noargs= Vous devez spécifier une sous commande, utilisez \u00A7e/%1$s help \u00A7cpour avoir la liste des commandes possibles.
command.subcommand.invalid= Ce n'est pas une sous commande.
command.help.header=\u00A7e--------------- \u00A7a%1$s Aide - Page %2$s sur %3$s\u00A7e ---------------
command.help.subcommandheader=\u00A7e--------- \u00A7a%1$s Aide - %2$s\u00A7e ---------
command.help.invalidhelp= Désolé mais \u00A7e%1$s\u00A7c n'est pas une page ou sous commande valide.
command.reload.help=Recharge les fichiers
command.reload.detailedhelp=Recharge toutes les données du portail à partir des fichiers du dossier de données.
command.reload.reloaded= Tous les fichiers ont bien été rechargés.
command.create.help=Crée un portail
command.create.error= Une erreur est survenue en créant le portail:
command.create.console= Vous ne pouvez pas créer un portail en utilisant la console.
command.create.detailedhelp=Le format est /portal create (name) [tag:tagvalue]
command.create.complete= Le portail a bien été créé.
command.createdesti.help=Crée une destination
command.createdesti.error= Une erreur est survenue en créant la destination:
command.createdesti.console= Vous ne pouvez pas créer une destination en utilisant la console.
command.createdesti.detailedhelp=Le format est /desti create (name) [tag:tagvalue]
command.createdesti.complete= La destination a bien été créée.
command.create.tags=\u00A7aTags:
command.playeronly= Seul un joueur peut effectuer cette commande.
command.remove.noname= Vous devez préciser le nom du portail à supprimer.
command.remove.error= La suppression du portail a été bloquée:
command.remove.noname=Aucun portail de ce nom n'a été trouvé.
command.remove.invalidselection=La sélection n'est pas valide.
command.remove.noselection=Vous n'avez sélectionné aucun portail.
command.remove.complete= Le portail a bien été supprimé.
command.selector= Vous avez bien reçu un sélecteur.
command.selector.help= Vous donne le sélecteur.
command.selector.detailedhelp= Vous donne l'outil de sélection pour créer un portail.
command.portalblock= Vous avez bien reçu un \u00A7ePortal Block\u00A7a!
command.endportalblock= Vous avez bien reçu un \u00A78End Portal Block Placer\u00A7a!
command.gatewayblock= Vous avez bien reçu un \u00A78Gateway Block Placer\u00A7a!
portal.error.invalidselection=Vous devez avoir sélectionné deux positions pour créer un portail.
portal.error.takenname=Un portail du même nom existe déjà.
portal.error.selection.differentworlds=Les deux sélections doivent être dans le même monde.
desti.info.noargs=\u00A7cAucune variable n'a été précisée.
command.error.noname= Aucun nom n'a été précisé.
desti.error.takenname=Une destination du même nom existe déjà.
error.notplayer=Seuls les joueurs peuvent faire cela.
portal.selector.poschange=\u00A7eVous avez sélectionné pos%1$s X:%2$s Y:%3$s Z:%4$s
command.trans.help=Copy translation new default translation file
command.version.help=Renvoie la version actuelle du plugin.
command.subcommand.nopermission=Désolé mais vous n'avez pas la permission d'effectuer cette commande.

View File

@ -0,0 +1,88 @@
# Ugyanaz, mint az alapértelmezett minecraft lang fájlok, de kezelheti a megjegyzéseket, ha a # az első karakter
# Bármi, amit a fordítások nem állítottak be, visszaáll az en_GB fájlra.
# Az alapértelmezett en_GB mindig betöltődik bármely más fájl előtt, még akkor is, ha új en_GB-t készít,
# hogy az új karakterláncoknak nincs üres értékei, amelyek esetleg új funkciókat használhatnak fel.
#
# A mellékelt karakterek formátuma %(argumentum száma)$s (kezdődik 1 nem 0)
# Tehát a változók sorrendje a stringbe nem egy sorrend. Csakúgy, mint a minecraft
#
# A színek használata \u00A7 vagy § (az alt megtartásával írható be, majd a számbillentyű lenyomásával 2 majd 1)
# http://minecraft.gamepedia.com/Formatting_codes
#
# Vegye figyelembe, hogy néhány hibaelhárító üzenet itt nem szerepel a fordításban.
#
translatedata.lastchange=1.0.0
translatedata.translationsoutdated= Néhány fordítás a jelenlegi fordítási fájlból \u00A7e%1$s\u00A7c elavultak.
translatedata.replacecommand= Használat \u00A7e/portal transupdate\u00A7c hogy új alapértelmezést másoljon ki az \u00A7een_GB\u00A7c fájlból.
translatedata.replaced= Az új \u00A7een_GB\u00A7a fájlt másolva az adatmappába.
messageprefix.positive=\u00A7a[\u00A7eAdvancedPortals\u00A7a]
messageprefix.negative=\u00A7c[\u00A77AdvancedPortals\u00A7c]
logger.pluginenable=Advanced portals sikeresen engedélyezve!
logger.plugindisable=Advanced portals letiltva!
logger.plugincrafterror=A craftbukkit ezen verziója még nem támogatott, vagy valami hibás, kérlek, írd be ezt az üzenetet a verziószámmal és a fenti stacktrace-szal a GitHub kiadásában v:%1$s
command.noargs= Sajnálom, de meg kell adni egy al parancsot, kérlek, használd \u00A7e/%1$s help \u00A7cha a lehetséges al parancsok listáját szeretnéd látni.
command.subcommand.invalid= Sajnáljuk, de ez nem érvényes al parancs.
command.help.header=\u00A7e--------------- \u00A7a%1$s Segítség - Oldal %2$s %3$s\u00A7e-ból/-ből ---------------
command.help.subcommandheader=\u00A7e--------- \u00A7a%1$s Segítség - %2$s\u00A7e ---------
command.help.invalidhelp= Sajnálom, de \u00A7e%1$s\u00A7c nem érvényes oldalszám vagy al parancs.
command.reload.help=Portál adat újratöltése
command.reload.detailedhelp=Újratölt minden portáladatot az adatmappában található fájlokból
command.reload.reloaded= Minden Advanced Portals adat újratöltve
command.create.help=Portál létrehozása
command.create.error= Hiba történt a portál létrehozásában:
command.create.console= A konzol segítségével nem hozhat létre portált.
command.create.detailedhelp=A formátum /portal create (név) [tag:tagvalue] Megadja a címkéket a létrehozás után a formátum tag:value, ha az értéknek szóközre van szüksége, használja a formátum tag:"érték a szóközökkel"
command.create.complete= A portál sikeresen létrehozva.
command.createdesti.help=Célállomások létrehozása
command.createdesti.error= Hiba történt a célállomásnál
command.createdesti.console= Nem hozhatsz létre célállomást a konzol segítségével.
command.createdesti.detailedhelp=A formátum /desti create (név) [tag:tagvalue] Megadja a címkéket a létrehozás után a formátum tag:calue, ha az értéknek szóközre van szüksége, használja a formátum tag:"érték a szóközökkel"
command.createdesti.complete= A célállomás sikeresen létrehozva.
command.create.tags=\u00A7aCímkék:
command.playeronly= Sajnáljuk, de ezt a parancsot csak egy játékos futtathatja.
command.remove.noname= Meg kell adnod az eltávolítani kívánt portál nevét.
command.remove.error= A portál eltávolítása blokkolt:
command.remove.noname=Nincs ilyen portál ezzel a névvel
command.remove.invalidselection=Az általad választott portál már nem érvényes
command.remove.noselection=Nincs kiválasztott portál
command.remove.complete= A portál sikeresen törölve.
command.selector= Kaptál egy portálválasztót.
command.selector.help=Ad egy portál régió kiválasztót
command.selector.detailedhelp=Portál választót ad a portálok létrehozásának régiói számára.
command.portalblock= Kaptál egy \u00A7ePortál blokk\u00A7aot!
command.endportalblock= Kaptál egy \u00A78Végzet portál blokk helyező\u00A7at!
command.gatewayblock= Kaptál egy \u00A78Kapubejáró blokk helyező\u00A7at!
portal.error.invalidselection=A portál létrehozásához mind a pos1, mind a pos2 szükséges.
portal.error.takenname=A portálra megadott név már megtörtént.
portal.error.selection.differentworlds=Mindkét kiválasztott pontnak ugyanabban a világban kell lennie.
desti.info.noargs=\u00A7cNincsenek címkék megadva
command.error.noname= Nincs név megadva.
desti.error.takenname=A portálra megadott név már megtörtént.
error.notplayer=Csak a játékosok tehetik ezt.
portal.selector.poschange=\u00A7eKiválasztottad a pos%1$s X:%2$s Y:%3$s Z:%4$s
command.trans.help=Fordítás másolása fordítás új alapértelmezett fordítási fájl
command.version.help=Visszaadja a plugin jelenlegi verzióját
command.subcommand.nopermission= Sajnálom, de erre nincs jogod, kérlek, használd \u00A7e/%1$s help \u00A7cha a lehetséges al parancsok listáját szeretnéd látni.

View File

@ -11,19 +11,17 @@ public class AdvancedPortalsPlugin extends JavaPlugin {
@Override
public void onEnable() {
this.portalsCore = new AdvancedPortalsCore();
this.portalsCore = new AdvancedPortalsCore(this.getDataFolder(), new SpigotInfoLogger(this));
this.portalsCore.onEnable();
new Metrics(this);
this.getServer().getConsoleSender().sendMessage("\u00A7aAdvanced portals have been successfully enabled!");
}
@Override
public void onDisable() {
this.getServer().getConsoleSender().sendMessage("\u00A7cAdvanced portals are being disabled!");
this.portalsCore.onDisable();
}
}

View File

@ -0,0 +1,22 @@
package com.sekwah.advancedportals.spigot;
import com.sekwah.advancedportals.core.util.InfoLogger;
public class SpigotInfoLogger extends InfoLogger {
private final AdvancedPortalsPlugin plugin;
public SpigotInfoLogger(AdvancedPortalsPlugin plugin) {
this.plugin = plugin;
}
@Override
public void logWarning(String s) {
plugin.getLogger().warning(s);
}
@Override
public void log(String s) {
plugin.getLogger().info(s);
}
}