Added love chest to customer support server

This commit is contained in:
LCastr0 2017-01-18 21:02:57 -02:00
parent ed8363e1be
commit 1557f3a39c
3 changed files with 35 additions and 1 deletions

View File

@ -163,6 +163,7 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
int thankfulChestsReceived = 0;
int gingerbreadChestsReceived = 0;
int minestrikeChestsReceived = 0;
int loveChestsReceived = 0;
for (CoinTransactionToken transaction : donor.getCoinTransactions())
{
@ -306,6 +307,16 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
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("Valentines Gift"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
@ -379,6 +390,7 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
caller.sendMessage(C.cBlue + "Thankful Chests Received: " + C.cYellow + thankfulChestsReceived);
caller.sendMessage(C.cBlue + "Gingerbread Chests Received: " + C.cYellow + gingerbreadChestsReceived);
caller.sendMessage(C.cBlue + "Minestrike Chests Received: " + C.cYellow + minestrikeChestsReceived);
caller.sendMessage(C.cBlue + "Love Chests Received: " + C.cYellow + loveChestsReceived);
caller.sendMessage(C.cBlue + "Game Amplifiers Received: " + C.cYellow + boostersReceived);
caller.sendMessage(C.cBlue + "Rune Amplifiers (20 min) Received: " + C.cYellow + runeAmplifier20);
caller.sendMessage(C.cBlue + "Rune Amplifiers (60 min) Received: " + C.cYellow + runeAmplifier60);

View File

@ -30,6 +30,7 @@ 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;
@ -98,6 +99,7 @@ public class SalesPackageManager extends MiniPlugin
AddSalesPackage(new OmegaChest(this));
AddSalesPackage(new HauntedChest(this));
AddSalesPackage(new MinestrikeChest(this));
AddSalesPackage(new LoveChest(this));
AddSalesPackage(new TrickOrTreatChest(this));
AddSalesPackage(new ThankfulChest(this));
@ -169,7 +171,7 @@ public class SalesPackageManager extends MiniPlugin
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 ThankfulChest || salesPackage instanceof GingerbreadChest || salesPackage instanceof MinestrikeChest || salesPackage instanceof LoveChest)
{
chestBuilder = chestBuilder.extra("[").color("gray").extra(salesPackage.getName()).color("green").click("run_command", "/display " + playerName + " " + salesPackage.getName()).extra("] ").color("gray");
}

View File

@ -0,0 +1,20 @@
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);
}
}