Lazy fix so that polls award gems instead of coins

This commit is contained in:
Shaun Bennett 2014-08-26 18:36:40 -05:00
parent c04319345a
commit b508cd036c

View File

@ -85,6 +85,9 @@ public class PollManager extends MiniClientPlugin<PlayerPollData>
if (event.getType() != UpdateType.SLOW) if (event.getType() != UpdateType.SLOW)
return; return;
if (_polls.size() == 0)
return;
for (Player player : _plugin.getServer().getOnlinePlayers()) for (Player player : _plugin.getServer().getOnlinePlayers())
{ {
PlayerPollData pollData = Get(player); PlayerPollData pollData = Get(player);
@ -147,7 +150,7 @@ public class PollManager extends MiniClientPlugin<PlayerPollData>
} }
} }
player.sendMessage(""); player.sendMessage("");
player.sendMessage("Click an answer to receive " + C.cYellow + poll.getCoinReward() + " Coins"); player.sendMessage("Click an answer to receive " + C.cGreen + poll.getCoinReward() + " Gems");
player.sendMessage(C.cGold + C.Bold + "--------------------------"); player.sendMessage(C.cGold + C.Bold + "--------------------------");
player.playSound(player.getEyeLocation(), Sound.ORB_PICKUP, 2f, 0f); player.playSound(player.getEyeLocation(), Sound.ORB_PICKUP, 2f, 0f);
@ -173,7 +176,7 @@ public class PollManager extends MiniClientPlugin<PlayerPollData>
if (_repository.addPollAnswer(uuid, poll.getId(), answer)) if (_repository.addPollAnswer(uuid, poll.getId(), answer))
{ {
// Poll response successful, give coins // Poll response successful, give coins
_donationManager.RewardCoins(new Callback<Boolean>() _donationManager.RewardGems(new Callback<Boolean>()
{ {
@Override @Override
public void run(Boolean completed) public void run(Boolean completed)
@ -184,7 +187,7 @@ public class PollManager extends MiniClientPlugin<PlayerPollData>
@Override @Override
public void run() public void run()
{ {
UtilPlayer.message(player, F.main("Coin", "You received " + F.elem(poll.getCoinReward() + "") + " coins!")); UtilPlayer.message(player, F.main("Gem", "You received " + F.elem(poll.getCoinReward() + "") + " Gems!"));
} }
}); });
} }