From 5b80f3b6ac0feedb18567fdf480fc960c774c237 Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Sat, 3 Sep 2016 11:37:45 -0400 Subject: [PATCH 1/7] Fix clan banner being removed from support server information --- .../mineplex/staffServer/customerSupport/CustomerSupport.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java index b77c30e81..fb2c5b96f 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java @@ -283,7 +283,7 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable _salesPackageManager.displaySalesPackages(caller, playerName); caller.sendMessage(C.cDGreen + C.Strike + "============================================="); caller.sendMessage(C.cBlue + "Clan Banner Usage: " + getLockedFreedomStr(client.getUniqueId(), "Clan Banner Usage")); - caller.sendMessage(C.cDGreen + C.Strike + "============================================="); + caller.sendMessage(C.cBlue + "Clan Banner Editor: " + getLockedFreedomStr(client.getUniqueId(), "Clan Banner Editor")); caller.sendMessage(C.cDGreen + C.Strike + "============================================="); caller.sendMessage(C.cBlue + "Power play subscription (September): " + powerPlaySub); caller.sendMessage(C.cBlue + "Power play claim (September): " + powerPlayClaim); From b3478d70e8c09386c66fc614c2735e8784f26cb9 Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Sat, 3 Sep 2016 15:16:59 -0400 Subject: [PATCH 2/7] Update support packages --- .../src/mineplex/staffServer/StaffServer.java | 9 ++-- .../customerSupport/CustomerSupport.java | 24 +++++++--- .../salespackage/SalesPackageManager.java | 42 +++++++++++++++-- .../command/LifetimeHeroCommand.java | 2 +- .../command/LifetimeLegendCommand.java | 2 +- .../command/LifetimeTitanCommand.java | 27 +++++++++++ .../command/LifetimeUltraCommand.java | 2 +- .../command/PowerPlayCommand.java | 45 +++++++++++++++++++ .../salespackage/command/Sales.java | 1 + .../salespackages/LifetimeHero.java | 6 +-- .../salespackages/LifetimeLegend.java | 12 ++--- .../salespackages/LifetimeTitan.java | 4 +- .../salespackages/LifetimeUltra.java | 6 +-- .../salespackages/OmegaChest.java | 20 +++++++++ .../salespackages/PowerPlayClub.java | 22 +++++++++ 15 files changed, 196 insertions(+), 28 deletions(-) create mode 100644 Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeTitanCommand.java create mode 100644 Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/PowerPlayCommand.java create mode 100644 Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/OmegaChest.java create mode 100644 Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/PowerPlayClub.java diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/StaffServer.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/StaffServer.java index f2e88544f..6aa86f4aa 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/StaffServer.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/StaffServer.java @@ -16,6 +16,7 @@ import mineplex.core.monitor.LagMeter; import mineplex.core.npc.NpcManager; import mineplex.core.packethandler.PacketHandler; import mineplex.core.portal.Portal; +import mineplex.core.powerplayclub.PowerPlayClubRepository; import mineplex.core.preferences.PreferencesManager; import mineplex.core.profileCache.ProfileCacheManager; import mineplex.core.punish.Punish; @@ -64,14 +65,16 @@ public class StaffServer extends JavaPlugin Portal portal = new Portal(this, clientManager, serverStatusManager.getCurrentServerName()); EloManager eloManager = new EloManager(this, clientManager); - new Chat(this, null, clientManager, preferenceManager, new AchievementManager(new StatsManager(this, clientManager), clientManager, donationManager, null, eloManager), serverStatusManager.getCurrentServerName()); + StatsManager statsManager = new StatsManager(this, clientManager); + new Chat(this, null, clientManager, preferenceManager, new AchievementManager(statsManager, clientManager, donationManager, null, eloManager), serverStatusManager.getCurrentServerName()); new MemoryFix(this); new FileUpdater(this, portal, serverStatusManager.getCurrentServerName(), serverStatusManager.getRegion()); require(PacketHandler.class); require(DisguiseManager.class); - - new CustomerSupport(this, clientManager, donationManager, new SalesPackageManager(this, clientManager, donationManager, new InventoryManager(this, clientManager), new StatsManager(this, clientManager))); + + PowerPlayClubRepository powerPlayRepo = new PowerPlayClubRepository(this, clientManager); + new CustomerSupport(this, clientManager, donationManager, new SalesPackageManager(this, clientManager, donationManager, new InventoryManager(this, clientManager), statsManager, powerPlayRepo), powerPlayRepo); //new Password(this, serverStatusManager.getCurrentServerName()); //Updates diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java index fb2c5b96f..050304456 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java @@ -3,8 +3,10 @@ package mineplex.staffServer.customerSupport; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; +import java.util.Calendar; import java.util.HashSet; import java.util.List; +import java.util.Locale; import java.util.UUID; import mineplex.core.MiniPlugin; @@ -45,7 +47,7 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable private NautHashMap> _agentCacheMap = new NautHashMap>(); private NautHashMap> _accountBonusLog = new NautHashMap<>(); - public CustomerSupport(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, SalesPackageManager salesPackageManager) + public CustomerSupport(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, SalesPackageManager salesPackageManager, PowerPlayClubRepository powerPlayRepo) { super("Customer Support", plugin); @@ -53,7 +55,7 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable _donationManager = donationManager; _salesPackageManager = salesPackageManager; _repository = new CustomerSupportRepository(getPlugin()); - _powerPlayRepo = new PowerPlayClubRepository(plugin, clientManager); + _powerPlayRepo = powerPlayRepo; } @EventHandler @@ -138,6 +140,7 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable int freedomChestsReceived = 0; int runeAmplifier20 = 0; int runeAmplifier60 = 0; + int omegaChestsReceived = 0; for (CoinTransactionToken transaction : donor.getCoinTransactions()) { @@ -215,6 +218,17 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable 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("Valentines Gift")) { @@ -265,10 +279,10 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable caller.sendMessage(C.cBlue + "Ancient Chests Received: " + C.cYellow + ancientChestsReceived); caller.sendMessage(C.cBlue + "Mythical Chests Received: " + C.cYellow + mythicalChestsReceived); caller.sendMessage(C.cBlue + "Illuminated Chests Received: " + C.cYellow + illuminatedChestsReceived); + caller.sendMessage(C.cBlue + "Omega Chests Received: " + C.cYellow + omegaChestsReceived); 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); - caller.sendMessage(C.cBlue + "Freedom Chests Received: " + C.cYellow + freedomChestsReceived); caller.sendMessage(C.cBlue + "Monthly Bonus Log (Last 6 entries):"); if (_accountBonusLog.containsKey(client.getAccountId())) @@ -285,8 +299,8 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable caller.sendMessage(C.cBlue + "Clan Banner Usage: " + getLockedFreedomStr(client.getUniqueId(), "Clan Banner Usage")); caller.sendMessage(C.cBlue + "Clan Banner Editor: " + getLockedFreedomStr(client.getUniqueId(), "Clan Banner Editor")); caller.sendMessage(C.cDGreen + C.Strike + "============================================="); - caller.sendMessage(C.cBlue + "Power play subscription (September): " + powerPlaySub); - caller.sendMessage(C.cBlue + "Power play claim (September): " + powerPlayClaim); + caller.sendMessage(C.cBlue + "Power Play Subscription (" + Calendar.getInstance().getDisplayName(Calendar.MONTH, Calendar.LONG, Locale.getDefault()) + "): " + (powerPlaySub ? C.cGreen + "Active" : C.cRed + "Inactive")); + caller.sendMessage(C.cBlue + "Power Play Monthly Reward (" + Calendar.getInstance().getDisplayName(Calendar.MONTH, Calendar.LONG, Locale.getDefault()) + "): " + (powerPlayClaim ? C.cGreen + "Claimed" : C.cRed + "Unclaimed")); _accountBonusLog.remove(client.getAccountId()); } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/SalesPackageManager.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/SalesPackageManager.java index e93d43c34..0a2e61f8d 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/SalesPackageManager.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/SalesPackageManager.java @@ -1,6 +1,5 @@ package mineplex.staffServer.salespackage; -import mineplex.staffServer.salespackage.salespackages.*; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; @@ -10,9 +9,28 @@ 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.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.Coins; +import mineplex.staffServer.salespackage.salespackages.DefaultRank; +import mineplex.staffServer.salespackage.salespackages.FreedomChest; +import mineplex.staffServer.salespackage.salespackages.IlluminatedChest; +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.MythicalChest; +import mineplex.staffServer.salespackage.salespackages.OldChest; +import mineplex.staffServer.salespackage.salespackages.OmegaChest; +import mineplex.staffServer.salespackage.salespackages.PowerPlayClub; +import mineplex.staffServer.salespackage.salespackages.RuneAmplifier; +import mineplex.staffServer.salespackage.salespackages.SalesPackageBase; public class SalesPackageManager extends MiniPlugin { @@ -20,10 +38,11 @@ public class SalesPackageManager extends MiniPlugin private DonationManager _donationManager; private InventoryManager _inventoryManager; private StatsManager _statsManager; + private PowerPlayClubRepository _powerPlayRepo; private NautHashMap _salesPackages = new NautHashMap(); - public SalesPackageManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager, StatsManager statsManager) + public SalesPackageManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager, StatsManager statsManager, PowerPlayClubRepository powerPlayRepo) { super("SalesPackageManager", plugin); @@ -31,6 +50,7 @@ public class SalesPackageManager extends MiniPlugin _donationManager = donationManager; _inventoryManager = inventoryManager; _statsManager = statsManager; + _powerPlayRepo = powerPlayRepo; //Strutt20 asked me to remove some of the stuff from the menu AddSalesPackage(new Coins(this, 5000)); @@ -52,12 +72,15 @@ public class SalesPackageManager extends MiniPlugin AddSalesPackage(new IlluminatedChest(this)); AddSalesPackage(new FreedomChest(this)); //AddSalesPackage(new ValentinesGift(this)); - AddSalesPackage(new FrostLord(this)); - AddSalesPackage(new EasterBunny(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 PowerPlayClub(this, false)); + AddSalesPackage(new PowerPlayClub(this, true)); + AddSalesPackage(new OmegaChest(this)); } private void AddSalesPackage(SalesPackageBase salesPackage) @@ -86,6 +109,11 @@ public class SalesPackageManager extends MiniPlugin { return _inventoryManager; } + + public PowerPlayClubRepository getPowerPlay() + { + return _powerPlayRepo; + } public void help(Player player) { @@ -102,6 +130,7 @@ public class SalesPackageManager extends MiniPlugin 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"); for (SalesPackageBase salesPackage : _salesPackages.values()) { @@ -117,6 +146,10 @@ public class SalesPackageManager extends MiniPlugin { 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 { packageBuilder = packageBuilder.extra("[").color("gray").extra(salesPackage.getName()).color("green").click("run_command", "/display " + playerName + " " + salesPackage.getName()).extra("] ").color("gray"); @@ -127,6 +160,7 @@ public class SalesPackageManager extends MiniPlugin chestBuilder.sendToPlayer(caller); packageBuilder.sendToPlayer(caller); clanBuilder.sendToPlayer(caller); + powerPlayBuilder.sendToPlayer(caller); } public StatsManager getStatsManager() diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeHeroCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeHeroCommand.java index c4e7c9b22..2fe666e7a 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeHeroCommand.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeHeroCommand.java @@ -22,6 +22,6 @@ public class LifetimeHeroCommand extends CommandBase Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales rank " + args[0] + " HERO true")); resetCommandCharge(caller); - Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales coin " + args[0] + " 30000")); + Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales item " + args[0] + " 2 Item Mythical Chest")); } } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeLegendCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeLegendCommand.java index 540f19304..57d766c7b 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeLegendCommand.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeLegendCommand.java @@ -22,6 +22,6 @@ public class LifetimeLegendCommand extends CommandBase Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales rank " + args[0] + " LEGEND true")); resetCommandCharge(caller); - Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales coin " + args[0] + " 60000")); + Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales item " + args[0] + " 3 Item Mythical Chest")); } } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeTitanCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeTitanCommand.java new file mode 100644 index 000000000..77650c86e --- /dev/null +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeTitanCommand.java @@ -0,0 +1,27 @@ +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.core.common.Rank; +import mineplex.staffServer.salespackage.SalesPackageManager; + +public class LifetimeTitanCommand extends CommandBase +{ + public LifetimeTitanCommand(SalesPackageManager plugin) + { + super(plugin, Rank.MODERATOR, "lifetimetitan"); + } + + @Override + public void Execute(Player caller, String[] args) + { + resetCommandCharge(caller); + Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales rank " + args[0] + " TITAN true")); + + resetCommandCharge(caller); + Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales item " + args[0] + " 5 Item Mythical Chest")); + } +} diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeUltraCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeUltraCommand.java index d22d363f8..0022e4ff0 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeUltraCommand.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/LifetimeUltraCommand.java @@ -22,6 +22,6 @@ public class LifetimeUltraCommand extends CommandBase Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales rank " + args[0] + " ULTRA true")); resetCommandCharge(caller); - Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales coin " + args[0] + " 15000")); + Bukkit.getServer().getPluginManager().callEvent(new PlayerCommandPreprocessEvent(caller, "/sales item " + args[0] + " 1 Item Mythical Chest")); } } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/PowerPlayCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/PowerPlayCommand.java new file mode 100644 index 000000000..e0887e3b4 --- /dev/null +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/PowerPlayCommand.java @@ -0,0 +1,45 @@ +package mineplex.staffServer.salespackage.command; + +import java.time.LocalDate; + +import org.bukkit.entity.Player; + +import mineplex.core.command.CommandBase; +import mineplex.core.common.Rank; +import mineplex.core.common.util.F; +import mineplex.staffServer.salespackage.SalesPackageManager; + +public class PowerPlayCommand extends CommandBase +{ + public PowerPlayCommand(SalesPackageManager plugin) + { + super(plugin, Rank.MODERATOR, "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()); + } + else + { + caller.sendMessage(F.main(Plugin.getName(), "Couldn't find " + playerName + "'s account!")); + } + }); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/Sales.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/Sales.java index 6cc6cab0a..1a2d237f0 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/Sales.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/Sales.java @@ -22,6 +22,7 @@ public class Sales extends MultiCommandBase AddCommand(new LifetimeHeroCommand(plugin)); AddCommand(new LifetimeLegendCommand(plugin)); AddCommand(new KitsCommand(plugin)); + AddCommand(new PowerPlayCommand(plugin)); } @Override diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeHero.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeHero.java index d1ff41360..7b0bfcb7c 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeHero.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeHero.java @@ -13,9 +13,9 @@ public class LifetimeHero extends SalesPackageBase public void displayToAgent(Player agent, String playerName) { - addButton(agent, "/sales coin " + playerName + " 30000", " 30,000 Coins"); - addButton(agent, "/sales rank " + playerName + " HERO true", " Lifetime Hero."); - addButton(agent, "Apply All", "/sales lifetimehero " + playerName, " Apply all above."); + addButton(agent, "/sales rank " + playerName + " HERO true", "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); } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeLegend.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeLegend.java index c2e7baec1..787b73973 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeLegend.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeLegend.java @@ -13,12 +13,12 @@ public class LifetimeLegend extends SalesPackageBase public void displayToAgent(Player agent, String playerName) { - addButton(agent, "/sales coin " + playerName + " 60000", " 60,000 Coins"); - addButton(agent, "/sales rank " + playerName + " LEGEND true", " Lifetime Legend."); - 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."); + addButton(agent, "/sales rank " + playerName + " LEGEND true", "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); } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeTitan.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeTitan.java index c2fb03c1a..cef69cde4 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeTitan.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeTitan.java @@ -13,10 +13,12 @@ public class LifetimeTitan extends SalesPackageBase public void displayToAgent(Player agent, String playerName) { - addButton(agent, "/sales rank " + playerName + " TITAN true", " Lifetime Titan."); + addButton(agent, "/sales rank " + playerName + " TITAN true", "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); } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeUltra.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeUltra.java index 9446883ae..0deb7ed75 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeUltra.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LifetimeUltra.java @@ -13,9 +13,9 @@ public class LifetimeUltra extends SalesPackageBase public void displayToAgent(Player agent, String playerName) { - addButton(agent, "/sales coin " + playerName + " 15000", " 15,000 Coins"); - addButton(agent, "/sales rank " + playerName + " ULTRA true", " Lifetime Ultra."); - addButton(agent, "Apply All", "/sales lifetimeultra " + playerName, " Apply all above."); + addButton(agent, "/sales rank " + playerName + " ULTRA true", "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); } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/OmegaChest.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/OmegaChest.java new file mode 100644 index 000000000..4c519bf63 --- /dev/null +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/OmegaChest.java @@ -0,0 +1,20 @@ +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); + } +} diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/PowerPlayClub.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/PowerPlayClub.java new file mode 100644 index 000000000..de173b6d4 --- /dev/null +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/PowerPlayClub.java @@ -0,0 +1,22 @@ +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); + } +} \ No newline at end of file From 29bb2a38956f947aa82ec30162300f0f56a592ad Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Sat, 3 Sep 2016 15:42:32 -0400 Subject: [PATCH 3/7] Add an enjin chargeback command and fix punishing in support servers --- .../mineplex/core/punish/UI/PunishPage.java | 10 ++++- .../src/mineplex/enjinTranslator/Enjin.java | 43 ++++++++++++------- 2 files changed, 36 insertions(+), 17 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/punish/UI/PunishPage.java b/Plugins/Mineplex.Core/src/mineplex/core/punish/UI/PunishPage.java index bdbbce7e5..3de66be8c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/punish/UI/PunishPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/punish/UI/PunishPage.java @@ -256,7 +256,15 @@ public class PunishPage extends CraftInventoryCustom implements Listener , 1, false, true), new PunishButton(this, Category.Hacking, 2, true, getDuration(Category.Hacking, 2, offenseMap))); - int flightSeverity = (Managers.get(AntiHack.class).isStrict() ? 3 : 2); + int flightSeverity = 2; + try + { + if (Managers.get(AntiHack.class).isStrict()) + { + flightSeverity = 3; + } + } + catch (Exception e) {} AddButton(41, new ShopItem(Material.INK_SACK, (byte)1, "Severity 3",new String[] diff --git a/Plugins/Mineplex.EnjinTranslator/src/mineplex/enjinTranslator/Enjin.java b/Plugins/Mineplex.EnjinTranslator/src/mineplex/enjinTranslator/Enjin.java index 1463aa537..56103deda 100644 --- a/Plugins/Mineplex.EnjinTranslator/src/mineplex/enjinTranslator/Enjin.java +++ b/Plugins/Mineplex.EnjinTranslator/src/mineplex/enjinTranslator/Enjin.java @@ -1,5 +1,19 @@ package mineplex.enjinTranslator; +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.util.AbstractMap; +import java.util.Date; +import java.util.Iterator; +import java.util.Map.Entry; +import java.util.UUID; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; + import mineplex.core.MiniPlugin; import mineplex.core.account.CoreClient; import mineplex.core.account.CoreClientManager; @@ -10,24 +24,12 @@ import mineplex.core.common.util.NautHashMap; import mineplex.core.donation.DonationManager; import mineplex.core.inventory.InventoryManager; import mineplex.core.powerplayclub.PowerPlayClubRepository; +import mineplex.core.punish.Category; +import mineplex.core.punish.Punish; import mineplex.core.server.util.TransactionResponse; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.enjinTranslator.purchase.PurchaseManager; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.plugin.java.JavaPlugin; - -import java.text.SimpleDateFormat; -import java.time.LocalDate; -import java.util.AbstractMap; -import java.util.Date; -import java.util.Iterator; -import java.util.Map.Entry; -import java.util.UUID; public class Enjin extends MiniPlugin implements CommandExecutor { @@ -36,6 +38,7 @@ public class Enjin extends MiniPlugin implements CommandExecutor private InventoryManager _inventoryManager; private PurchaseManager _purchaseManager; private PowerPlayClubRepository _powerPlayClubRepository; + private Punish _punish; private NautHashMap> _cachedUUIDs = new NautHashMap>(); private static Object _commandLock = new Object(); @@ -44,13 +47,14 @@ public class Enjin extends MiniPlugin implements CommandExecutor private SimpleDateFormat _dateFormat = new SimpleDateFormat("MM-dd-yyyy HH:mm:ss"); - public Enjin(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager) + public Enjin(EnjinTranslator plugin, CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager) { super("Enjin", plugin); _clientManager = clientManager; _donationManager = donationManager; _inventoryManager = inventoryManager; + _punish = new Punish(plugin, plugin.GetWebServerAddress(), clientManager); _purchaseManager = new PurchaseManager(plugin); _powerPlayClubRepository = new PowerPlayClubRepository(plugin, clientManager); @@ -115,7 +119,14 @@ public class Enjin extends MiniPlugin implements CommandExecutor final UUID playerUUID = uuid; _cachedUUIDs.put(name, new AbstractMap.SimpleEntry(playerUUID, System.currentTimeMillis() + 240000)); - + + if (args[0].equalsIgnoreCase("chargeback")) + { + _punish.AddPunishment(name, Category.Other, "Chargeback", "Strutt20", 1, true, -1, true); + System.out.println("[" + _dateFormat.format(new Date()) + "] " + name + " was banned for charging back!"); + return; + } + if (!checkForClansPurchase(args, name, client)) { if (!checkForBoosterPurchase(args, name, playerUUID, client)) From 9ce49b10c0d9f821a1d0d556ea167895667d5d70 Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Sun, 4 Sep 2016 22:11:05 -0400 Subject: [PATCH 4/7] Add a command to allow support agents to check for ownership of internal sales packages --- .../customerSupport/CustomerSupport.java | 45 ++++++++++++---- .../checkOwnsPackageCommand.java | 54 +++++++++++++++++++ .../command/PowerPlayCommand.java | 2 + 3 files changed, 90 insertions(+), 11 deletions(-) create mode 100644 Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/checkOwnsPackageCommand.java diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java index 050304456..566b9e591 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java @@ -9,6 +9,18 @@ import java.util.List; import java.util.Locale; import java.util.UUID; +import org.bukkit.GameMode; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.block.BlockBreakEvent; +import org.bukkit.event.entity.EntityDamageEvent; +import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.bukkit.event.entity.FoodLevelChangeEvent; +import org.bukkit.event.player.AsyncPlayerChatEvent; +import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.plugin.java.JavaPlugin; + import mineplex.core.MiniPlugin; import mineplex.core.account.CoreClient; import mineplex.core.account.CoreClientManager; @@ -24,17 +36,6 @@ import mineplex.core.donation.repository.token.TransactionToken; import mineplex.core.powerplayclub.PowerPlayClubRepository; import mineplex.serverdata.database.ResultSetCallable; import mineplex.staffServer.salespackage.SalesPackageManager; -import org.bukkit.GameMode; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.block.BlockBreakEvent; -import org.bukkit.event.entity.EntityDamageEvent; -import org.bukkit.event.entity.EntityDamageEvent.DamageCause; -import org.bukkit.event.entity.FoodLevelChangeEvent; -import org.bukkit.event.player.AsyncPlayerChatEvent; -import org.bukkit.event.player.PlayerJoinEvent; -import org.bukkit.event.player.PlayerQuitEvent; -import org.bukkit.plugin.java.JavaPlugin; public class CustomerSupport extends MiniPlugin implements ResultSetCallable { @@ -89,6 +90,7 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable public void addCommands() { addCommand(new checkCommand(this)); + addCommand(new checkOwnsPackageCommand(this)); } public void Help(Player caller) @@ -309,6 +311,27 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable }); } + public void showPlayerPackageInfo(Player caller, CoreClient client, String salesPackage) + { + CustomerSupport instance = this; + runAsync(new Runnable() + { + public void run() + { + _repository.loadBonusLogForAccountId(client.getAccountId(), instance); + + runSync(new Runnable() + { + public void run() + { + caller.sendMessage(C.cBlue + salesPackage + ": " + getLockedFreedomStr(client.getUniqueId(), salesPackage)); + _accountBonusLog.remove(client.getAccountId()); + } + }); + } + }); + } + @EventHandler public void blockBreak(BlockBreakEvent event) { diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/checkOwnsPackageCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/checkOwnsPackageCommand.java new file mode 100644 index 000000000..97cd469e7 --- /dev/null +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/checkOwnsPackageCommand.java @@ -0,0 +1,54 @@ +package mineplex.staffServer.customerSupport; + +import org.bukkit.entity.Player; + +import mineplex.core.command.CommandBase; +import mineplex.core.common.Rank; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilPlayer; + +public class checkOwnsPackageCommand extends CommandBase +{ + public checkOwnsPackageCommand(CustomerSupport plugin) + { + super(plugin, Rank.MODERATOR, "checkownspackage"); + } + + @Override + public void Execute(final Player caller, String[] args) + { + if (args == null || args.length < 2) + { + UtilPlayer.message(caller, F.main(Plugin.getName(), "Usage: /" + _aliasUsed + " ")); + } + else + { + String playerName = args[0]; + String packageName = args[1]; + for (int i = 2; i < args.length; i++) + { + packageName += (" " + args[i]); + } + + final String salesPackage = packageName; + + _commandCenter.GetClientManager().checkPlayerName(caller, playerName, name -> + { + if (name != null) + { + _commandCenter.GetClientManager().loadClientByName(name, client -> + { + if (client != null) + { + Plugin.showPlayerPackageInfo(caller, client, salesPackage); + } + else + { + UtilPlayer.message(caller, F.main(Plugin.getName(), "Could not load data for " + name)); + } + }); + } + }); + } + } +} diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/PowerPlayCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/PowerPlayCommand.java index e0887e3b4..6c21148a0 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/PowerPlayCommand.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/PowerPlayCommand.java @@ -7,6 +7,7 @@ import org.bukkit.entity.Player; import mineplex.core.command.CommandBase; import mineplex.core.common.Rank; import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilPlayer; import mineplex.staffServer.salespackage.SalesPackageManager; public class PowerPlayCommand extends CommandBase @@ -35,6 +36,7 @@ public class PowerPlayCommand extends CommandBase 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 { From 504432d87bf9e2d7c584051ea24cd872545bcabd Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Sun, 4 Sep 2016 23:28:25 -0400 Subject: [PATCH 5/7] Fix titan command not being registered --- .../src/mineplex/staffServer/salespackage/command/Sales.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/Sales.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/Sales.java index 1a2d237f0..4a1bfc4c7 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/Sales.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/Sales.java @@ -21,6 +21,7 @@ public class Sales extends MultiCommandBase AddCommand(new LifetimeUltraCommand(plugin)); AddCommand(new LifetimeHeroCommand(plugin)); AddCommand(new LifetimeLegendCommand(plugin)); + AddCommand(new LifetimeTitanCommand(plugin)); AddCommand(new KitsCommand(plugin)); AddCommand(new PowerPlayCommand(plugin)); } From a7b0c9de054469c74b3e3f62920a4f73a09b1acb Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Sun, 4 Sep 2016 23:44:54 -0400 Subject: [PATCH 6/7] Fix unnecessary calls to mysql/mssql databases in support server --- .../salespackage/command/ItemCommand.java | 42 +++++++++++++------ 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/ItemCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/ItemCommand.java index c983848f0..e10af1a64 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/ItemCommand.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/ItemCommand.java @@ -51,24 +51,40 @@ public class ItemCommand extends CommandBase if (uuid != null) { - Plugin.getDonationManager().PurchaseUnknownSalesPackage(new Callback() + if (category.equalsIgnoreCase("ITEM")) { - public void run(TransactionResponse data) + Plugin.getInventoryManager().addItemToInventoryForOffline(new Callback() { - Plugin.getInventoryManager().addItemToInventoryForOffline(new Callback() + public void run(Boolean success) { - public void run(Boolean success) + if (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 + ".")); - } + UtilPlayer.message(caller, F.main(Plugin.getName(), playerName + " received " + amount + " " + itemName + ".")); } - }, uuid, itemName, amount); - } - }, playerName, client.getAccountId(), (amount == 1 ? itemName : itemName + " " + amount), GlobalCurrency.GEM, 0, false); + else + { + UtilPlayer.message(caller, F.main(Plugin.getName(), "ERROR processing " + playerName + " " + amount + " " + itemName + ".")); + } + } + }, uuid, itemName, amount); + } + else + { + Plugin.getDonationManager().PurchaseUnknownSalesPackage(new Callback() + { + public void run(TransactionResponse data) + { + 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 + ".")); + } + } + }, playerName, client.getAccountId(), (amount == 1 ? itemName : itemName + " " + amount), GlobalCurrency.GEM, 0, false); + } } else caller.sendMessage(F.main(Plugin.getName(), "Couldn't find " + playerName + "'s account!")); From ccd81c1820e21b3aeb977c29df63d6626f2aa82d Mon Sep 17 00:00:00 2001 From: cnr Date: Mon, 5 Sep 2016 13:42:24 -0500 Subject: [PATCH 7/7] Fix BlockIgniteEvent NPE in MavericksManager --- .../Mineplex.Hub/src/mineplex/hub/modules/MavericksManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/MavericksManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/MavericksManager.java index 2ce181245..e84d6a60b 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/MavericksManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/MavericksManager.java @@ -266,7 +266,7 @@ public class MavericksManager extends MiniPlugin @EventHandler public void onBlockIgnite(BlockIgniteEvent event) { - if(isInsideDisplaySlot(event.getBlock()) || isInsideDisplaySlot(event.getIgnitingBlock())) + if(isInsideDisplaySlot(event.getBlock()) || (event.getIgnitingBlock() != null && isInsideDisplaySlot(event.getIgnitingBlock()))) event.setCancelled(true); }