Remove all the old stuff in StaffServer, optimize imports

This commit is contained in:
Spencer 2018-01-06 16:50:36 -05:00 committed by Alexander Meech
parent 5c6a9ea879
commit 0a1e1e6119
76 changed files with 32 additions and 2834 deletions

View File

@ -1,9 +1,9 @@
package mineplex.staffServer;
import static mineplex.core.Managers.require;
import java.util.UUID;
import net.minecraft.server.v1_8_R3.MinecraftServer;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
import org.bukkit.plugin.java.JavaPlugin;
@ -20,7 +20,6 @@ import mineplex.core.creature.Creature;
import mineplex.core.disguise.DisguiseManager;
import mineplex.core.donation.DonationManager;
import mineplex.core.elo.EloManager;
import mineplex.core.inventory.InventoryManager;
import mineplex.core.memory.MemoryFix;
import mineplex.core.monitor.LagMeter;
import mineplex.core.npc.NpcManager;
@ -37,8 +36,8 @@ import mineplex.core.status.ServerStatusManager;
import mineplex.core.updater.FileUpdater;
import mineplex.core.updater.Updater;
import mineplex.staffServer.customerSupport.CustomerSupport;
import mineplex.staffServer.salespackage.SalesPackageManager;
import net.minecraft.server.v1_8_R3.MinecraftServer;
import static mineplex.core.Managers.require;
public class StaffServer extends JavaPlugin
{
@ -74,7 +73,7 @@ public class StaffServer extends JavaPlugin
require(DisguiseManager.class);
PowerPlayClubRepository powerPlayRepo = new PowerPlayClubRepository(this, clientManager, donationManager);
new CustomerSupport(this, clientManager, donationManager, new SalesPackageManager(this, clientManager, donationManager, new InventoryManager(this, clientManager), statsManager, powerPlayRepo), powerPlayRepo);
new CustomerSupport(this, clientManager, donationManager, powerPlayRepo);
//Updates
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1);

View File

@ -6,7 +6,6 @@ import mineplex.core.command.CommandBase;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.staffServer.ui.SupportHomePage;
import mineplex.staffServer.ui.SupportShop;
public class CheckCommand extends CommandBase<CustomerSupport>

View File

