@@ -0,0 +1,1785 @@
+package vg.civcraft.mc.civmodcore.command;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0Aimport java.util.UUID;%0A%0Aimport org.bukkit.Material;%0Aimport org.bukkit.inventory.ItemStack;%0A%0Aimport com.google.common.base.Preconditions;%0A%0Aimport vg.civcraft.mc.civmodcore.CivModCorePlugin;%0Aimport vg.civcraft.mc.civmodcore.playersettings.PlayerSettingAPI;%0Aimport vg.civcraft.mc.civmodcore.playersettings.impl.collection.ListSetting;%0A%0Apublic class MailBoxAPI %7B%0A%0A%09private static ListSetting%3CString%3E mail;%0A%0A%09/**%0A%09 * Internal setup, should only be called when CivModCore is enabling%0A%09 */%0A%09public static void setup() %7B%0A%09%09if (mail != null) %7B%0A%09%09%09throw new IllegalStateException(%22Was already registed%22);%0A%09%09%7D%0A%09%09/*mail = new ListSetting%3C%3E(CivModCorePlugin.getInstance(), %22Mail box%22, %22cmcMailBox%22,%0A%09%09%09%09new ItemStack(Material.STICK), null, String.class, false); */%0A%09%09PlayerSettingAPI.registerSetting(mail, null);%0A%09%7D%0A%0A%09/**%0A%09 * Adds a new messages to the players mail box%0A%09 * @param player UUID of the player to send message to%0A%09 * @param msg Message to add%0A%09 */%0A%09public static void addMail(UUID player, String msg) %7B%0A%09%09Preconditions.checkNotNull(player, %22Player may not be null%22);%0A%09%09Preconditions.checkNotNull(msg, %22Message to add may not be null%22);%0A%09%09mail.addElement(player, msg);%0A%09%7D%0A%0A%09/**%0A%09 * Gets all pending messages in a players mail box%0A%09 * @param player Player to mail box of%0A%09 * @return Messages in the players mail box%0A%09 */%0A%09public static List%3CString%3E getMail(UUID player) %7B%0A%09%09Preconditions.checkNotNull(player, %22Player may not be null%22);%0A%09%09return mail.getValue(player);%0A%09%7D%0A%0A%09/**%0A%09 * Clears all mail a player has%0A%09 * @param player%0A%09 */%0A%09public static void clearMail(UUID player) %7B%0A%09%09Preconditions.checkNotNull(player, %22Player may not be null%22);%0A%09%09mail.setValue(player, new ArrayList%3C%3E());%0A%09%7D%0A%0A%7D%0A

Add mailbox