diff --git a/Plugins/Mineplex.Core/src/mineplex/core/titangiveaway/TitanGiveawayManager.java b/Plugins/Mineplex.Core/src/mineplex/core/titangiveaway/TitanGiveawayManager.java index 37e535b82..0211f30f3 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/titangiveaway/TitanGiveawayManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/titangiveaway/TitanGiveawayManager.java @@ -40,11 +40,13 @@ public class TitanGiveawayManager extends MiniPlugin public void openPumpkin(final Player player, final Runnable onSuccess) { double rand = _random.nextDouble(); + System.out.println("a"); if (!hasTitan(player) && rand < RANK_FIND_CHANCE) { final int accountId = _clientManager.getAccountId(player); final Region region = getRegion(); final String serverName = getServerName(); + System.out.println("b"); // Need to check database that we can give away a rank runAsync(new Runnable() @@ -53,9 +55,11 @@ public class TitanGiveawayManager extends MiniPlugin public void run() { final boolean pass = _repository.canGiveaway(); + System.out.println("c"); if (pass && _repository.addTitan(accountId, region, serverName)) { + System.out.println("C"); runSync(new Runnable() { @Override @@ -66,8 +70,10 @@ public class TitanGiveawayManager extends MiniPlugin @Override public void run(Rank rank) { + System.out.println("d"); if (rank == Rank.TITAN) { + System.out.println("e"); TitanGiveawayMessage message = new TitanGiveawayMessage(player.getName(), _repository.getTitanCount() + 1); message.publish(); if (onSuccess != null) onSuccess.run(); @@ -87,7 +93,7 @@ public class TitanGiveawayManager extends MiniPlugin */ private boolean hasTitan(Player player) { - return !_clientManager.hasRank(player, Rank.TITAN); + return _clientManager.hasRank(player, Rank.TITAN); } public Region getRegion() @@ -109,9 +115,10 @@ public class TitanGiveawayManager extends MiniPlugin @EventHandler public void onCommand(PlayerCommandPreprocessEvent event) { - if (event.getMessage().startsWith("/pumpkin")) + if (event.getMessage().contains("pumpkin")) { openPumpkin(event.getPlayer(), null); + event.setCancelled(true); } } }