@ -1,18 +1,15 @@
package mineplex.staffServer.customerSupport;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.time.LocalDate;
import java.time.YearMonth;
import java.time.format.TextStyle;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import java.util.function.Consumer;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
@ -28,8 +25,6 @@ import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.weather.WeatherChangeEvent;
import org.bukkit.plugin.java.JavaPlugin;
import com.sun.org.apache.xpath.internal.operations.Bool;
import mineplex.core.Managers;
import mineplex.core.MiniPlugin;
import mineplex.core.account.CoreClient;
@ -51,11 +46,9 @@ import mineplex.core.powerplayclub.PowerPlayData;
import mineplex.core.stats.PlayerStats;
import mineplex.core.stats.StatsManager;
import mineplex.serverdata.database.ResultSetCallable;
import mineplex.staffServer.repository.BonusEntry;
import mineplex.staffServer.repository.SupportRepository;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class CustomerSupport extends MiniPlugin implements ResultSetCallable
public class CustomerSupport extends MiniPlugin
{
public enum Perm implements Permission
{
@ -68,7 +61,6 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
private CoreClientManager _clientManager;
private DonationManager _donationManager;
private SalesPackageManager _salesPackageManager;
private InventoryManager _inventoryManager;
private SupportRepository _repository;
@ -79,13 +71,12 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
private boolean _allowWeatherChange = false;
public CustomerSupport(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, SalesPackageManager salesPackageManager, PowerPlayClubRepository powerPlayRepo)
public CustomerSupport(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, PowerPlayClubRepository powerPlayRepo)
{
super("Support", plugin);
_clientManager = clientManager;
_donationManager = donationManager;
_salesPackageManager = salesPackageManager;
_repository = new SupportRepository();
_powerPlayRepo = powerPlayRepo;
_inventoryManager = Managers.require(InventoryManager.class);
@ -169,468 +160,6 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
event.setFormat(C.cGold + "%1$s " + C.cWhite + "%2$s");
}
public void Help(Player caller)
{
caller.sendMessage(F.main(getName(), "Usage : /check defek7"));
}
public void showPlayerInfo(Player caller, CoreClient client, boolean bonuses)
{
String playerName = client.getName();
Donor donor = _donationManager.Get(client.getUniqueId());
CustomerSupport instance = this;
runAsync(new Runnable()
{
public void run()
{
//_repository.loadBonusLogForAccountId(client.getAccountId(), instance);
PowerPlayData powerPlayData = _powerPlayRepo.loadData(client.getAccountId()).join();
runSync(new Runnable()
{
public void run()
{
caller.sendMessage(C.cDGreen + C.Strike + "=============================================");
StringBuilder basic = new StringBuilder(C.cBlue + "Name: " + C.cYellow + playerName);
basic.append(" ");
basic.append(C.cBlue + "Rank: " + C.cYellow + client.getPrimaryGroup().getDisplay(false, false, false, true));
if (!bonuses)
{
basic.append(" ");
basic.append(C.cBlue + "Gems: " + C.cYellow + donor.getBalance(GlobalCurrency.GEM));
}
caller.sendMessage(basic.toString());
int enjinCoinsReceived = 0;
int oldChestsReceived = 0;
int ancientChestsReceived = 0;
int mythicalChestsReceived = 0;
int winterChestsReceived = 0;
int illuminatedChestsReceived = 0;
int valentinesGiftsReceived = 0;
int boostersReceived = 0;
int freedomChestsReceived = 0;
int runeAmplifier20 = 0;
int runeAmplifier60 = 0;
int omegaChestsReceived = 0;
int hauntedChestsReceived = 0;
int hauntedChestsOpened = 0;
int trickOrTreatChestsReceived = 0;
int trickOrTreatChests2017Received = 0;
int thankfulChestsReceived = 0;
int gingerbreadChestsReceived = 0;
int minestrikeChestsReceived = 0;
int loveChestsReceived = 0;
int stPatricksChestReceived = 0;
int springChestsReceived = 0;
int clansDyeBoxesReceived = 0;
int clansBuilderBoxesReceived = 0;
int hogChestReceived = 0;
int clansGildedDyeBoxesReceived = 0;
int supplyDropsReceived = 0;
int gildedSupplyDropsReceived = 0;
int bossTokenWizardReceived = 0;
int bossTokenSkeletonReceived = 0;
for (CoinTransactionToken transaction : donor.getCoinTransactions())
{
if (transaction.Source.equalsIgnoreCase("Poll") || transaction.Source.equalsIgnoreCase("Halloween Pumpkin") || transaction.Source.equalsIgnoreCase("Treasure Chest") || transaction.Source.equalsIgnoreCase("Coin Party Bomb Pickup") || transaction.Source.contains("Reward") || transaction.Source.contains("purchase"))
{
if (transaction.Source.contains("purchase"))
enjinCoinsReceived += transaction.Amount;
}
}
for (TransactionToken transaction : donor.getTransactions())
{
if (transaction.SalesPackageName.startsWith("Old Chest"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 3)
oldChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]);
else if (transaction.SalesPackageName.split(" ").length == 2)
oldChestsReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Ancient Chest"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 3)
ancientChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]);
else if (transaction.SalesPackageName.split(" ").length == 2)
ancientChestsReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Mythical Chest"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 3)
mythicalChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]);
else if (transaction.SalesPackageName.split(" ").length == 2)
mythicalChestsReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Winter Chest"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 3)
winterChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]);
else if (transaction.SalesPackageName.split(" ").length == 2)
winterChestsReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Illuminated Chest"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 3)
illuminatedChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]);
else if (transaction.SalesPackageName.split(" ").length == 2)
illuminatedChestsReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Freedom Treasure"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 3)
freedomChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]);
else if (transaction.SalesPackageName.split(" ").length == 2)
freedomChestsReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Omega Chest"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 3)
omegaChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]);
else if (transaction.SalesPackageName.split(" ").length == 2)
omegaChestsReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Haunted Chest"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 3)
hauntedChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]);
else if (transaction.SalesPackageName.split(" ").length == 2)
hauntedChestsReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Trick or Treat Chest"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 5)
trickOrTreatChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[4]);
else if (transaction.SalesPackageName.split(" ").length == 4)
trickOrTreatChestsReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Trick or Treat Chest 2017"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 6)
trickOrTreatChests2017Received += Integer.parseInt(transaction.SalesPackageName.split(" ")[5]);
else if (transaction.SalesPackageName.split(" ").length == 5)
trickOrTreatChests2017Received += 1;
}
}
if (transaction.SalesPackageName.startsWith("Thankful Chest"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 3)
thankfulChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]);
else if (transaction.SalesPackageName.split(" ").length == 2)
thankfulChestsReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Gingerbread Chest"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 3)
gingerbreadChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]);
else if (transaction.SalesPackageName.split(" ").length == 2)
gingerbreadChestsReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Minestrike Chest"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 3)
minestrikeChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]);
else if (transaction.SalesPackageName.split(" ").length == 2)
minestrikeChestsReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Love Chest"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 3)
loveChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]);
else if (transaction.SalesPackageName.split(" ").length == 2)
loveChestsReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("St Patricks Chest"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 4)
stPatricksChestReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[3]);
else if (transaction.SalesPackageName.split(" ").length == 3)
stPatricksChestReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Spring Chest"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 3)
springChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]);
else if (transaction.SalesPackageName.split(" ").length == 2)
springChestsReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Valentines Gift"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 3)
valentinesGiftsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]);
else if (transaction.SalesPackageName.split(" ").length == 2)
valentinesGiftsReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Game Booster"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 3)
boostersReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]);
else if (transaction.SalesPackageName.split(" ").length == 2)
boostersReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Rune Amplifier 20"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 4)
runeAmplifier20 += Integer.parseInt(transaction.SalesPackageName.split(" ")[3]);
else if (transaction.SalesPackageName.split(" ").length == 3)
runeAmplifier20 += 1;
}
}
if (transaction.SalesPackageName.startsWith("Rune Amplifier 60"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 4)
runeAmplifier60 += Integer.parseInt(transaction.SalesPackageName.split(" ")[3]);
else if (transaction.SalesPackageName.split(" ").length == 3)
runeAmplifier60 += 1;
}
}
if (transaction.SalesPackageName.startsWith("Clans Dye Box"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 4)
clansDyeBoxesReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[3]);
else if (transaction.SalesPackageName.split(" ").length == 3)
clansDyeBoxesReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Clans Builder Box"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 4)
clansBuilderBoxesReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[3]);
else if (transaction.SalesPackageName.split(" ").length == 3)
clansBuilderBoxesReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("HOG Chest"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 3)
hogChestReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]);
else if (transaction.SalesPackageName.split(" ").length == 2)
hogChestReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Clans Gilded Dye Box"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 5)
clansGildedDyeBoxesReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[4]);
else if (transaction.SalesPackageName.split(" ").length == 4)
clansGildedDyeBoxesReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Clans Supply Drop"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 4)
supplyDropsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[3]);
else if (transaction.SalesPackageName.split(" ").length == 3)
supplyDropsReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Clans Gilded Supply Drop"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 5)
gildedSupplyDropsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[4]);
else if (transaction.SalesPackageName.split(" ").length == 4)
gildedSupplyDropsReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Clans Boss Token Wizard"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 5)
bossTokenWizardReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[4]);
else if (transaction.SalesPackageName.split(" ").length == 4)
bossTokenWizardReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Clans Boss Token Skeleton"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 5)
bossTokenSkeletonReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[4]);
else if (transaction.SalesPackageName.split(" ").length == 4)
bossTokenSkeletonReceived += 1;
}
}
}
StatsManager statsManager = Managers.get(StatsManager.class);
if (statsManager != null)
{
try
{
PlayerStats playerStats = statsManager.getOfflinePlayerStats(playerName).get();
if (playerStats != null)
{
hauntedChestsOpened = (int) playerStats.getStat("Global.Treasure.Haunted");
}
}
catch (InterruptedException | ExecutionException e)
{
e.printStackTrace();
}
}
if (!bonuses)
{
StringBuilder shards = new StringBuilder(C.cBlue + "Enjin Shard Total Received: " + C.cYellow + enjinCoinsReceived);
shards.append(" ");
shards.append(C.cBlue + "Shards: " + C.cYellow + donor.getBalance(GlobalCurrency.TREASURE_SHARD));
caller.sendMessage(shards.toString());
// Strutt20 asked me to remove some stuff from the menu
caller.sendMessage(C.cBlue + "Old Chests Received: " + C.cYellow + oldChestsReceived + " " + C.cBlue + "Ancient Chests Received: " + C.cYellow + ancientChestsReceived);
caller.sendMessage(C.cBlue + "Mythical Chests Received: " + C.cYellow + mythicalChestsReceived + " " + C.cBlue + "Illuminated Chests Received: " + C.cYellow + illuminatedChestsReceived);
caller.sendMessage(C.cBlue + "Omega Chests Received: " + C.cYellow + omegaChestsReceived);
caller.sendMessage(C.cBlue + "Haunted Chests Received: " + C.cYellow + hauntedChestsReceived + " " + C.cBlue + "Haunted Chests Opened: " + C.cYellow + hauntedChestsOpened);
caller.sendMessage(C.cBlue + "Trick or Treat Chests Received: " + C.cYellow + trickOrTreatChestsReceived + " " + C.cBlue + "Thankful Chests Received: " + C.cYellow + thankfulChestsReceived);
caller.sendMessage(C.cBlue + "Trick or Treat Bags 2017 Received: " + C.cYellow + trickOrTreatChests2017Received);
caller.sendMessage(C.cBlue + "Gingerbread Chests Received: " + C.cYellow + gingerbreadChestsReceived + " " + C.cBlue + "Minestrike Chests Received: " + C.cYellow + minestrikeChestsReceived);
caller.sendMessage(C.cBlue + "Love Chests Received: " + C.cYellow + loveChestsReceived);
caller.sendMessage(C.cBlue + "St Patrick's Chests Received: " + C.cYellow + stPatricksChestReceived);
caller.sendMessage(C.cBlue + "Spring Chests Received: " + C.cYellow + springChestsReceived);
caller.sendMessage(C.cBlue + "Freedom Chests Received: " + C.cYellow + freedomChestsReceived);
caller.sendMessage(C.cBlue + "Game Amplifiers Received: " + C.cYellow + boostersReceived);
caller.sendMessage(C.cBlue + "HOG Chests Received: " + C.cYellow + hogChestReceived);
caller.sendMessage(C.cBlue + "Rune Amplifiers (20 min/60 min) Received: " + C.cYellow + runeAmplifier20 + "/" + runeAmplifier60);
caller.sendMessage(C.cBlue + "Clans Dye Boxes Received: " + C.cYellow + clansDyeBoxesReceived + " " + C.cBlue + "Clans Builder Boxes Received: " + C.cYellow + clansBuilderBoxesReceived);
caller.sendMessage(C.cBlue + "Clan Banner Usage: " + getLockedPackageStr(client.getUniqueId(), "Clan Banner Usage") + " " + C.cBlue + "Clan Banner Editor: " + getLockedPackageStr(client.getUniqueId(), "Clan Banner Editor"));
caller.sendMessage(C.cBlue + "Clans Gilded Dye Boxes Received: " + C.cYellow + clansGildedDyeBoxesReceived);
caller.sendMessage(C.cBlue + "Supply Drops Received: " + C.cYellow + supplyDropsReceived + " " + C.cBlue + "Gilded Supply Drops Received: " + C.cYellow + gildedSupplyDropsReceived);
caller.sendMessage(C.cBlue + "Wizard Summon Tokens Received: " + C.cYellow + bossTokenWizardReceived + " " + C.cBlue + "Skeleton Summon Tokens Received: " + C.cYellow + bossTokenSkeletonReceived);
YearMonth yearMonth = YearMonth.now();
caller.sendMessage(C.cBlue + "Power Play Subscription (" + yearMonth.getMonth().getDisplayName(TextStyle.FULL, Locale.US) + ") " + (powerPlayData.isSubscribed() ? C.cGreen + "Active" : C.cRed + "Inactive"));
if (powerPlayData.isSubscribed())
{
caller.sendMessage(C.cBlue + "Power Play Chest/Amplifiers (" + yearMonth.getMonth().getDisplayName(TextStyle.FULL, Locale.US) + ") " + (powerPlayData.getUnclaimedMonths().contains(YearMonth.now()) ? C.cGreen + "Unclaimed" : C.cRed + "Claimed"));
LocalDate nextClaimDate = powerPlayData.getNextClaimDate().get(); // Guaranteed by isSubscribed()
caller.sendMessage(C.cBlue + "Power Play Next Claim Date " + C.cYellow + nextClaimDate.getMonth().getDisplayName(TextStyle.FULL, Locale.US) + " " + nextClaimDate.getDayOfMonth());
}
}
else
{
caller.sendMessage(C.cBlue + "Monthly Bonus Log (Last 6 entries):");
if (_accountBonusLog.containsKey(client.getAccountId()))
{
for (String logEntry : _accountBonusLog.get(client.getAccountId()))
{
caller.sendMessage(C.cYellow + logEntry);
}
}
}
caller.sendMessage(C.cDGreen + C.Strike + "=============================================");
if (!bonuses)
{
_salesPackageManager.displaySalesPackages(caller, playerName);
}
_accountBonusLog.remove(client.getAccountId());
}
});
}
});
}
public void showPlayerPackageInfo(Player caller, CoreClient client, String salesPackage)
{
runAsync(() ->
{
//_repository.loadBonusLogForAccountId(client.getAccountId(), CustomerSupport.this);
runSync(() ->
{
caller.sendMessage(C.cBlue + salesPackage + ": " + getLockedPackageStr(client.getUniqueId(), salesPackage));
_accountBonusLog.remove(client.getAccountId());
});
});
}
@EventHandler
public void blockBreak(BlockBreakEvent event)
@ -663,22 +192,6 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
}
}
@Override
public void processResultSet(ResultSet resultSet) throws SQLException
{
List<String> log = new ArrayList<String>();
int accountId = 0;
while (resultSet.next() && log.size() < 6)
{
accountId = resultSet.getInt(1);
log.add("Received " + resultSet.getInt(3) + " " + resultSet.getString(2) + " on " + resultSet.getDate(4));
}
if (accountId != 0)
_accountBonusLog.put(accountId, log);
}
private String getLockedPackageStr(UUID uuid, String name)
{
if (_donationManager.Get(uuid).ownsUnknownSalesPackage(name))

View File

@ -1,16 +0,0 @@
package mineplex.staffServer.helpdesk;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.MiniPlugin;
import mineplex.staffServer.helpdesk.repository.ApiGetCall;
public class HelpDeskManager extends MiniPlugin
{
public HelpDeskManager(JavaPlugin plugin)
{
super("Help Desk", plugin);
new ApiGetCall("https://mineplex.jitbit.com/helpdesk/api", "Tickets&");
}
}

View File

@ -1,29 +0,0 @@
package mineplex.staffServer.helpdesk;
public class ListTicketToken
{
public int IssueID;
public int Priority;
public int StatusID;
public String IssueDate;
public String Subject;
public String Status;
public boolean UpdatedByUser;
public boolean UpdatedByPerformer;
public int CategoryID;
public String UserName;
public String Technician;
public String FirstName;
public String LastName;
public String DueDate;
public String TechFirstName;
public String TechLastName;
public String LastUpdated;
public boolean UpdatedForTechView;
public int UserID;
public int CompanyID;
public String CompanyName;
public int SectionID;
public int AssignedToUserID;
public String Category;
}

View File

@ -1,22 +0,0 @@
package mineplex.staffServer.helpdesk;
public class TicketToken
{
public int TicketID;
public int UserID;
public int AssignedToUserID;
public String IssueDate;
public String Subject;
public String Body;
public int Priority;
public int StatusID;
public int CategoryID;
public String DueDate;
public String ResolvedDate;
public String StartDate;
public int TimeSpentInSeconds;
public boolean IsCurrentUserTechInThisCategory;
public boolean IsCurrentCategoryForTechsOnly;
public boolean SubmittedByCurrentUser;
public boolean IsInKb;
}

View File

@ -1,19 +0,0 @@
package mineplex.staffServer.helpdesk.repository;
import org.apache.http.client.methods.HttpDelete;
public class ApiDeleteCall extends HelpDeskApiCallBase
{
public ApiDeleteCall(String apiUrl, int domainId, String category)
{
super(apiUrl, domainId, category);
}
public void Execute()
{
HttpDelete request = new HttpDelete(ApiUrl + DomainId + Category);
System.out.println(request.getURI().toString());
System.out.println(execute(request));
}
}

View File

@ -1,128 +0,0 @@
package mineplex.staffServer.helpdesk.repository;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.conn.scheme.PlainSocketFactory;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.PoolingClientConnectionManager;
public class ApiGetCall
{
protected String ApiUrl = "https://mineplex.jitbit.com/helpdesk/api";
protected String SecretKey = "?sharedSecret={WzG49S3L6spqt4}";
private String _action;
public ApiGetCall(String apiUrl, String action)
{
ApiUrl = apiUrl;
_action = action;
}
protected String execute()
{
HttpGet request = new HttpGet(ApiUrl + SecretKey + "&" + _action);
SchemeRegistry schemeRegistry = new SchemeRegistry();
schemeRegistry.register(new Scheme("https", 80, PlainSocketFactory.getSocketFactory()));
PoolingClientConnectionManager connectionManager = new PoolingClientConnectionManager(schemeRegistry);
connectionManager.setMaxTotal(200);
connectionManager.setDefaultMaxPerRoute(20);
HttpClient httpClient = new DefaultHttpClient(connectionManager);
InputStream in = null;
String response = "";
try
{
HttpResponse httpResponse = httpClient.execute(request);
if (httpResponse != null)
{
in = httpResponse.getEntity().getContent();
response = convertStreamToString(in);
}
}
catch (Exception ex)
{
System.out.println("HelpDeskApiCall Error:\n" + ex.getMessage());
for (StackTraceElement trace : ex.getStackTrace())
{
System.out.println(trace);
}
}
finally
{
httpClient.getConnectionManager().shutdown();
if (in != null)
{
try
{
in.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
return response;
}
protected String convertStreamToString(InputStream is)
{
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
StringBuilder sb = new StringBuilder();
String line = null;
try
{
while ((line = reader.readLine()) != null)
{
sb.append(line + "\n");
}
}
catch (IOException e)
{
e.printStackTrace();
}
finally
{
try
{
is.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
return sb.toString();
}
public void Execute()
{
}
/*
public <T> T Execute(Type returnType)
{
HttpGet request = new HttpGet(ApiUrl + DomainId + Category + _action);
String response = execute(request);
System.out.println(response);
return new Gson().fromJson(response, returnType);
}
*/
}

View File

@ -1,79 +0,0 @@
package mineplex.staffServer.helpdesk.repository;
import java.lang.reflect.Type;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.message.BasicHeader;
import org.apache.http.protocol.HTTP;
import com.google.gson.Gson;
public class ApiPostCall extends HelpDeskApiCallBase
{
private String _action;
public ApiPostCall(String apiUrl, int domainId, String category, String action)
{
super(apiUrl, domainId, category);
_action = action;
}
public void Execute(Object argument)
{
Gson gson = new Gson();
HttpPost request = new HttpPost(ApiUrl + DomainId + Category + _action);
System.out.println(request.getURI().toString());
try
{
StringEntity params = new StringEntity(gson.toJson(argument));
params.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
request.setEntity(params);
}
catch (Exception exception)
{
System.out.println("Error executing ApiPostCall(Object): \n" + exception.getMessage());
for (StackTraceElement trace : exception.getStackTrace())
{
System.out.println(trace);
}
}
System.out.println(execute(request));
}
public <T> T Execute(Class<T> returnClass)
{
return Execute(returnClass, (Object)null);
}
public <T> T Execute(Type returnType, Object argument)
{
Gson gson = new Gson();
HttpPost request = new HttpPost(ApiUrl + DomainId + Category + _action);
System.out.println(request.getURI().toString());
try
{
StringEntity params = new StringEntity(gson.toJson(argument));
params.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
request.setEntity(params);
}
catch (Exception exception)
{
System.out.println("Error executing ApiPostCall(Type, Object): \n" + exception.getMessage());
for (StackTraceElement trace : exception.getStackTrace())
{
System.out.println(trace);
}
}
String response = execute(request);
System.out.println(response);
return new Gson().fromJson(response, returnType);
}
}

View File

@ -1,80 +0,0 @@
package mineplex.staffServer.helpdesk.repository;
import java.lang.reflect.Type;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.StringEntity;
import org.apache.http.message.BasicHeader;
import org.apache.http.protocol.HTTP;
import com.google.gson.Gson;
public class ApiPutCall extends HelpDeskApiCallBase
{
private String _action;
public ApiPutCall(String apiUrl, int domainId, String category, String action)
{
super(apiUrl, domainId, category);
_action = action;
}
public void Execute(Object argument)
{
Gson gson = new Gson();
HttpPut request = new HttpPut(ApiUrl + DomainId + Category + _action);
System.out.println(request.getURI().toString());
try
{
StringEntity params = new StringEntity(gson.toJson(argument));
params.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
request.setEntity(params);
}
catch (Exception exception)
{
System.out.println("Error executing ApiPutCall(Object): \n" + exception.getMessage());
for (StackTraceElement trace : exception.getStackTrace())
{
System.out.println(trace);
}
}
System.out.println(execute(request));
}
public <T> T Execute(Class<T> returnClass)
{
return Execute(returnClass, (Object)null);
}
public <T> T Execute(Type returnType, Object argument)
{
Gson gson = new Gson();
HttpPut request = new HttpPut(ApiUrl + DomainId + Category + _action);
System.out.println(request.getURI().toString());
try
{
StringEntity params = new StringEntity(gson.toJson(argument));
params.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
request.setEntity(params);
}
catch (Exception exception)
{
System.out.println("Error executing ApiPutCall(Type, Object): \n" + exception.getMessage());
for (StackTraceElement trace : exception.getStackTrace())
{
System.out.println(trace);
}
}
String response = execute(request);
System.out.println(response);
return new Gson().fromJson(response, returnType);
}
}

View File

@ -1,128 +0,0 @@
package mineplex.staffServer.helpdesk.repository;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Locale;
import java.util.TimeZone;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.codec.binary.Hex;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.conn.scheme.PlainSocketFactory;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.PoolingClientConnectionManager;
public abstract class HelpDeskApiCallBase
{
protected String ApiUrl = "https://mineplex.jitbit.com/helpdesk/api";
protected int DomainId = 962728;
protected String Category = "";
public HelpDeskApiCallBase(String apiUrl, int domainId, String category)
{
ApiUrl = apiUrl;
DomainId = domainId;
Category = category;
}
protected String execute(HttpRequestBase request)
{
SchemeRegistry schemeRegistry = new SchemeRegistry();
schemeRegistry.register(new Scheme("https", 80, PlainSocketFactory.getSocketFactory()));
PoolingClientConnectionManager connectionManager = new PoolingClientConnectionManager(schemeRegistry);
connectionManager.setMaxTotal(200);
connectionManager.setDefaultMaxPerRoute(20);
HttpClient httpClient = new DefaultHttpClient(connectionManager);
InputStream in = null;
String response = "";
try
{
HttpResponse httpResponse = httpClient.execute(request);
if (httpResponse != null)
{
in = httpResponse.getEntity().getContent();
response = convertStreamToString(in);
}
}
catch (Exception ex)
{
System.out.println("HelpDeskApiCall Error:\n" + ex.getMessage());
for (StackTraceElement trace : ex.getStackTrace())
{
System.out.println(trace);
}
}
finally
{
httpClient.getConnectionManager().shutdown();
if (in != null)
{
try
{
in.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
return response;
}
protected String getServerTime()
{
Calendar calendar = Calendar.getInstance();
SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
return dateFormat.format(calendar.getTime());
}
protected String convertStreamToString(InputStream is)
{
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
StringBuilder sb = new StringBuilder();
String line = null;
try
{
while ((line = reader.readLine()) != null)
{
sb.append(line + "\n");
}
}
catch (IOException e)
{
e.printStackTrace();
}
finally
{
try
{
is.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
return sb.toString();
}
}

View File

@ -1,6 +0,0 @@
package mineplex.staffServer.helpdesk.repository;
public class HelpDeskRepository
{
}

View File

@ -1,241 +0,0 @@
package mineplex.staffServer.salespackage;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.MiniPlugin;
import mineplex.core.account.CoreClientManager;
import mineplex.core.account.permissions.Permission;
import mineplex.core.account.permissions.PermissionGroup;
import mineplex.core.common.jsonchat.JsonMessage;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.donation.DonationManager;
import mineplex.core.inventory.InventoryManager;
import mineplex.core.pet.PetType;
import mineplex.core.pet.repository.PetRepository;
import mineplex.core.powerplayclub.PowerPlayClubRepository;
import mineplex.core.stats.StatsManager;
import mineplex.staffServer.salespackage.command.DisplayPackageCommand;
import mineplex.staffServer.salespackage.command.Sales;
import mineplex.staffServer.salespackage.salespackages.AncientChest;
import mineplex.staffServer.salespackage.salespackages.ApplyKits;
import mineplex.staffServer.salespackage.salespackages.ClanBannerEditor;
import mineplex.staffServer.salespackage.salespackages.ClanBannerUsage;
import mineplex.staffServer.salespackage.salespackages.ClansBossToken;
import mineplex.staffServer.salespackage.salespackages.ClansBox;
import mineplex.staffServer.salespackage.salespackages.ClansSupplyDrop;
import mineplex.staffServer.salespackage.salespackages.Coins;
import mineplex.staffServer.salespackage.salespackages.DefaultRank;
import mineplex.staffServer.salespackage.salespackages.FreedomChest;
import mineplex.staffServer.salespackage.salespackages.GingerbreadChest;
import mineplex.staffServer.salespackage.salespackages.HOGChest;
import mineplex.staffServer.salespackage.salespackages.HauntedChest;
import mineplex.staffServer.salespackage.salespackages.IlluminatedChest;
import mineplex.staffServer.salespackage.salespackages.LifetimeEternal;
import mineplex.staffServer.salespackage.salespackages.LifetimeHero;
import mineplex.staffServer.salespackage.salespackages.LifetimeLegend;
import mineplex.staffServer.salespackage.salespackages.LifetimeTitan;
import mineplex.staffServer.salespackage.salespackages.LifetimeUltra;
import mineplex.staffServer.salespackage.salespackages.LoveChest;
import mineplex.staffServer.salespackage.salespackages.MinestrikeChest;
import mineplex.staffServer.salespackage.salespackages.MythicalChest;
import mineplex.staffServer.salespackage.salespackages.OldChest;
import mineplex.staffServer.salespackage.salespackages.OmegaChest;
import mineplex.staffServer.salespackage.salespackages.Pet;
import mineplex.staffServer.salespackage.salespackages.PowerPlayClub;
import mineplex.staffServer.salespackage.salespackages.RainbowBundle;
import mineplex.staffServer.salespackage.salespackages.RuneAmplifier;
import mineplex.staffServer.salespackage.salespackages.SalesPackageBase;
import mineplex.staffServer.salespackage.salespackages.SpringChest;
import mineplex.staffServer.salespackage.salespackages.StPatricksChest;
import mineplex.staffServer.salespackage.salespackages.ThankfulChest;
import mineplex.staffServer.salespackage.salespackages.TrickOrTreatChest2017;
import mineplex.staffServer.salespackage.salespackages.TrickOrTreatChest;
public class SalesPackageManager extends MiniPlugin
{
public enum Perm implements Permission
{
SALES_COMMAND,
DISPLAY_PACKAGE_COMMAND,
}
private CoreClientManager _clientManager;
private DonationManager _donationManager;
private InventoryManager _inventoryManager;
private StatsManager _statsManager;
private PowerPlayClubRepository _powerPlayRepo;
private PetRepository _petRepo;
private NautHashMap<String, SalesPackageBase> _salesPackages = new NautHashMap<String, SalesPackageBase>();
public SalesPackageManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager, StatsManager statsManager, PowerPlayClubRepository powerPlayRepo)
{
super("SalesPackageManager", plugin);
_clientManager = clientManager;
_donationManager = donationManager;
_inventoryManager = inventoryManager;
_statsManager = statsManager;
_powerPlayRepo = powerPlayRepo;
_petRepo = new PetRepository();
//Strutt20 asked me to remove some of the stuff from the menu
addSalesPackage(new Coins(this, 5000));
addSalesPackage(new Coins(this, 25000));
addSalesPackage(new Coins(this, 75000));
//addSalesPackage(new MonthlyUltra(this));
//addSalesPackage(new MonthlyHero(this));
addSalesPackage(new DefaultRank(this));
addSalesPackage(new LifetimeUltra(this));
addSalesPackage(new LifetimeHero(this));
addSalesPackage(new LifetimeLegend(this));
addSalesPackage(new LifetimeTitan(this));
addSalesPackage(new LifetimeEternal(this));
//addSalesPackage(new GemHunter(this, 4));
//addSalesPackage(new GemHunter(this, 8));
addSalesPackage(new ApplyKits(this));
addSalesPackage(new OldChest(this));
addSalesPackage(new AncientChest(this));
addSalesPackage(new MythicalChest(this));
addSalesPackage(new IlluminatedChest(this));
addSalesPackage(new FreedomChest(this));
addSalesPackage(new GingerbreadChest(this));
//addSalesPackage(new ValentinesGift(this));
//addSalesPackage(new FrostLord(this));
//addSalesPackage(new EasterBunny(this));
addSalesPackage(new ClanBannerUsage(this));
addSalesPackage(new ClanBannerEditor(this));
addSalesPackage(new RuneAmplifier(this, 20));
addSalesPackage(new RuneAmplifier(this, 60));
addSalesPackage(new ClansBox(this, "Dye"));
addSalesPackage(new ClansBox(this, "Gilded Dye"));
addSalesPackage(new ClansBox(this, "Builder"));
addSalesPackage(new ClansSupplyDrop(this, false));
addSalesPackage(new ClansSupplyDrop(this, true));
addSalesPackage(new ClansBossToken(this, "Wizard"));
addSalesPackage(new ClansBossToken(this, "Skeleton"));
addSalesPackage(new PowerPlayClub(this, false));
addSalesPackage(new PowerPlayClub(this, true));
addSalesPackage(new OmegaChest(this));
addSalesPackage(new HauntedChest(this));
addSalesPackage(new MinestrikeChest(this));
addSalesPackage(new LoveChest(this));
addSalesPackage(new StPatricksChest(this));
addSalesPackage(new SpringChest(this));
addSalesPackage(new TrickOrTreatChest(this));
addSalesPackage(new ThankfulChest(this));
addSalesPackage(new HOGChest(this));
addSalesPackage(new TrickOrTreatChest2017(this));
addSalesPackage(new RainbowBundle(this));
for (PetType petType : PetType.values())
{
addSalesPackage(new Pet(this, petType.getName(), petType));
}
generatePermissions();
}
private void generatePermissions()
{
PermissionGroup.SUPPORT.setPermission(Perm.SALES_COMMAND, true, true);
PermissionGroup.SUPPORT.setPermission(Perm.DISPLAY_PACKAGE_COMMAND, true, true);
}
private void addSalesPackage(SalesPackageBase salesPackage)
{
_salesPackages.put(salesPackage.getName(), salesPackage);
}
@Override
public void addCommands()
{
addCommand(new DisplayPackageCommand(this));
addCommand(new Sales(this));
}
public DonationManager getDonationManager()
{
return _donationManager;
}
public CoreClientManager getClientManager()
{
return _clientManager;
}
public InventoryManager getInventoryManager()
{
return _inventoryManager;
}
public PowerPlayClubRepository getPowerPlay()
{
return _powerPlayRepo;
}
public PetRepository getPetRepo()
{
return _petRepo;
}
public void displayPackage(Player caller, String playerName, String packageName)
{
_salesPackages.get(packageName).displayToAgent(caller, playerName);
}
public void displaySalesPackages(Player caller, String playerName)
{
JsonMessage coinBuilder = new JsonMessage("Shards : ").color("blue");
JsonMessage packageBuilder = new JsonMessage("Rank Packages : ").color("blue");
JsonMessage chestBuilder = new JsonMessage("Chest Packages : ").color("blue");
JsonMessage clanBuilder = new JsonMessage("Clan Packages : ").color("blue");
JsonMessage powerPlayBuilder = new JsonMessage("Power Play Club Packages : ").color("blue");
JsonMessage petBuilder = new JsonMessage("Pet Packages : ").color("blue");
for (SalesPackageBase salesPackage : _salesPackages.values())
{
if (salesPackage instanceof Coins)
{
coinBuilder = coinBuilder.extra("[").color("gray").extra(salesPackage.getName()).color("green").click("run_command", "/display " + playerName + " " + salesPackage.getName()).extra("] ").color("gray");
}
else if (salesPackage instanceof MythicalChest || salesPackage instanceof AncientChest || salesPackage instanceof OldChest || salesPackage instanceof IlluminatedChest || salesPackage instanceof FreedomChest || salesPackage instanceof HauntedChest || salesPackage instanceof TrickOrTreatChest
|| salesPackage instanceof ThankfulChest || salesPackage instanceof GingerbreadChest || salesPackage instanceof MinestrikeChest || salesPackage instanceof LoveChest || salesPackage instanceof StPatricksChest
|| salesPackage instanceof SpringChest || salesPackage instanceof HOGChest || salesPackage instanceof TrickOrTreatChest2017)
{
chestBuilder = chestBuilder.extra("[").color("gray").extra(salesPackage.getName()).color("green").click("run_command", "/display " + playerName + " " + salesPackage.getName()).extra("] ").color("gray");
}
else if (salesPackage instanceof ClanBannerEditor || salesPackage instanceof ClanBannerUsage || salesPackage instanceof RuneAmplifier || salesPackage instanceof ClansBox || salesPackage instanceof ClansSupplyDrop || salesPackage instanceof ClansBossToken)
{
clanBuilder = clanBuilder.extra("[").color("gray").extra(salesPackage.getName()).color("green").click("run_command", "/display " + playerName + " " + salesPackage.getName()).extra("] ").color("gray");
}
else if (salesPackage instanceof PowerPlayClub || salesPackage instanceof OmegaChest)
{
powerPlayBuilder = powerPlayBuilder.extra("[").color("gray").extra(salesPackage.getName()).color("green").click("run_command", "/display " + playerName + " " + salesPackage.getName()).extra("] ").color("gray");
}
else if (salesPackage instanceof Pet)
{
petBuilder = petBuilder.extra("[").color("gray").extra(salesPackage.getName()).color("green").click("run_command", "/display " + playerName + " " + salesPackage.getName()).extra("] ").color("gray");
}
else
{
packageBuilder = packageBuilder.extra("[").color("gray").extra(salesPackage.getName()).color("green").click("run_command", "/display " + playerName + " " + salesPackage.getName()).extra("] ").color("gray");
}
}
coinBuilder.sendToPlayer(caller);
chestBuilder.sendToPlayer(caller);
packageBuilder.sendToPlayer(caller);
clanBuilder.sendToPlayer(caller);
powerPlayBuilder.sendToPlayer(caller);
petBuilder.sendToPlayer(caller);
}
public StatsManager getStatsManager()
{
return _statsManager;
}
}

View File

@ -1,47 +0,0 @@
package mineplex.staffServer.salespackage.command;
import org.bukkit.entity.Player;
import mineplex.core.command.CommandBase;
import mineplex.core.common.currency.GlobalCurrency;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class CoinCommand extends CommandBase<SalesPackageManager>
{
public CoinCommand(SalesPackageManager plugin)
{
super(plugin, SalesPackageManager.Perm.SALES_COMMAND, "coin", "shard", "shards");
}
@Override
public void Execute(final Player caller, String[] args)
{
if (args == null || args.length != 2)
return;
final String playerName = args[0];
final int amount = Integer.parseInt(args[1]);
Plugin.getClientManager().getOrLoadClient(playerName, client ->
{
if (client != null)
{
Plugin.getDonationManager().rewardCurrency(GlobalCurrency.TREASURE_SHARD, client, caller.getName(), amount, completed ->
{
if (completed)
{
caller.sendMessage(F.main(Plugin.getName(), "Added " + amount + " shards to " + playerName + "'s account!"));
}
else
{
UtilPlayer.message(caller, F.main(Plugin.getName(), "There was an error giving " + F.elem(amount + "Shards") + " to " + F.name(playerName) + "."));
}
});
}
else
caller.sendMessage(F.main(Plugin.getName(), "Couldn't find " + playerName + "'s account!"));
});
}
}

View File

@ -1,37 +0,0 @@
package mineplex.staffServer.salespackage.command;
import org.bukkit.entity.Player;
import mineplex.core.command.CommandBase;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class DisplayPackageCommand extends CommandBase<SalesPackageManager>
{
public DisplayPackageCommand(SalesPackageManager plugin)
{
super(plugin, SalesPackageManager.Perm.DISPLAY_PACKAGE_COMMAND, "display");
}
@Override
public void Execute(Player caller, String[] args)
{
if (args == null || args.length < 2)
return;
String playerName = args[0];
String packageName = args[1];
if (args.length > 2)
{
for (int i = 2; i < args.length; i++)
{
packageName += " " + args[i];
}
}
if (packageName.equalsIgnoreCase("ALL"))
Plugin.displaySalesPackages(caller, playerName);
else
Plugin.displayPackage(caller, playerName, packageName);
}
}

View File

@ -1,48 +0,0 @@
package mineplex.staffServer.salespackage.command;
import org.bukkit.entity.Player;
import mineplex.core.command.CommandBase;
import mineplex.core.common.currency.GlobalCurrency;
import mineplex.core.common.util.F;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class GemHunterCommand extends CommandBase<SalesPackageManager>
{
public GemHunterCommand(SalesPackageManager plugin)
{
super(plugin, SalesPackageManager.Perm.SALES_COMMAND, "gemhunter");
}
@Override
public void Execute(final Player caller, String[] args)
{
if (args == null || args.length != 2)
return;
final String playerName = args[0];
final int amount = Integer.parseInt(args[1]);
int tempExp = 0;
if (amount == 4)
tempExp = 70000;
else if (amount == 8)
tempExp = 220000;
final long experience = tempExp;
Plugin.getClientManager().loadClientByName(playerName, client ->
{
if (client != null)
{
Plugin.getDonationManager().purchaseUnknownSalesPackage(client, "Gem Hunter Level " + amount, GlobalCurrency.GEM, 0, false, null);
Plugin.getStatsManager().incrementStat(client.getAccountId(), "Global.GemsEarned", experience);
caller.sendMessage(F.main(Plugin.getName(), "Added Level " + amount + " Gem Hunter to " + playerName + "'s account!"));
}
else
{
caller.sendMessage(F.main(Plugin.getName(), "Couldn't find " + playerName + "'s account!"));
}
});
}
}

View File

@ -1,29 +0,0 @@
package mineplex.staffServer.salespackage.command;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import mineplex.core.command.CommandBase;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class HeroCommand extends CommandBase<SalesPackageManager>
{
public HeroCommand(SalesPackageManager plugin)
{
super(plugin, SalesPackageManager.Perm.SALES_COMMAND, "hero");
}
@Override
public void Execute(Player caller, String[] args)
{
resetCommandCharge(caller);
Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales rank " + args[0] + " HERO false"));
resetCommandCharge(caller);
Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales coin " + args[0] + " 15000"));
resetCommandCharge(caller);
Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales booster " + args[0] + " 90"));
}
}

View File

@ -1,91 +0,0 @@
package mineplex.staffServer.salespackage.command;
import java.util.UUID;
import org.bukkit.entity.Player;
import mineplex.core.command.CommandBase;
import mineplex.core.common.currency.GlobalCurrency;
import mineplex.core.common.util.Callback;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.server.util.TransactionResponse;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class ItemCommand extends CommandBase<SalesPackageManager>
{
public ItemCommand(SalesPackageManager plugin)
{
super(plugin, SalesPackageManager.Perm.SALES_COMMAND, "item");
}
@Override
public void Execute(final Player caller, String[] args)
{
if (args == null)
return;
final String playerName = args[0];
int amountSpecified = Integer.parseInt(args[1]);
final String category = args[2];
String tempName = args[3];
for (int i = 4; i < args.length; i++)
{
tempName += " " + args[i];
}
final String itemName = tempName;
final int amount = amountSpecified;
if (!Plugin.getInventoryManager().validItem(itemName))
{
caller.sendMessage(F.main(Plugin.getName(), "You have entered an invalid Item."));
return;
}
Plugin.getClientManager().loadClientByName(playerName, client ->
{
final UUID uuid = Plugin.getClientManager().loadUUIDFromDB(playerName);
if (uuid != null)
{
Plugin.getDonationManager().purchaseUnknownSalesPackage(client, (amount == 1 ? itemName : itemName + " " + amount), GlobalCurrency.GEM, 0, false, data ->
{
if (category.equalsIgnoreCase("ITEM"))
{
Plugin.getInventoryManager().addItemToInventoryForOffline(new Callback<Boolean>()
{
public void run(Boolean success)
{
if (success)
{
UtilPlayer.message(caller, F.main(Plugin.getName(), playerName + " received " + amount + " " + itemName + "."));
}
else
{
UtilPlayer.message(caller, F.main(Plugin.getName(), "ERROR processing " + playerName + " " + amount + " " + itemName + "."));
}
}
}, uuid, itemName, amount);
}
else
{
if (data == TransactionResponse.Success || data == TransactionResponse.AlreadyOwns)
{
UtilPlayer.message(caller, F.main(Plugin.getName(), playerName + " received " + amount + " " + itemName + "."));
}
else if (data == TransactionResponse.Failed || data == TransactionResponse.InsufficientFunds)
{
UtilPlayer.message(caller, F.main(Plugin.getName(), "ERROR processing " + playerName + " " + amount + " " + itemName + "."));
}
}
});
}
else
{
caller.sendMessage(F.main(Plugin.getName(), "Couldn't find " + playerName + "'s account!"));
}
});
}
}

View File

@ -1,27 +0,0 @@
package mineplex.staffServer.salespackage.command;
import org.bukkit.entity.Player;
import mineplex.core.command.CommandBase;
import mineplex.core.common.util.F;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class KitsCommand extends CommandBase<SalesPackageManager>
{
public KitsCommand(SalesPackageManager plugin)
{
super(plugin, SalesPackageManager.Perm.SALES_COMMAND, "kits");
}
@Override
public void Execute(Player caller, String[] args)
{
if (args == null || args.length != 1)
return;
String playerName = args[0];
Plugin.getDonationManager().applyKits(playerName);
caller.sendMessage(F.main(Plugin.getName(), "Unlocked kits for " + playerName + "'s account!"));
}
}

View File

@ -1,32 +0,0 @@
package mineplex.staffServer.salespackage.command;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import mineplex.core.command.CommandBase;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class LifetimeEternalCommand extends CommandBase<SalesPackageManager>
{
public LifetimeEternalCommand(SalesPackageManager plugin)
{
super(plugin, SalesPackageManager.Perm.SALES_COMMAND, "lifetimeeternal");
}
@Override
public void Execute(Player caller, String[] args)
{
resetCommandCharge(caller);
Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales rank " + args[0] + " ETERNAL"));
resetCommandCharge(caller);
Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales item " + args[0] + " 2 Item Mythical Chest"));
resetCommandCharge(caller);
Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales item " + args[0] + " 2 Item Illuminated Chest"));
resetCommandCharge(caller);
Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales item " + args[0] + " 1 Item Omega Chest"));
}
}

View File

@ -1,26 +0,0 @@
package mineplex.staffServer.salespackage.command;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import mineplex.core.command.CommandBase;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class LifetimeHeroCommand extends CommandBase<SalesPackageManager>
{
public LifetimeHeroCommand(SalesPackageManager plugin)
{
super(plugin, SalesPackageManager.Perm.SALES_COMMAND, "lifetimehero");
}
@Override
public void Execute(Player caller, String[] args)
{
resetCommandCharge(caller);
Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales rank " + args[0] + " HERO"));
resetCommandCharge(caller);
Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales item " + args[0] + " 2 Item Mythical Chest"));
}
}

View File

@ -1,26 +0,0 @@
package mineplex.staffServer.salespackage.command;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import mineplex.core.command.CommandBase;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class LifetimeLegendCommand extends CommandBase<SalesPackageManager>
{
public LifetimeLegendCommand(SalesPackageManager plugin)
{
super(plugin, SalesPackageManager.Perm.SALES_COMMAND, "lifetimelegend");
}
@Override
public void Execute(Player caller, String[] args)
{
resetCommandCharge(caller);
Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales rank " + args[0] + " LEGEND"));
resetCommandCharge(caller);
Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales item " + args[0] + " 3 Item Mythical Chest"));
}
}

View File

@ -1,26 +0,0 @@
package mineplex.staffServer.salespackage.command;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import mineplex.core.command.CommandBase;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class LifetimeTitanCommand extends CommandBase<SalesPackageManager>
{
public LifetimeTitanCommand(SalesPackageManager plugin)
{
super(plugin, SalesPackageManager.Perm.SALES_COMMAND, "lifetimetitan");
}
@Override
public void Execute(Player caller, String[] args)
{
resetCommandCharge(caller);
Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales rank " + args[0] + " TITAN"));
resetCommandCharge(caller);
Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales item " + args[0] + " 5 Item Mythical Chest"));
}
}

View File

@ -1,26 +0,0 @@
package mineplex.staffServer.salespackage.command;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import mineplex.core.command.CommandBase;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class LifetimeUltraCommand extends CommandBase<SalesPackageManager>
{
public LifetimeUltraCommand(SalesPackageManager plugin)
{
super(plugin, SalesPackageManager.Perm.SALES_COMMAND, "lifetimeultra");
}
@Override
public void Execute(Player caller, String[] args)
{
resetCommandCharge(caller);
Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales rank " + args[0] + " ULTRA"));
resetCommandCharge(caller);
Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales item " + args[0] + " 1 Item Mythical Chest"));
}
}

View File

@ -1,99 +0,0 @@
package mineplex.staffServer.salespackage.command;
import java.util.UUID;
import org.bukkit.entity.Player;
import com.google.gson.Gson;
import mineplex.core.command.CommandBase;
import mineplex.core.common.util.Callback;
import mineplex.core.common.util.F;
import mineplex.core.pet.PetClient;
import mineplex.core.pet.PetType;
import mineplex.core.pet.repository.token.ClientPetTokenWrapper;
import mineplex.core.pet.repository.token.PetChangeToken;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class PetCommand extends CommandBase<SalesPackageManager>
{
public PetCommand(SalesPackageManager plugin)
{
super(plugin, SalesPackageManager.Perm.SALES_COMMAND, "pet");
}
@Override
public void Execute(final Player caller, String[] args)
{
if (args.length < 2)
return;
final String playerName = args[0];
int petId = Integer.parseInt(args[1]);
if (petId < 0 || petId >= PetType.values().length)
{
caller.sendMessage(F.main(Plugin.getName(), "You have entered an invalid Pet Type."));
return;
}
final PetType petType = PetType.values()[petId];
Plugin.getClientManager().loadClientByName(playerName, client ->
{
final UUID uuid = Plugin.getClientManager().loadUUIDFromDB(playerName);
if (uuid != null)
{
final Callback<PetClient> clientCallback = new Callback<PetClient>()
{
public void run(PetClient petClient)
{
if (petClient.getPets().containsKey(petType))
{
caller.sendMessage(F.main(Plugin.getName(), F.elem(playerName) + " already has that Pet!"));
}
else
{
PetChangeToken token = new PetChangeToken();
token.AccountId = client.getAccountId();
token.Name = playerName;
token.PetType = petType.toString();
token.PetName = petType.getName();
Plugin.getPetRepo().AddPet(token);
Plugin.getInventoryManager().addItemToInventoryForOffline(success ->
{
if (success)
{
caller.sendMessage(F.main(Plugin.getName(), F.elem(playerName) + " has been given their Pet!"));
}
else
{
caller.sendMessage(F.main(Plugin.getName(), "Attempt to give Pet has failed!"));
}
}, client.getAccountId(), petType.toString(), 1);
}
}
};
Plugin.runAsync(() ->
{
Gson gson = new Gson();
ClientPetTokenWrapper token = null;
String response = Plugin.getClientManager().getRepository().getClientByUUID(uuid);
token = gson.fromJson(response, ClientPetTokenWrapper.class);
PetClient petClient = new PetClient();
petClient.load(token.DonorToken);
clientCallback.run(petClient);
});
}
else
{
caller.sendMessage(F.main(Plugin.getName(), "Couldn't find " + playerName + "'s account!"));
}
});
}
}

View File

@ -1,46 +0,0 @@
package mineplex.staffServer.salespackage.command;
import java.time.LocalDate;
import org.bukkit.entity.Player;
import mineplex.core.command.CommandBase;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class PowerPlayCommand extends CommandBase<SalesPackageManager>
{
public PowerPlayCommand(SalesPackageManager plugin)
{
super(plugin, SalesPackageManager.Perm.SALES_COMMAND, "powerplay");
}
@Override
public void Execute(final Player caller, String[] args)
{
if (args == null || args.length < 2)
return;
final String playerName = args[0];
final String duration = args[1];
if (!duration.equalsIgnoreCase("month") && !duration.equalsIgnoreCase("year"))
{
return;
}
Plugin.getClientManager().loadClientByName(playerName, client ->
{
if (client != null)
{
Plugin.getPowerPlay().addSubscription(client.getAccountId(), LocalDate.now(), duration.toLowerCase());
UtilPlayer.message(caller, F.main(Plugin.getName(), "Given a Power Play Club 1 " + duration + " subscription to " + playerName + "!"));
}
else
{
caller.sendMessage(F.main(Plugin.getName(), "Couldn't find " + playerName + "'s account!"));
}
});
}
}

View File

@ -1,60 +0,0 @@
package mineplex.staffServer.salespackage.command;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import org.bukkit.entity.Player;
import mineplex.core.account.permissions.PermissionGroup;
import mineplex.core.command.CommandBase;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class RankCommand extends CommandBase<SalesPackageManager>
{
private static final List<String> ACCEPTED_RANKS = Collections.unmodifiableList(Arrays.asList("PLAYER", "ULTRA", "HERO", "LEGEND", "TITAN", "ETERNAL"));
public RankCommand(SalesPackageManager plugin)
{
super(plugin, SalesPackageManager.Perm.SALES_COMMAND, "rank");
}
@Override
public void Execute(Player caller, String[] args)
{
if (args == null || args.length != 2)
{
return;
}
String playerName = args[0];
String rank = args[1].toUpperCase();
if (ACCEPTED_RANKS.contains(rank))
{
PermissionGroup group = PermissionGroup.valueOf(rank);
Plugin.runAsync(() ->
{
UUID uuid = Plugin.getClientManager().loadUUIDFromDB(playerName);
Plugin.getClientManager().loadAccountIdFromUUID(uuid, id ->
{
Plugin.runSync(() ->
{
if (id == -1)
{
UtilPlayer.message(caller, F.main(Plugin.getName(), "Could not find " + F.elem(playerName) + "!"));
}
else
{
Plugin.getClientManager().setPrimaryGroup(id, group, () -> UtilPlayer.message(caller, F.main(Plugin.getName(), F.elem(playerName) + "'s rank has been updated to " + rank + "!")));
}
});
});
});
}
}
}

View File

@ -1,32 +0,0 @@
package mineplex.staffServer.salespackage.command;
import org.bukkit.entity.Player;
import mineplex.core.command.MultiCommandBase;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class Sales extends MultiCommandBase<SalesPackageManager>
{
public Sales(SalesPackageManager plugin)
{
super(plugin, SalesPackageManager.Perm.SALES_COMMAND, "sales");
AddCommand(new RankCommand(plugin));
AddCommand(new CoinCommand(plugin));
AddCommand(new ItemCommand(plugin));
AddCommand(new GemHunterCommand(plugin));
AddCommand(new UltraCommand(plugin));
AddCommand(new HeroCommand(plugin));
AddCommand(new LifetimeUltraCommand(plugin));
AddCommand(new LifetimeHeroCommand(plugin));
AddCommand(new LifetimeLegendCommand(plugin));
AddCommand(new LifetimeTitanCommand(plugin));
AddCommand(new LifetimeEternalCommand(plugin));
AddCommand(new KitsCommand(plugin));
AddCommand(new PowerPlayCommand(plugin));
AddCommand(new PetCommand(plugin));
}
@Override
protected void Help(Player caller, String[] args) {}
}

View File

@ -1,29 +0,0 @@
package mineplex.staffServer.salespackage.command;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import mineplex.core.command.CommandBase;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class UltraCommand extends CommandBase<SalesPackageManager>
{
public UltraCommand(SalesPackageManager plugin)
{
super(plugin, SalesPackageManager.Perm.SALES_COMMAND, "ultra");
}
@Override
public void Execute(Player caller, String[] args)
{
resetCommandCharge(caller);
Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales rank " + args[0] + " ULTRA false"));
resetCommandCharge(caller);
Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales coin " + args[0] + " 7500"));
resetCommandCharge(caller);
Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales booster " + args[0] + " 30"));
}
}

View File

@ -1,20 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class AncientChest extends SalesPackageBase
{
public AncientChest(SalesPackageManager manager)
{
super(manager, "1 Ancient Chest");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Item Ancient Chest", "Give 1 Ancient Chest.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,20 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class ApplyKits extends SalesPackageBase
{
public ApplyKits(SalesPackageManager manager)
{
super(manager, "Apply Kits");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales kits " + playerName, "Apply Kit Unlocks.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,20 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class ClanBannerEditor extends SalesPackageBase
{
public ClanBannerEditor(SalesPackageManager manager)
{
super(manager, "Clan Banner Editor Access");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Unlock Clan Banner Editor", "Give Clan Banner Editor access.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,20 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class ClanBannerUsage extends SalesPackageBase
{
public ClanBannerUsage(SalesPackageManager manager)
{
super(manager, "Clan Banner Usage Access");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Unlock Clan Banner Usage", "Give Clan Banner Usage access.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,22 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class ClansBossToken extends SalesPackageBase
{
private final String _boss;
public ClansBossToken(SalesPackageManager manager, String boss)
{
super(manager, "1 Clans Boss Token " + boss);
_boss = boss;
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Item Clans Boss Token " + _boss, "Give 1 Clans Boss Token " + _boss + ".");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,22 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class ClansBox extends SalesPackageBase
{
private String _boxType;
public ClansBox(SalesPackageManager manager, String boxType)
{
super(manager, "1 Clans " + boxType + " Box");
_boxType = boxType;
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Item Clans " + _boxType + " Box", "Give 1 Clans " + _boxType + " Box.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,22 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class ClansSupplyDrop extends SalesPackageBase
{
private final boolean _gilded;
public ClansSupplyDrop(SalesPackageManager manager, boolean gilded)
{
super(manager, "1 Clans " + (gilded ? "Gilded " : "") + "Supply Drop");
_gilded = gilded;
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Item Clans " + (_gilded ? "Gilded " : "") + "Supply Drop", "Give 1 Clans " + (_gilded ? "Gilded " : "") + "Supply Drop.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,23 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class Coins extends SalesPackageBase
{
private int _amount;
public Coins(SalesPackageManager manager, int amount)
{
super(manager, amount + " Shards");
_amount = amount;
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales coin " + playerName + " " + _amount, _amount + " Shards.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,20 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class DefaultRank extends SalesPackageBase
{
public DefaultRank(SalesPackageManager manager)
{
super(manager, "Default Rank");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales rank " + playerName + " PLAYER", " Default Rank.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,20 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class EasterBunny extends SalesPackageBase
{
public EasterBunny(SalesPackageManager manager)
{
super(manager, "Easter Bunny Morph");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Morph Easter Bunny Morph", "Give Easter Bunny Morph.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,21 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class FreedomChest extends SalesPackageBase
{
public FreedomChest(SalesPackageManager manager)
{
super(manager, "1 Freedom Treasure");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Item Freedom Treasure", "Give 1 Freedom Chest.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,20 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class FrostLord extends SalesPackageBase
{
public FrostLord(SalesPackageManager manager)
{
super(manager, "Frost Lord");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Particle Frost Lord", "Give Frost Lord Particle.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,23 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class GemHunter extends SalesPackageBase
{
private int _level;
public GemHunter(SalesPackageManager manager, int level)
{
super(manager, "Level " + level + " Gem Hunter");
_level = level;
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales gemhunter " + playerName + " " + _level, "Level " + _level + " Gem Hunter.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,22 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import org.bukkit.entity.Player;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class GingerbreadChest extends SalesPackageBase
{
public GingerbreadChest(SalesPackageManager manager)
{
super(manager, "1 Gingerbread Chest");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Item Gingerbread Chest", "Give 1 Gingerbread Chest.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,21 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import org.bukkit.entity.Player;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class HOGChest extends SalesPackageBase
{
public HOGChest(SalesPackageManager manager)
{
super(manager, "1 HOG Chest");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Item HOG Chest", "Give 1 HOG Chest.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,19 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class HauntedChest extends SalesPackageBase
{
public HauntedChest(SalesPackageManager manager)
{
super(manager, "1 Haunted Chest");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Item Haunted Chest", "Give 1 Haunted Chest.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,21 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class IlluminatedChest extends SalesPackageBase
{
public IlluminatedChest(SalesPackageManager manager)
{
super(manager, "1 Illuminated Chest");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Item Illuminated Chest", "Give 1 Illuminated Chest.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,24 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class LifetimeEternal extends SalesPackageBase
{
public LifetimeEternal(SalesPackageManager manager)
{
super(manager, "Lifetime Eternal");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales rank " + playerName + " ETERNAL", "Lifetime Eternal.");
addButton(agent, "/sales item " + playerName + " 2 Item Mythical Chest", "2 Mythical Chests.");
addButton(agent, "/sales item " + playerName + " 2 Item Illuminated Chest", "2 Illuminated Chests.");
addButton(agent, "/sales item " + playerName + " 1 Item Omega Chest", "1 Omega Chest.");
addButton(agent, "Apply All", "/sales lifetimeeternal " + playerName, "Apply all above.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,22 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class LifetimeHero extends SalesPackageBase
{
public LifetimeHero(SalesPackageManager manager)
{
super(manager, "Lifetime Hero");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales rank " + playerName + " HERO", "Lifetime Hero.");
addButton(agent, "/sales item " + playerName + " 2 Item Mythical Chest", "2 Mythical Chests.");
addButton(agent, "Apply All", "/sales lifetimehero " + playerName, "Apply all above.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,25 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class LifetimeLegend extends SalesPackageBase
{
public LifetimeLegend(SalesPackageManager manager)
{
super(manager, "Lifetime Legend");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales rank " + playerName + " LEGEND", "Lifetime Legend.");
addButton(agent, "/sales item " + playerName + " 3 Item Mythical Chest", "3 Mythical Chests.");
//addButton(agent, "/sales item " + playerName + " 1 Morph Wither Morph", "Gives Wither Morph.");
//addButton(agent, "/sales item " + playerName + " 1 Pet Widder", "Gives Wither Pet.");
//addButton(agent, "/sales item " + playerName + " 1 Particle Legendary Aura", "Gives Legendary Aura Particle.");
addButton(agent, "Apply All", "/sales lifetimelegend " + playerName, "Apply all above.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,25 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class LifetimeTitan extends SalesPackageBase
{
public LifetimeTitan(SalesPackageManager manager)
{
super(manager, "Lifetime Titan");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales rank " + playerName + " TITAN", "Lifetime Titan.");
addButton(agent, "/sales item " + playerName + " 5 Item Mythical Chest", "5 Mythical Chests.");
// addButton(agent, "/sales item " + playerName + " 1 Molten Snake", "Gives Molten Snake Mount.");
// addButton(agent, "/sales item " + playerName + " 1 Elder Guardian Morph", "Gives Elder Guardian Morph.");
// addButton(agent, "/sales item " + playerName + " 1 Flame of the Titans", "Gives Titan Particle.");
addButton(agent, "Apply All", "/sales lifetimetitan " + playerName, "Apply all above.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,22 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class LifetimeUltra extends SalesPackageBase
{
public LifetimeUltra(SalesPackageManager manager)
{
super(manager, "Lifetime Ultra");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales rank " + playerName + " ULTRA", "Lifetime Ultra.");
addButton(agent, "/sales item " + playerName + " 1 Item Mythical Chest", "1 Mythical Chest.");
addButton(agent, "Apply All", "/sales lifetimeultra " + playerName, "Apply all above.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,20 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import org.bukkit.entity.Player;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class LoveChest extends SalesPackageBase
{
public LoveChest(SalesPackageManager manager)
{
super(manager, "1 Love Chest");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Item Love Chest", "Give 1 Love Chest.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,20 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import org.bukkit.entity.Player;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class MinestrikeChest extends SalesPackageBase
{
public MinestrikeChest(SalesPackageManager manager)
{
super(manager, "1 Minestrike Chest");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Item Minestrike Chest", "Give 1 Minestrike Chest.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,23 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class MonthlyHero extends SalesPackageBase
{
public MonthlyHero(SalesPackageManager manager)
{
super(manager, "Monthly Hero");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales coin " + playerName + " 15000", " 15,000 Coins");
addButton(agent, "/sales booster " + playerName + " 90", " 90 Gem Boosters");
addButton(agent, "/sales rank " + playerName + " HERO false", " Monthly Hero.");
addButton(agent, "Apply All", "/sales hero " + playerName, " Apply all above.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,23 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class MonthlyUltra extends SalesPackageBase
{
public MonthlyUltra(SalesPackageManager manager)
{
super(manager, "Monthly Ultra");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales coin " + playerName + " 7500", " 7,500 Coins");
addButton(agent, "/sales booster " + playerName + " 30", " 30 Gem Boosters");
addButton(agent, "/sales rank " + playerName + " ULTRA false", " Monthly Ultra.");
addButton(agent, "Apply All", "/sales ultra " + playerName, " Apply all above.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,20 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class MythicalChest extends SalesPackageBase
{
public MythicalChest(SalesPackageManager manager)
{
super(manager, "1 Mythical Chest");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Item Mythical Chest", "Give 1 Mythical Chest.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,20 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class OldChest extends SalesPackageBase
{
public OldChest(SalesPackageManager manager)
{
super(manager, "1 Old Chest");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Item Old Chest", "Give 1 Old Chest.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,20 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class OmegaChest extends SalesPackageBase
{
public OmegaChest(SalesPackageManager manager)
{
super(manager, "1 Omega Chest");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Item Omega Chest", "Give 1 Omega Chest.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,26 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import org.bukkit.entity.Player;
import mineplex.core.pet.PetType;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class Pet extends SalesPackageBase
{
private String _petName;
private PetType _petType;
public Pet(SalesPackageManager manager, String petName, PetType petType)
{
super(manager, "1 " + petName + " Pet");
_petName = petName;
_petType = petType;
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales pet " + playerName + " " + _petType.ordinal(), "Give 1 " + _petName + " Pet.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,22 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class PowerPlayClub extends SalesPackageBase
{
private boolean _year;
public PowerPlayClub(SalesPackageManager manager, boolean year)
{
super(manager, "1 " + (year ? "Year" : "Month") + " Power Play Club Membership");
_year = year;
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales powerplay " + playerName + " " + (_year ? "year" : "month"), "Give 1 " + (_year ? "Year" : "Month") + " Power Play Club Membership.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,25 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import org.bukkit.entity.Player;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class RainbowBundle extends SalesPackageBase
{
public RainbowBundle(SalesPackageManager manager)
{
super(manager, "Rainbow Bundle");
}
@Override
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 ArrowTrail Rainbow Arrows", "Give Rainbow Arrows.");
addButton(agent, "/sales item " + playerName + " 1 DeathEffect Rainbow Death", "Give Rainbow Death.");
addButton(agent, "/sales item " + playerName + " 1 DoubleJump Rainbow Leap", "Give Rainbow Leap.");
addButton(agent, "/sales item " + playerName + " 1 Particle Rainbow Aura", "Give Rainbow Aura.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,22 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class RuneAmplifier extends SalesPackageBase
{
private int _minutes;
public RuneAmplifier(SalesPackageManager manager, int minutes)
{
super(manager, "1 " + minutes + " minutes Rune Amplifier");
_minutes = minutes;
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Item Rune Amplifier " + _minutes, "Give 1 " + _minutes + " minute Rune Amplifier.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,43 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.core.common.jsonchat.JsonMessage;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public abstract class SalesPackageBase
{
private String _name;
protected SalesPackageManager Manager;
protected SalesPackageBase(SalesPackageManager manager, String name)
{
Manager = manager;
_name = name;
}
public abstract void displayToAgent(Player agent, String playerName);
public String getName()
{
return _name;
}
protected void addButton(Player agent, String command, String itemText)
{
addButton(agent, "Apply", command, itemText);
}
protected void addButton(Player agent, String buttonText, String command, String itemText)
{
new JsonMessage("[").color("blue").extra(buttonText).color("green").click("run_command", command)
.add("] ").color("blue").add(itemText).color("yellow").sendToPlayer(agent);
}
protected void addBackButton(Player agent, String playerName)
{
new JsonMessage("[").color("blue").extra("Back").color("green").click("run_command", "/display " + playerName + " ALL")
.add("] ").color("blue").sendToPlayer(agent);
}
}

View File

@ -1,21 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import org.bukkit.entity.Player;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class SpringChest extends SalesPackageBase
{
public SpringChest(SalesPackageManager manager)
{
super(manager, "1 Spring Chest");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Item Spring Chest", "Give 1 Spring Chest.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,20 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import org.bukkit.entity.Player;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class StPatricksChest extends SalesPackageBase
{
public StPatricksChest(SalesPackageManager manager)
{
super(manager, "1 St Patricks Chest");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Item St Patricks Chest", "Give 1 St Patricks Chest.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,19 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class ThankfulChest extends SalesPackageBase
{
public ThankfulChest(SalesPackageManager manager)
{
super(manager, "1 Thankful Chest");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Item Thankful Chest", "Give 1 Thankful Chest.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,19 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class TrickOrTreatChest extends SalesPackageBase
{
public TrickOrTreatChest(SalesPackageManager manager)
{
super(manager, "1 Trick or Treat Chest");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Item Trick or Treat Chest", "Give 1 Trick or Treat Chest.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,20 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import org.bukkit.entity.Player;
import mineplex.staffServer.salespackage.SalesPackageManager;
public class TrickOrTreatChest2017 extends SalesPackageBase
{
public TrickOrTreatChest2017(SalesPackageManager manager)
{
super(manager, "1 Trick or Treat Chest 2017");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Item Trick or Treat Chest 2017", "Give 1 Trick or Treat Chest 2017.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -1,20 +0,0 @@
package mineplex.staffServer.salespackage.salespackages;
import mineplex.staffServer.salespackage.SalesPackageManager;
import org.bukkit.entity.Player;
public class ValentinesGift extends SalesPackageBase
{
public ValentinesGift(SalesPackageManager manager)
{
super(manager, "1 Valentines Gift");
}
public void displayToAgent(Player agent, String playerName)
{
addButton(agent, "/sales item " + playerName + " 1 Item Valentines Gift", "Give 1 Valentines Gift.");
agent.sendMessage(" ");
addBackButton(agent, playerName);
}
}

View File

@ -15,7 +15,7 @@ import mineplex.staffServer.customerSupport.CustomerSupport;
import mineplex.staffServer.ui.chest.SupportChestPage;
import mineplex.staffServer.ui.currency.SupportCurrencyPage;
import mineplex.staffServer.ui.packages.SupportClansPackagePage;
import mineplex.staffServer.ui.packages.SupportOneTimePackagePage;
import mineplex.staffServer.ui.packages.SupportMiscPackagePage;
import mineplex.staffServer.ui.pet.SupportPetPage;
import mineplex.staffServer.ui.ppc.SupportPowerplayPage;
import mineplex.staffServer.ui.rank.SupportRankBonusPage;
@ -100,37 +100,37 @@ public class SupportHomePage extends SupportPage
C.mBody + "club info for " + C.cYellow + _target.getName()
}, 1, false, true), SupportPowerplayPage.class, () -> getShop().getPowerPlayData().get(_target.getAccountId()) != null);
buildPageButton(getSlotIndex(2, 2), new ShopItem(Material.ENCHANTED_BOOK, "Rank Bonus", new String[] {
buildPageButton(getSlotIndex(3, 2), new ShopItem(Material.ENCHANTED_BOOK, "Rank Bonus", new String[] {
C.mBody + "Click to view rank",
C.mBody + "bonus log for " + C.cYellow + _target.getName()
}, 1, false, true), SupportRankBonusPage.class, () -> getShop().getBonusLog().get(_target.getAccountId()) != null);
buildPageButton(getSlotIndex(2, 4), new ShopItem(Material.BOOK_AND_QUILL, "Rank Utilities", new String[] {
buildPageButton(getSlotIndex(3, 4), new ShopItem(Material.BOOK_AND_QUILL, "Rank Utilities", new String[] {
C.mBody + "Click to apply ranks",
C.mBody + "and monthly bonus",
C.mBody +"items to " + C.cYellow + _target.getName()
}, 1, false, true), SupportRankListPage.class);
buildPageButton(getSlotIndex(2, 6), new ShopItem(Material.BONE, "Pets", new String[] {
buildPageButton(getSlotIndex(3, 6), new ShopItem(Material.BONE, "Pets", new String[] {
C.mBody + "Click to give pets",
C.mBody + "to " + C.cYellow + _target.getName()
}, 1, false, true), SupportPetPage.class);
buildPageButton(getSlotIndex(3, 2), new ShopItem(Material.HAY_BLOCK, "One-Time Packages", new String[] {
C.mBody + "Click to give one",
C.mBody + "time packages, such",
C.mBody + "as Frost Lord and",
buildPageButton(getSlotIndex(5, 2), new ShopItem(Material.HAY_BLOCK, "Misc Packages", new String[] {
C.mBody + "Click to give misc",
C.mBody + "packages, such as",
C.mBody + "Frost Lord and",
C.mBody + "rainbow bundle."
}, 1, false, true), SupportOneTimePackagePage.class);
}, 1, false, true), SupportMiscPackagePage.class);
buildPageButton(getSlotIndex(3, 4), new ShopItem(Material.IRON_SWORD, "Clans Packages", new String[] {
buildPageButton(getSlotIndex(5, 4), new ShopItem(Material.IRON_SWORD, "Clans Packages", new String[] {
C.mBody + "Click to give clans",
C.mBody + "packages, such as",
C.mBody + "Boss Tokens and",
C.mBody + "Supply Drops."
}, 1, false, true), SupportClansPackagePage.class);
addButton(getSlotIndex(3, 6),
addButton(getSlotIndex(5, 6),
new ItemBuilder(Material.WOOD_DOOR)
.setTitle(C.cGreenB + "Apply Kits")
.addLore(C.mBody + "Click to apply all")

View File

@ -5,6 +5,7 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.stream.Collectors;
@ -13,14 +14,12 @@ import org.bukkit.Sound;
import org.bukkit.entity.Player;
import mineplex.core.account.CoreClient;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.currency.GlobalCurrency;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilSkull;
import mineplex.core.common.util.UtilText;
import mineplex.core.donation.DonationManager;
import mineplex.core.donation.Donor;
import mineplex.core.donation.repository.token.TransactionToken;
import mineplex.core.server.util.TransactionResponse;
@ -139,6 +138,7 @@ public class SupportPage extends ShopPageBase<CustomerSupport, SupportShop>
protected void goBack()
{
_previousPage.refresh();
getShop().openPageForPlayer(getPlayer(), _previousPage);
}
@ -167,13 +167,14 @@ public class SupportPage extends ShopPageBase<CustomerSupport, SupportShop>
message("Unable to give " + C.cYellow + amount + " " + itemName + C.mBody + " to " + C.cYellow + _target.getName() + C.mBody + ", please try again later.");
}
protected void giveUnknownSalesPackage(int amount, String itemName, boolean isItem)
protected void giveUnknownSalesPackage(int amount, String itemName, boolean isItem, Consumer<Boolean>callback)
{
getPlugin().getDonationManager().purchaseUnknownSalesPackage(_target, (amount == 1 ? itemName : itemName + " " + amount), GlobalCurrency.GEM, 0, false, response ->
{
if (response == TransactionResponse.Failed || response == TransactionResponse.InsufficientFunds)
{
giveFailed(amount, itemName);
callback.accept(true);
}
else if (response == TransactionResponse.Success)
{
@ -184,28 +185,37 @@ public class SupportPage extends ShopPageBase<CustomerSupport, SupportShop>
if (success)
{
giveSuccess(amount, itemName);
callback.accept(true);
}
else
{
giveFailed(amount, itemName);
callback.accept(false);
}
}, _target.getAccountId(), itemName, amount);
}
else
{
giveSuccess(amount, itemName);
callback.accept(true);
}
}
else if (response == TransactionResponse.AlreadyOwns)
{
message(C.cYellow + _target.getName() + C.mBody + " already owns " + C.cYellow + itemName);
callback.accept(true);
}
});
}
protected void giveUnknownSalesPackage(String itemName, boolean isItem, Consumer<Boolean> callback)
{
giveUnknownSalesPackage(1, itemName, isItem, callback);
}
protected void giveUnknownSalesPackage(String itemName, boolean isItem)
{
giveUnknownSalesPackage(1, itemName, isItem);
giveUnknownSalesPackage(itemName, isItem, success -> {});
}
protected void giveUnknownSalesPackage(String itemName)

View File

@ -1,7 +1,6 @@
package mineplex.staffServer.ui.chest;
import java.util.Arrays;
import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
@ -13,7 +12,6 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import mineplex.core.account.CoreClient;
import mineplex.core.common.Pair;
import mineplex.core.common.util.C;
import mineplex.core.shop.page.MultiPageManager;
import mineplex.core.treasure.types.TreasureType;

View File

@ -1,24 +1,16 @@
package mineplex.staffServer.ui.packages;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.bukkit.DyeColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import mineplex.core.account.CoreClient;
import mineplex.core.common.util.C;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.staffServer.customerSupport.CustomerSupport;
import mineplex.staffServer.ui.SupportPage;
import mineplex.staffServer.ui.SupportShop;
import mineplex.staffServer.ui.packages.SupportPackagePage;
public class SupportClansPackagePage extends SupportPackagePage
{

View File

@ -8,7 +8,6 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import org.bukkit.Material;
import org.bukkit.entity.Player;

View File

@ -6,15 +6,11 @@ import java.util.List;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.account.CoreClient;
import mineplex.core.common.Pair;
import mineplex.core.common.util.C;
import mineplex.core.shop.item.ShopItem;
import mineplex.core.shop.page.MultiPageManager;
import mineplex.core.treasure.types.TreasureType;
import mineplex.database.tables.BonusLog;
import mineplex.staffServer.customerSupport.CustomerSupport;
import mineplex.staffServer.repository.BonusEntry;
import mineplex.staffServer.ui.SupportPage;

View File

@ -2,14 +2,12 @@ package mineplex.staffServer.ui.rank;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;