Skip to content

Commit

Permalink
LTItemMail updated to MC 1.14
Browse files Browse the repository at this point in the history
  • Loading branch information
leothawne committed May 27, 2019
1 parent 03483d7 commit 9501676
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 47 deletions.
30 changes: 15 additions & 15 deletions english.yml
Original file line number Diff line number Diff line change
@@ -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
language-version: 3
32 changes: 16 additions & 16 deletions portuguese.yml
Original file line number Diff line number Diff line change
@@ -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
language-version: 3
5 changes: 3 additions & 2 deletions src/main/java/io/github/leothawne/LTItemMail/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
3 changes: 2 additions & 1 deletion src/main/java/io/github/leothawne/LTItemMail/LTItemMail.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.UUID;

import org.bukkit.Bukkit;
Expand Down Expand Up @@ -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...");
}
Expand All @@ -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<String>(Arrays.asList("Vault", "Essentials")));
} else {
this.console.severe("You've choosen to disable me.");
this.getServer().getPluginManager().disablePlugin(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@
*/
package io.github.leothawne.LTItemMail.api;

import java.util.List;
import java.util.LinkedList;

import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;

import io.github.leothawne.LTItemMail.LTItemMail;

public final class WarnIntegrationsAPI {
public WarnIntegrationsAPI(final LTItemMail mainPlugin, final List<String> plugins) {
public WarnIntegrationsAPI(final LTItemMail mainPlugin, final LinkedList<String> 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() + "!");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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_");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<Economy> rsp = plugin.getServer().getServicesManager().getRegistration(Economy.class);
if(rsp != null) {
return rsp.getProvider();
}
return null;
}
}
2 changes: 1 addition & 1 deletion vietnamese.yml
Original file line number Diff line number Diff line change
@@ -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:"
Expand Down

0 comments on commit 9501676

Please sign in to comment.