Added spring chest to cust server

This commit is contained in:
LCastr0 2017-03-24 14:20:10 -03:00
parent 5464a74d2c
commit 8a7f221bc6
3 changed files with 36 additions and 1 deletions

View File

@ -167,6 +167,7 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
int minestrikeChestsReceived = 0;
int loveChestsReceived = 0;
int stPatricksChestReceived = 0;
int springChestsReceived = 0;
for (CoinTransactionToken transaction : donor.getCoinTransactions())
{
@ -330,6 +331,16 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
stPatricksChestReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Spring Chest"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)
{
if (transaction.SalesPackageName.split(" ").length == 4)
springChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[3]);
else if (transaction.SalesPackageName.split(" ").length == 3)
springChestsReceived += 1;
}
}
if (transaction.SalesPackageName.startsWith("Valentines Gift"))
{
if (transaction.Coins == 0 && transaction.Gems == 0)

View File

@ -39,6 +39,7 @@ import mineplex.staffServer.salespackage.salespackages.Pet;
import mineplex.staffServer.salespackage.salespackages.PowerPlayClub;
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.TrickOrTreatChest;
@ -102,6 +103,7 @@ public class SalesPackageManager extends MiniPlugin
AddSalesPackage(new MinestrikeChest(this));
AddSalesPackage(new LoveChest(this));
AddSalesPackage(new StPatricksChest(this));
AddSalesPackage(new SpringChest(this));
AddSalesPackage(new TrickOrTreatChest(this));
AddSalesPackage(new ThankfulChest(this));
@ -173,7 +175,8 @@ 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 LoveChest || salesPackage instanceof StPatricksChest)
|| salesPackage instanceof ThankfulChest || salesPackage instanceof GingerbreadChest || salesPackage instanceof MinestrikeChest || salesPackage instanceof LoveChest || salesPackage instanceof StPatricksChest
|| salesPackage instanceof SpringChest)
{
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,21 @@
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);
}
}