diff --git a/english.yml b/english.yml index 2d79583..5b7f254 100644 --- a/english.yml +++ b/english.yml @@ -1,24 +1,24 @@ -no-permission: "You can't do that! You don't have permission." -mailbox-closed: "Mailbox closed!" +no-permission: "You do not have permission to do this." +mailbox-closed: "Box closed." mailbox-closed-items: "You lost % items:" -mailbox-paid: "You paid % to the bank!" -mailbox-sent: "Items sent to %." -mailbox-from: "Mailbox from: %." +mailbox-paid: "You paid $% to the post office." +mailbox-sent: "Sending box to %..." +mailbox-from: "Mailbox from %" special-mailbox: "Special Mailbox!!!" -mailbox-opening: "Opening mailbox..." +mailbox-opening: "Opening box..." mailbox-opening-seconds: "Opening in % seconds..." -mailbox-lose: "Items left inside will be lost!" -mailbox-delivered: "Items delivered successfully!" -mailbox-aborted: "Box empty! Aborted." +mailbox-lose: "Do not let items inside before closing it!" +mailbox-delivered: "The box was delivered!" +mailbox-aborted: "Shipping canceled!" transaction-error: "Transaction not succeeded!" -transaction-no-money: "You don't have % to pay." -recipient-busy: "% is busy right now! Try again later." -recipient-full: "% doesn't have % slots available." +transaction-no-money: "You do not have $% to pay to the post office." +recipient-busy: "% is busy right now. Try again in a few seconds." +recipient-full: "% does not have % free slot(s)." recipient-empty: "You must specify a player!" recipient-offline: "The specified player is not online." -player-error: "You must be a player to do that!" +player-error: "You must be a player to do this!" player-tma: "Too many arguments!" -player-self: "Why would you do that?" +player-self: "You can not send a mailbox to yourself." #Do not change it under any circumstances! -language-version: 2 \ No newline at end of file +language-version: 3 \ No newline at end of file diff --git a/portuguese.yml b/portuguese.yml index 369feed..6e34cff 100644 --- a/portuguese.yml +++ b/portuguese.yml @@ -1,24 +1,24 @@ -no-permission: "Você não pode fazer isso! Você não tem permissão." -mailbox-closed: "Caixa de corrêio fechada!" +no-permission: "Você não tem permissão para fazer isso." +mailbox-closed: "Caixa fechada." mailbox-closed-items: "Você perdeu % itens:" -mailbox-paid: "Você pagou % ao banco!" -mailbox-sent: "Itens enviados para %." -mailbox-from: "Corrêio de: %." +mailbox-paid: "Você pagou $% ao corrêio." +mailbox-sent: "Enviando caixa para %..." +mailbox-from: "Corrêio de %" special-mailbox: "Corrêio especial!!!" -mailbox-opening: "Abrindo caixa de corrêio..." +mailbox-opening: "Abrindo caixa..." mailbox-opening-seconds: "Abrindo em % segundos..." -mailbox-lose: "Itens deixados dentro serão perdidos!" -mailbox-delivered: "Itens entregues com sucesso!" -mailbox-aborted: "Caixa vazia! Abortado." +mailbox-lose: "Não deixe itens dentro antes de fechar!" +mailbox-delivered: "A caixa foi entregue!" +mailbox-aborted: "Envio cancelado." transaction-error: "Transação mal sucedida!" -transaction-no-money: "Você não tem % para pagar." -recipient-busy: "% está ocupado agora! Tente novamente mais tarde." -recipient-full: "% não tem % slots disponíveis." -recipient-empty: "Você deve especificar um jogador!" -recipient-offline: "O jogador especificado não está online." +transaction-no-money: "Você não tem $% para pagar ao corrêio." +recipient-busy: "% está ocupado agora. Tente novamente em alguns segundos." +recipient-full: "% não tem % slot(s) livre(s)." +recipient-empty: "Enter the name of the recipient." +recipient-offline: "The recipient you have chosen is not online." player-error: "Você precisa ser um jogador para fazer isso!" player-tma: "Muitos argumentos inseridos!" -player-self: "Por que você faria isso?" +player-self: "Você não pode enviar uma caixa de itens para você mesmo." #Não mude isso sob nenhuma circunstância! -language-version: 2 \ No newline at end of file +language-version: 3 \ No newline at end of file diff --git a/src/main/java/io/github/leothawne/LTItemMail/App.java b/src/main/java/io/github/leothawne/LTItemMail/App.java index 716a1de..a946ca0 100644 --- a/src/main/java/io/github/leothawne/LTItemMail/App.java +++ b/src/main/java/io/github/leothawne/LTItemMail/App.java @@ -20,8 +20,9 @@ public final class App { public static final void main(final String[] args) { - final String warning = "You must put this jar file into the /plugins/ folder of your CraftBukkit/Spigot/Paper server."; - JOptionPane.showMessageDialog(null, warning, "@leothawne", JOptionPane.WARNING_MESSAGE); + final String error = "You must put this jar file into the /plugins/ folder of your CraftBukkit/Spigot/Paper server."; + System.err.println(error); + JOptionPane.showMessageDialog(null, error, "https://leothawne.github.io/", JOptionPane.ERROR_MESSAGE); System.exit(0); } } \ No newline at end of file diff --git a/src/main/java/io/github/leothawne/LTItemMail/LTItemMail.java b/src/main/java/io/github/leothawne/LTItemMail/LTItemMail.java index c30c1a7..80a2514 100644 --- a/src/main/java/io/github/leothawne/LTItemMail/LTItemMail.java +++ b/src/main/java/io/github/leothawne/LTItemMail/LTItemMail.java @@ -18,6 +18,7 @@ import java.util.Arrays; import java.util.HashMap; +import java.util.LinkedList; import java.util.UUID; import org.bukkit.Bukkit; @@ -90,7 +91,6 @@ public final void onEnable() { economyPlugin = VaultModule.getEconomy(this); if(economyPlugin != null) { this.console.info("Economy plugin found."); - new WarnIntegrationsAPI(this, Arrays.asList("Vault")); } else { this.console.info("Economy plugin is missing. Skipping..."); } @@ -109,6 +109,7 @@ public final void onEnable() { LTItemMail.scheduler = this.getServer().getScheduler(); LTItemMail.versionTask = scheduler.scheduleAsyncRepeatingTask(this, new VersionTask(this, this.console), 0, 20 * 60 * 60); registerEvents(new MailboxListener(this, LTItemMail.configuration, LTItemMail.language, LTItemMail.playerBusy, economyPlugin), new PlayerListener(LTItemMail.configuration, LTItemMail.playerBusy)); + new WarnIntegrationsAPI(this, new LinkedList(Arrays.asList("Vault", "Essentials"))); } else { this.console.severe("You've choosen to disable me."); this.getServer().getPluginManager().disablePlugin(this); diff --git a/src/main/java/io/github/leothawne/LTItemMail/api/WarnIntegrationsAPI.java b/src/main/java/io/github/leothawne/LTItemMail/api/WarnIntegrationsAPI.java index 2738175..2a9e695 100644 --- a/src/main/java/io/github/leothawne/LTItemMail/api/WarnIntegrationsAPI.java +++ b/src/main/java/io/github/leothawne/LTItemMail/api/WarnIntegrationsAPI.java @@ -16,7 +16,7 @@ */ package io.github.leothawne.LTItemMail.api; -import java.util.List; +import java.util.LinkedList; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.PluginManager; @@ -24,12 +24,12 @@ import io.github.leothawne.LTItemMail.LTItemMail; public final class WarnIntegrationsAPI { - public WarnIntegrationsAPI(final LTItemMail mainPlugin, final List plugins) { + public WarnIntegrationsAPI(final LTItemMail mainPlugin, final LinkedList plugins) { final PluginManager manager = mainPlugin.getServer().getPluginManager(); for(final String plugin : plugins) { final Plugin getPlugin = manager.getPlugin(plugin); if(getPlugin != null && getPlugin.isEnabled()) { - getPlugin.getLogger().warning(mainPlugin.getName() + " were successfully hooked into " + getPlugin.getName() + "!"); + getPlugin.getLogger().info(mainPlugin.getName() + " were successfully hooked into " + getPlugin.getName() + "!"); } } } diff --git a/src/main/java/io/github/leothawne/LTItemMail/command/MailItemCommand.java b/src/main/java/io/github/leothawne/LTItemMail/command/MailItemCommand.java index 4b6c7be..6254445 100644 --- a/src/main/java/io/github/leothawne/LTItemMail/command/MailItemCommand.java +++ b/src/main/java/io/github/leothawne/LTItemMail/command/MailItemCommand.java @@ -50,7 +50,7 @@ public final boolean onCommand(CommandSender sender, Command cmd, String command final Player player1 = MailItemCommand.plugin.getServer().getPlayer(args[0]); if(player1 != null) { if(player1.getUniqueId().equals(player.getUniqueId())) { - if(args.length == 2 && args[1].equalsIgnoreCase("-biw")) { + if(args.length == 2 && args[1].equalsIgnoreCase("--bypass") && player.hasPermission("LTItemMail.admin")) { player.sendMessage(ChatColor.DARK_GREEN + "[" + MailItemCommand.configuration.getString("plugin-tag") + "] " + ChatColor.YELLOW + "Okay..."); player.openInventory(MailboxInventory.getMailboxInventory(MailboxType.OUT, player1, null)); } else { diff --git a/src/main/java/io/github/leothawne/LTItemMail/listener/MailboxListener.java b/src/main/java/io/github/leothawne/LTItemMail/listener/MailboxListener.java index 91db869..54810fb 100644 --- a/src/main/java/io/github/leothawne/LTItemMail/listener/MailboxListener.java +++ b/src/main/java/io/github/leothawne/LTItemMail/listener/MailboxListener.java @@ -117,7 +117,7 @@ public final void onInventoryClose(final InventoryCloseEvent event) { final EconomyResponse er = MailboxListener.economyPlugin.withdrawPlayer(sender, newcost); if(er.transactionSuccess()) { final String[] mailboxPaid = MailboxListener.language.getString("mailbox-paid").split("%"); - sender.sendMessage(ChatColor.DARK_GREEN + "[" + MailboxListener.configuration.getString("plugin-tag") + "] " + ChatColor.YELLOW + "" + mailboxPaid[0] + "" + ChatColor.GREEN + "$" + newcost + "" + ChatColor.YELLOW + "" + mailboxPaid[1]); + sender.sendMessage(ChatColor.DARK_GREEN + "[" + MailboxListener.configuration.getString("plugin-tag") + "] " + ChatColor.YELLOW + "" + mailboxPaid[0] + "" + ChatColor.GREEN + newcost + "" + ChatColor.YELLOW + "" + mailboxPaid[1]); sendBox(sender, recipient, contentsarray); } else { sender.sendMessage(ChatColor.DARK_GREEN + "[" + MailboxListener.configuration.getString("plugin-tag") + "] " + ChatColor.YELLOW + "" + MailboxListener.language.getString("transaction-error")); @@ -127,7 +127,7 @@ public final void onInventoryClose(final InventoryCloseEvent event) { } } else { final String[] transactionNoMoney = MailboxListener.language.getString("transaction-no-money").split("%"); - sender.sendMessage(ChatColor.DARK_GREEN + "[" + MailboxListener.configuration.getString("plugin-tag") + "] " + ChatColor.YELLOW + "" + transactionNoMoney[0] + "" + ChatColor.GREEN + "$" + newcost + "" + ChatColor.YELLOW + "" + transactionNoMoney[1]); + sender.sendMessage(ChatColor.DARK_GREEN + "[" + MailboxListener.configuration.getString("plugin-tag") + "] " + ChatColor.YELLOW + "" + transactionNoMoney[0] + "" + ChatColor.GREEN + newcost + "" + ChatColor.YELLOW + "" + transactionNoMoney[1]); for(final ItemStack item : contentsarray) { sender.getInventory().addItem(item); } diff --git a/src/main/java/io/github/leothawne/LTItemMail/module/ConsoleModule.java b/src/main/java/io/github/leothawne/LTItemMail/module/ConsoleModule.java index 110cd0f..3c25cd9 100644 --- a/src/main/java/io/github/leothawne/LTItemMail/module/ConsoleModule.java +++ b/src/main/java/io/github/leothawne/LTItemMail/module/ConsoleModule.java @@ -32,9 +32,9 @@ private final ConsoleCommandSender getConsoleSender() { } public final void Hello() { getConsoleSender().sendMessage(ChatColor.AQUA + " _ _______ _____ __ __ "); - getConsoleSender().sendMessage(ChatColor.AQUA + "| | |__ __|_ _| \\\\/ |"); - getConsoleSender().sendMessage(ChatColor.AQUA + "| | | | | | | \\\\ / |" + ChatColor.WHITE + " V: " + plugin.getDescription().getVersion() + " (Minecraft: " + DataModule.getVersion(VersionType.MINECRAFT) + ".x)"); - getConsoleSender().sendMessage(ChatColor.AQUA + "| | | | | | | |\\\\/| |" + ChatColor.WHITE + " Requires Java: " + DataModule.getVersion(VersionType.JAVA) + "+"); + getConsoleSender().sendMessage(ChatColor.AQUA + "| | |__ __|_ _| \\/ |"); + getConsoleSender().sendMessage(ChatColor.AQUA + "| | | | | | | \\ / |" + ChatColor.WHITE + " V: " + plugin.getDescription().getVersion() + " (Minecraft: " + DataModule.getVersion(VersionType.MINECRAFT) + ")"); + getConsoleSender().sendMessage(ChatColor.AQUA + "| | | | | | | |\\/| |" + ChatColor.WHITE + " Requires Java: " + DataModule.getVersion(VersionType.JAVA)); getConsoleSender().sendMessage(ChatColor.AQUA + "| |____| | _| |_| | | |" + ChatColor.WHITE + " Released on: " + DataModule.getVersionDate()); getConsoleSender().sendMessage(ChatColor.AQUA + "|______|_| |_____|_| |_|" + ChatColor.WHITE + " My Twitter: @leonappi_"); } diff --git a/src/main/java/io/github/leothawne/LTItemMail/module/DataModule.java b/src/main/java/io/github/leothawne/LTItemMail/module/DataModule.java index 45c1dc1..ea58162 100644 --- a/src/main/java/io/github/leothawne/LTItemMail/module/DataModule.java +++ b/src/main/java/io/github/leothawne/LTItemMail/module/DataModule.java @@ -26,8 +26,8 @@ public final class DataModule { private static final String PROJECT_PAGES = "BUKKIT_DEV:https://dev.bukkit.org/projects/lt-item-mail,SPIGOT_MC:https://www.spigotmc.org/resources/62294"; - private static final String VERSIONS = "CONFIG_YML:6,ENGLISH_YML:2,PORTUGUESE_YML:2,VIETNAMESE_YML:2,MINECRAFT:1.14,JAVA:8"; - private static final String Plugin_Date = "26/05/2019 07:23 (BRT)"; + private static final String VERSIONS = "CONFIG_YML:6,ENGLISH_YML:3,PORTUGUESE_YML:3,VIETNAMESE_YML:2,MINECRAFT:1.14,JAVA:8"; + private static final String Plugin_Date = "27/05/2019 00:51 (BRT)"; private static final String Minecraft_Build = "1.14-R0.1-SNAPSHOT"; private static final String Update_URL = "https://leothawne.github.io/LTItemMail/api/1.14.html"; private static final String Plugin_URL = "https://leothawne.github.io/LTItemMail/api/$version/plugin.html"; diff --git a/src/main/java/io/github/leothawne/LTItemMail/module/VaultModule.java b/src/main/java/io/github/leothawne/LTItemMail/module/VaultModule.java index df54441..6fd5703 100644 --- a/src/main/java/io/github/leothawne/LTItemMail/module/VaultModule.java +++ b/src/main/java/io/github/leothawne/LTItemMail/module/VaultModule.java @@ -17,6 +17,7 @@ package io.github.leothawne.LTItemMail.module; import org.bukkit.plugin.Plugin; +import org.bukkit.plugin.RegisteredServiceProvider; import io.github.leothawne.LTItemMail.LTItemMail; import net.milkbowl.vault.economy.Economy; @@ -27,6 +28,10 @@ public static final boolean isVaultInstalled(final LTItemMail plugin) { return (vault != null && vault.isEnabled()); } public static final Economy getEconomy(final LTItemMail plugin) { - return plugin.getServer().getServicesManager().getRegistration(Economy.class).getProvider(); + final RegisteredServiceProvider rsp = plugin.getServer().getServicesManager().getRegistration(Economy.class); + if(rsp != null) { + return rsp.getProvider(); + } + return null; } } \ No newline at end of file diff --git a/vietnamese.yml b/vietnamese.yml index cb74474..f9b6a33 100644 --- a/vietnamese.yml +++ b/vietnamese.yml @@ -1,4 +1,4 @@ -#Translated by DUYSONGLOI: https://github.com/DUYSONGLOI +#Translation created by DUYSONGLOI: https://github.com/DUYSONGLOI no-permission: "Bạn không có quyền để làm điều này" mailbox-closed: "Đã tắt MailBox!" mailbox-closed-items: "Đã gửi % vật phẩm:"