Implementing Carl message.

This commit is contained in:
Sarah 2015-08-11 09:09:16 +02:00
parent 3bedc4ce84
commit b99c526169

View File

@ -4,6 +4,7 @@ import java.sql.Date;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.TimeZone;
import mineplex.core.MiniClientPlugin;
@ -26,6 +27,7 @@ import mineplex.core.hologram.Hologram;
import mineplex.core.hologram.HologramManager;
import mineplex.core.npc.Npc;
import mineplex.core.npc.NpcManager;
import mineplex.core.recharge.Recharge;
import mineplex.core.reward.RewardManager;
import mineplex.core.stats.StatsManager;
import mineplex.core.updater.UpdateType;
@ -70,6 +72,7 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
private ArrayList<Object> _pendingExplosions = new ArrayList<>();
private ArrayList<Player> _pendingExplosionsPlayers = new ArrayList<>();
private HashMap<String, Boolean> _showCarl = new HashMap<>();
private long _explode;
private boolean _canVote;
@ -949,4 +952,36 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
entity.remove();
}
}
@EventHandler
public void Join(final PlayerJoinEvent event)
{
runSyncLater(new Runnable()
{
@Override
public void run()
{
_showCarl.put(event.getPlayer().getName(), true);
}
}, 200);
}
@EventHandler
public void carlUpdate(UpdateEvent event)
{
if (event.getType() != UpdateType.SEC)
return;
for (Player player : UtilServer.getPlayers())
{
if (Recharge.Instance.use(player, "Carl Inform", 240000, false, false))
{
if(_pollManager.Get(player).shouldPoll() || canVote(player) || canRank(player) || canDaily(player))
{
if(_showCarl.containsKey(player.getName()))
UtilPlayer.message(player, C.cDGreen + C.Bold + "Carl the Creeper)" + C.cGreen + " Hey " + player.getName().replace("s", "sss") + "! I have sssome amazing rewardsss for you! Come sssee me!");
}
}
}
}
}