From a198c1a44a8271f4d296311f55df0054c2c95ab0 Mon Sep 17 00:00:00 2001 From: Tastybento Date: Sun, 24 Dec 2017 09:51:41 -0800 Subject: [PATCH] Renamed some classes to BSB... --- .../us/tastybento/bskyblock/BSkyBlock.java | 4 +-- .../api/{BSModule.java => BSBModule.java} | 2 +- .../bskyblock/api/addons/AddonState.java | 2 +- .../addons/{BSAddon.java => BSBAddon.java} | 4 +-- .../{BSCommand.java => BSBCommand.java} | 2 +- .../api/commands/CompositeCommand.java | 2 +- ...lockReadyEvent.java => BSBReadyEvent.java} | 2 +- .../{BSLocale.java => BSBLocale.java} | 4 +-- .../teams/IslandTeamPromoteCommand.java | 7 ---- .../bskyblock/managers/AddonsManager.java | 6 ++-- .../bskyblock/managers/CommandsManager.java | 8 ++--- .../bskyblock/managers/LocalesManager.java | 36 +++++++++---------- 12 files changed, 36 insertions(+), 43 deletions(-) rename src/main/java/us/tastybento/bskyblock/api/{BSModule.java => BSBModule.java} (82%) rename src/main/java/us/tastybento/bskyblock/api/addons/{BSAddon.java => BSBAddon.java} (93%) rename src/main/java/us/tastybento/bskyblock/api/commands/{BSCommand.java => BSBCommand.java} (97%) rename src/main/java/us/tastybento/bskyblock/api/events/{BSkyBlockReadyEvent.java => BSBReadyEvent.java} (90%) rename src/main/java/us/tastybento/bskyblock/api/localization/{BSLocale.java => BSBLocale.java} (95%) diff --git a/src/main/java/us/tastybento/bskyblock/BSkyBlock.java b/src/main/java/us/tastybento/bskyblock/BSkyBlock.java index b36b323e1..0977618cb 100755 --- a/src/main/java/us/tastybento/bskyblock/BSkyBlock.java +++ b/src/main/java/us/tastybento/bskyblock/BSkyBlock.java @@ -7,7 +7,7 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; -import us.tastybento.bskyblock.api.BSModule; +import us.tastybento.bskyblock.api.BSBModule; import us.tastybento.bskyblock.commands.AdminCommand; import us.tastybento.bskyblock.commands.IslandCommand; import us.tastybento.bskyblock.config.PluginConfig; @@ -28,7 +28,7 @@ import us.tastybento.bskyblock.util.nms.NMSAbstraction; * @author Tastybento * @author Poslovitch */ -public class BSkyBlock extends JavaPlugin implements BSModule { +public class BSkyBlock extends JavaPlugin implements BSBModule { private static BSkyBlock plugin; diff --git a/src/main/java/us/tastybento/bskyblock/api/BSModule.java b/src/main/java/us/tastybento/bskyblock/api/BSBModule.java similarity index 82% rename from src/main/java/us/tastybento/bskyblock/api/BSModule.java rename to src/main/java/us/tastybento/bskyblock/api/BSBModule.java index 8d08efc85..e17241676 100644 --- a/src/main/java/us/tastybento/bskyblock/api/BSModule.java +++ b/src/main/java/us/tastybento/bskyblock/api/BSBModule.java @@ -2,7 +2,7 @@ package us.tastybento.bskyblock.api; import java.io.File; -public interface BSModule { +public interface BSBModule { String getIdentifier(); boolean isAddon(); diff --git a/src/main/java/us/tastybento/bskyblock/api/addons/AddonState.java b/src/main/java/us/tastybento/bskyblock/api/addons/AddonState.java index 30423aca1..8b66e1d87 100644 --- a/src/main/java/us/tastybento/bskyblock/api/addons/AddonState.java +++ b/src/main/java/us/tastybento/bskyblock/api/addons/AddonState.java @@ -1,7 +1,7 @@ package us.tastybento.bskyblock.api.addons; /** - * Represents the current run-time state of a {@link BSAddon}. + * Represents the current run-time state of a {@link BSBAddon}. * * @author Poslovitch * @since 1.0 diff --git a/src/main/java/us/tastybento/bskyblock/api/addons/BSAddon.java b/src/main/java/us/tastybento/bskyblock/api/addons/BSBAddon.java similarity index 93% rename from src/main/java/us/tastybento/bskyblock/api/addons/BSAddon.java rename to src/main/java/us/tastybento/bskyblock/api/addons/BSBAddon.java index 2875251c9..a09857b69 100644 --- a/src/main/java/us/tastybento/bskyblock/api/addons/BSAddon.java +++ b/src/main/java/us/tastybento/bskyblock/api/addons/BSBAddon.java @@ -3,11 +3,11 @@ package us.tastybento.bskyblock.api.addons; import java.io.File; import us.tastybento.bskyblock.BSkyBlock; -import us.tastybento.bskyblock.api.BSModule; +import us.tastybento.bskyblock.api.BSBModule; import us.tastybento.bskyblock.managers.CommandsManager; import us.tastybento.bskyblock.managers.LocalesManager; -public abstract class BSAddon implements BSModule { +public abstract class BSBAddon implements BSBModule { private File folder; private AddonDescription description; diff --git a/src/main/java/us/tastybento/bskyblock/api/commands/BSCommand.java b/src/main/java/us/tastybento/bskyblock/api/commands/BSBCommand.java similarity index 97% rename from src/main/java/us/tastybento/bskyblock/api/commands/BSCommand.java rename to src/main/java/us/tastybento/bskyblock/api/commands/BSBCommand.java index fee97e11e..39e0d6285 100644 --- a/src/main/java/us/tastybento/bskyblock/api/commands/BSCommand.java +++ b/src/main/java/us/tastybento/bskyblock/api/commands/BSBCommand.java @@ -9,7 +9,7 @@ import java.util.Optional; * @author ben * */ -public interface BSCommand { +public interface BSBCommand { /** * Anything that needs to be set up for this command. diff --git a/src/main/java/us/tastybento/bskyblock/api/commands/CompositeCommand.java b/src/main/java/us/tastybento/bskyblock/api/commands/CompositeCommand.java index 574fd01b5..c6470e519 100644 --- a/src/main/java/us/tastybento/bskyblock/api/commands/CompositeCommand.java +++ b/src/main/java/us/tastybento/bskyblock/api/commands/CompositeCommand.java @@ -27,7 +27,7 @@ import us.tastybento.bskyblock.util.Util; * @author ben, poslovich * */ -public abstract class CompositeCommand extends Command implements PluginIdentifiableCommand, BSCommand { +public abstract class CompositeCommand extends Command implements PluginIdentifiableCommand, BSBCommand { private static final boolean DEBUG = false; /** diff --git a/src/main/java/us/tastybento/bskyblock/api/events/BSkyBlockReadyEvent.java b/src/main/java/us/tastybento/bskyblock/api/events/BSBReadyEvent.java similarity index 90% rename from src/main/java/us/tastybento/bskyblock/api/events/BSkyBlockReadyEvent.java rename to src/main/java/us/tastybento/bskyblock/api/events/BSBReadyEvent.java index aa7a91ccb..1d3642104 100644 --- a/src/main/java/us/tastybento/bskyblock/api/events/BSkyBlockReadyEvent.java +++ b/src/main/java/us/tastybento/bskyblock/api/events/BSBReadyEvent.java @@ -9,7 +9,7 @@ import org.bukkit.event.HandlerList; * @author tastybento * @since 1.0 */ -public class BSkyBlockReadyEvent extends Event { +public class BSBReadyEvent extends Event { private static final HandlerList handlers = new HandlerList(); @Override diff --git a/src/main/java/us/tastybento/bskyblock/api/localization/BSLocale.java b/src/main/java/us/tastybento/bskyblock/api/localization/BSBLocale.java similarity index 95% rename from src/main/java/us/tastybento/bskyblock/api/localization/BSLocale.java rename to src/main/java/us/tastybento/bskyblock/api/localization/BSBLocale.java index 3662e9d84..c333757e1 100644 --- a/src/main/java/us/tastybento/bskyblock/api/localization/BSLocale.java +++ b/src/main/java/us/tastybento/bskyblock/api/localization/BSBLocale.java @@ -11,13 +11,13 @@ import org.bukkit.configuration.file.YamlConfiguration; /** * @author Poslovitch, Tastybento */ -public class BSLocale { +public class BSBLocale { private Locale locale; private YamlConfiguration config; private Map cache; - public BSLocale(String languageTag, File file) { + public BSBLocale(String languageTag, File file) { this.locale = Locale.forLanguageTag(languageTag); this.config = YamlConfiguration.loadConfiguration(file); this.cache = new HashMap<>(); diff --git a/src/main/java/us/tastybento/bskyblock/commands/island/teams/IslandTeamPromoteCommand.java b/src/main/java/us/tastybento/bskyblock/commands/island/teams/IslandTeamPromoteCommand.java index aa308fa0b..55610871d 100644 --- a/src/main/java/us/tastybento/bskyblock/commands/island/teams/IslandTeamPromoteCommand.java +++ b/src/main/java/us/tastybento/bskyblock/commands/island/teams/IslandTeamPromoteCommand.java @@ -1,8 +1,6 @@ package us.tastybento.bskyblock.commands.island.teams; -import java.util.LinkedList; import java.util.List; -import java.util.Optional; import us.tastybento.bskyblock.api.commands.User; import us.tastybento.bskyblock.config.Settings; @@ -21,9 +19,4 @@ public class IslandTeamPromoteCommand extends AbstractIslandTeamCommand { return true; } - @Override - public Optional> tabComplete(final User user, final String alias, final LinkedList args) { - return null; - } - } \ No newline at end of file diff --git a/src/main/java/us/tastybento/bskyblock/managers/AddonsManager.java b/src/main/java/us/tastybento/bskyblock/managers/AddonsManager.java index 893ce8f15..4460de2b9 100644 --- a/src/main/java/us/tastybento/bskyblock/managers/AddonsManager.java +++ b/src/main/java/us/tastybento/bskyblock/managers/AddonsManager.java @@ -3,13 +3,13 @@ package us.tastybento.bskyblock.managers; import java.util.ArrayList; import java.util.List; -import us.tastybento.bskyblock.api.addons.BSAddon; +import us.tastybento.bskyblock.api.addons.BSBAddon; public final class AddonsManager { - private final List addons = new ArrayList<>(); + private final List addons = new ArrayList<>(); - public List getAddons() { + public List getAddons() { return addons; } } diff --git a/src/main/java/us/tastybento/bskyblock/managers/CommandsManager.java b/src/main/java/us/tastybento/bskyblock/managers/CommandsManager.java index fefa7f8b5..afff594b9 100644 --- a/src/main/java/us/tastybento/bskyblock/managers/CommandsManager.java +++ b/src/main/java/us/tastybento/bskyblock/managers/CommandsManager.java @@ -8,13 +8,13 @@ import java.util.Map; import org.bukkit.command.Command; import us.tastybento.bskyblock.BSkyBlock; -import us.tastybento.bskyblock.api.BSModule; +import us.tastybento.bskyblock.api.BSBModule; public final class CommandsManager { - private Map> commands = new LinkedHashMap<>(); + private Map> commands = new LinkedHashMap<>(); - public void registerCommand(BSModule module, Command command) { + public void registerCommand(BSBModule module, Command command) { List cmds = new ArrayList<>(); if (commands.containsKey(module)) { cmds = commands.get(module); @@ -29,7 +29,7 @@ public final class CommandsManager { } - public List getCommands(BSModule module) { + public List getCommands(BSBModule module) { return commands.get(module); } diff --git a/src/main/java/us/tastybento/bskyblock/managers/LocalesManager.java b/src/main/java/us/tastybento/bskyblock/managers/LocalesManager.java index c3fb8b769..7cc23f1c4 100644 --- a/src/main/java/us/tastybento/bskyblock/managers/LocalesManager.java +++ b/src/main/java/us/tastybento/bskyblock/managers/LocalesManager.java @@ -9,8 +9,8 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import us.tastybento.bskyblock.BSkyBlock; -import us.tastybento.bskyblock.api.BSModule; -import us.tastybento.bskyblock.api.localization.BSLocale; +import us.tastybento.bskyblock.api.BSBModule; +import us.tastybento.bskyblock.api.localization.BSBLocale; import us.tastybento.bskyblock.config.Settings; /** @@ -19,7 +19,7 @@ import us.tastybento.bskyblock.config.Settings; public final class LocalesManager { private BSkyBlock plugin; - private Map> locales; + private Map> locales; public LocalesManager(BSkyBlock plugin) { this.plugin = plugin; @@ -39,10 +39,10 @@ public final class LocalesManager { if (reference.contains(":")) { // if reference addresses directly the module like "bskyblock:general.errors.use-in-game" String[] path = reference.split(":", 1); - for (BSModule module : locales.keySet()) { + for (BSBModule module : locales.keySet()) { if (module.getIdentifier().toLowerCase().equals(path[0].toLowerCase())) { // CommandSender doesnt have any data stored, so we have to get the default language - BSLocale locale = getLocale(module, Settings.defaultLanguage); + BSBLocale locale = getLocale(module, Settings.defaultLanguage); String translation = path[1]; if (locale != null) translation = locale.get(path[1]); @@ -58,9 +58,9 @@ public final class LocalesManager { } } else { // Run through each module's locales to try find the reference - for (BSModule module : locales.keySet()) { + for (BSBModule module : locales.keySet()) { // CommandSender doesnt have any data stored, so we have to get the default language - BSLocale locale = getLocale(module, Settings.defaultLanguage); + BSBLocale locale = getLocale(module, Settings.defaultLanguage); String translation = reference; if (locale != null) translation = locale.get(reference); @@ -87,10 +87,10 @@ public final class LocalesManager { public String get(UUID uuid, String reference) { if (reference.contains(":")) { // if reference addresses directly the module like "bskyblock:general.errors.use-in-game" String[] path = reference.split(":", 1); - for (BSModule module : locales.keySet()) { + for (BSBModule module : locales.keySet()) { if (module.getIdentifier().toLowerCase().equals(path[0].toLowerCase())) { // Firstly try to find the translation in player's locale - BSLocale locale = getLocale(module, plugin.getPlayers().getLocale(uuid)); + BSBLocale locale = getLocale(module, plugin.getPlayers().getLocale(uuid)); String translation = path[1]; if (locale != null) translation = locale.get(path[1]); @@ -113,9 +113,9 @@ public final class LocalesManager { } } else { // Run through each module's locales to try find the reference - for (BSModule module : locales.keySet()) { + for (BSBModule module : locales.keySet()) { // Firstly try to find the translation in player's locale - BSLocale locale = getLocale(module, plugin.getPlayers().getLocale(uuid)); + BSBLocale locale = getLocale(module, plugin.getPlayers().getLocale(uuid)); String translation = reference; if (locale != null) translation = locale.get(reference); @@ -140,33 +140,33 @@ public final class LocalesManager { return reference; // Return reference to tell the user that no translation has been found } - public Map> getLocales() { + public Map> getLocales() { return locales; } - public List getLocales(BSModule module) { + public List getLocales(BSBModule module) { return locales.get(module); } - public BSLocale getLocale(BSModule module, String languageTag) { - for (BSLocale locale : locales.get(module)) { + public BSBLocale getLocale(BSBModule module, String languageTag) { + for (BSBLocale locale : locales.get(module)) { if (locale.toLanguageTag().equals(languageTag)) return locale; } return null; } - public void registerLocales(BSModule module) { + public void registerLocales(BSBModule module) { // Check if the folder exists and contains the locales // for each languageTag found, do registerLocale(module, languageTag) //TODO } - public void registerLocale(BSModule module, String languageTag) { + public void registerLocale(BSBModule module, String languageTag) { //TODO } - public void registerExternalLocale(BSModule originModule, BSModule targetModule, String languageTag) { + public void registerExternalLocale(BSBModule originModule, BSBModule targetModule, String languageTag) { //TODO } }