2013-08-27 17:14:08 +02:00
|
|
|
package mineplex.hub;
|
|
|
|
|
2013-09-07 06:09:12 +02:00
|
|
|
import java.util.HashMap;
|
2013-12-16 04:32:51 +01:00
|
|
|
import java.util.HashSet;
|
2013-08-31 10:19:23 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
import org.bukkit.Bukkit;
|
|
|
|
import org.bukkit.ChatColor;
|
|
|
|
import org.bukkit.GameMode;
|
|
|
|
import org.bukkit.Location;
|
2013-12-16 04:32:51 +01:00
|
|
|
import org.bukkit.Material;
|
2014-04-25 09:44:14 +02:00
|
|
|
import org.bukkit.craftbukkit.v1_7_R3.CraftWorld;
|
2013-09-04 20:35:59 +02:00
|
|
|
import org.bukkit.entity.Egg;
|
2013-08-27 17:14:08 +02:00
|
|
|
import org.bukkit.entity.Entity;
|
2013-08-31 10:19:23 +02:00
|
|
|
import org.bukkit.entity.LivingEntity;
|
2013-08-27 17:14:08 +02:00
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
import org.bukkit.event.EventHandler;
|
|
|
|
import org.bukkit.event.EventPriority;
|
2013-12-16 04:32:51 +01:00
|
|
|
import org.bukkit.event.block.Action;
|
2013-08-27 17:14:08 +02:00
|
|
|
import org.bukkit.event.entity.EntityDamageEvent;
|
2013-09-04 20:35:59 +02:00
|
|
|
import org.bukkit.event.entity.ItemSpawnEvent;
|
2013-08-27 17:14:08 +02:00
|
|
|
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
2013-10-25 10:20:14 +02:00
|
|
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
2013-08-27 17:14:08 +02:00
|
|
|
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
2013-09-07 02:43:45 +02:00
|
|
|
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
2013-12-16 04:32:51 +01:00
|
|
|
import org.bukkit.event.player.PlayerDropItemEvent;
|
|
|
|
import org.bukkit.event.player.PlayerInteractEvent;
|
2013-08-27 17:14:08 +02:00
|
|
|
import org.bukkit.event.player.PlayerJoinEvent;
|
2014-02-28 10:18:32 +01:00
|
|
|
import org.bukkit.event.player.PlayerLoginEvent;
|
2013-08-27 17:14:08 +02:00
|
|
|
import org.bukkit.event.player.PlayerQuitEvent;
|
|
|
|
import org.bukkit.event.player.PlayerRespawnEvent;
|
2013-09-07 02:43:45 +02:00
|
|
|
import org.bukkit.event.server.ServerListPingEvent;
|
2013-08-31 11:01:41 +02:00
|
|
|
import org.bukkit.event.world.ChunkLoadEvent;
|
2013-08-27 17:14:08 +02:00
|
|
|
import org.bukkit.plugin.java.JavaPlugin;
|
|
|
|
import org.bukkit.scoreboard.DisplaySlot;
|
|
|
|
import org.bukkit.scoreboard.Objective;
|
|
|
|
import org.bukkit.scoreboard.Scoreboard;
|
|
|
|
|
|
|
|
import mineplex.core.MiniClientPlugin;
|
2014-02-28 10:18:32 +01:00
|
|
|
import mineplex.core.account.CoreClient;
|
2013-08-27 17:14:08 +02:00
|
|
|
import mineplex.core.account.CoreClientManager;
|
2013-10-22 06:46:31 +02:00
|
|
|
import mineplex.core.blockrestore.BlockRestore;
|
2013-08-27 17:14:08 +02:00
|
|
|
import mineplex.core.common.Rank;
|
|
|
|
import mineplex.core.common.util.C;
|
2013-09-07 06:09:12 +02:00
|
|
|
import mineplex.core.common.util.F;
|
2013-08-27 17:14:08 +02:00
|
|
|
import mineplex.core.common.util.UtilInv;
|
2013-10-25 13:56:28 +02:00
|
|
|
import mineplex.core.common.util.UtilParticle;
|
2013-08-27 17:14:08 +02:00
|
|
|
import mineplex.core.common.util.UtilPlayer;
|
|
|
|
import mineplex.core.common.util.UtilServer;
|
2013-10-26 10:01:26 +02:00
|
|
|
import mineplex.core.common.util.UtilTime;
|
2013-08-27 17:14:08 +02:00
|
|
|
import mineplex.core.common.util.UtilWorld;
|
2013-10-25 13:56:28 +02:00
|
|
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
2013-08-31 11:01:41 +02:00
|
|
|
import mineplex.core.disguise.DisguiseManager;
|
|
|
|
import mineplex.core.disguise.disguises.DisguisePlayer;
|
2013-11-16 11:59:28 +01:00
|
|
|
import mineplex.core.disguise.disguises.DisguiseSlime;
|
2013-08-27 17:14:08 +02:00
|
|
|
import mineplex.core.donation.DonationManager;
|
2013-12-16 04:32:51 +01:00
|
|
|
import mineplex.core.itemstack.ItemStackFactory;
|
2013-09-07 02:43:45 +02:00
|
|
|
import mineplex.core.portal.Portal;
|
2013-12-14 06:38:16 +01:00
|
|
|
import mineplex.core.stats.StatsManager;
|
2013-09-03 20:34:28 +02:00
|
|
|
import mineplex.core.task.TaskManager;
|
2013-08-27 17:14:08 +02:00
|
|
|
import mineplex.core.updater.UpdateType;
|
|
|
|
import mineplex.core.updater.event.UpdateEvent;
|
2013-10-19 07:52:15 +02:00
|
|
|
import mineplex.hub.gadget.GadgetManager;
|
2013-09-18 11:46:45 +02:00
|
|
|
import mineplex.hub.modules.*;
|
2013-10-25 10:20:14 +02:00
|
|
|
import mineplex.hub.mount.MountManager;
|
2013-09-07 06:09:12 +02:00
|
|
|
import mineplex.hub.party.Party;
|
|
|
|
import mineplex.hub.party.PartyManager;
|
|
|
|
import mineplex.hub.tutorial.TutorialManager;
|
2013-10-19 07:52:15 +02:00
|
|
|
import mineplex.minecraft.game.core.condition.ConditionManager;
|
2013-08-27 17:14:08 +02:00
|
|
|
|
|
|
|
public class HubManager extends MiniClientPlugin<HubClient>
|
|
|
|
{
|
2014-01-14 09:04:06 +01:00
|
|
|
public String Mode = "Normal";
|
2013-10-22 06:46:31 +02:00
|
|
|
|
|
|
|
private BlockRestore _blockRestore;
|
2013-08-27 17:14:08 +02:00
|
|
|
private CoreClientManager _clientManager;
|
2013-10-19 07:52:15 +02:00
|
|
|
private ConditionManager _conditionManager;
|
2013-08-27 17:14:08 +02:00
|
|
|
private DonationManager _donationManager;
|
2013-08-31 11:01:41 +02:00
|
|
|
private DisguiseManager _disguiseManager;
|
2013-09-07 06:09:12 +02:00
|
|
|
private PartyManager _partyManager;
|
2013-09-07 02:43:45 +02:00
|
|
|
private Portal _portal;
|
2013-12-14 06:38:16 +01:00
|
|
|
private StatsManager _statsManager;
|
2013-12-21 10:05:42 +01:00
|
|
|
private GadgetManager _gadgetManager;
|
|
|
|
private MountManager _mountManager;
|
2013-09-04 23:44:53 +02:00
|
|
|
|
2013-10-25 10:20:14 +02:00
|
|
|
private VisibilityManager _visibilityManager;
|
2013-09-07 06:09:12 +02:00
|
|
|
private TutorialManager _tutorialManager;
|
2013-09-18 11:46:45 +02:00
|
|
|
private TextManager _textCreator;
|
|
|
|
private ParkourManager _parkour;
|
2013-08-27 17:14:08 +02:00
|
|
|
|
|
|
|
private Location _spawn;
|
|
|
|
private int _scoreboardTick = 0;
|
2013-09-07 06:09:12 +02:00
|
|
|
|
|
|
|
private HashMap<Player, Scoreboard> _scoreboards = new HashMap<Player, Scoreboard>();
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
private String _pigStacker = "0 - Nobody";
|
2013-09-07 02:43:45 +02:00
|
|
|
|
|
|
|
private boolean _shuttingDown;
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-10-26 10:01:26 +02:00
|
|
|
private HashMap<String, Long> _portalTime = new HashMap<String, Long>();
|
2013-12-16 04:32:51 +01:00
|
|
|
|
|
|
|
private int _slot = 7;
|
|
|
|
private HashSet<Player> _disabled = new HashSet<Player>();
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-10-22 06:46:31 +02:00
|
|
|
public HubManager(JavaPlugin plugin, BlockRestore blockRestore, CoreClientManager clientManager, DonationManager donationManager, ConditionManager conditionManager, DisguiseManager disguiseManager, TaskManager taskManager, Portal portal, PartyManager partyManager)
|
2013-08-27 17:14:08 +02:00
|
|
|
{
|
|
|
|
super("Hub Manager", plugin);
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-10-22 06:46:31 +02:00
|
|
|
_blockRestore = blockRestore;
|
2013-08-27 17:14:08 +02:00
|
|
|
_clientManager = clientManager;
|
2013-10-19 07:52:15 +02:00
|
|
|
_conditionManager = conditionManager;
|
2013-10-25 10:20:14 +02:00
|
|
|
_donationManager = donationManager;
|
2013-08-31 11:01:41 +02:00
|
|
|
_disguiseManager = disguiseManager;
|
2013-10-25 10:20:14 +02:00
|
|
|
|
2013-09-07 02:43:45 +02:00
|
|
|
_portal = portal;
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-31 10:19:23 +02:00
|
|
|
_spawn = new Location(UtilWorld.getWorld("world"), 0.5, 74, 0.5);
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-09-18 11:46:45 +02:00
|
|
|
_textCreator = new TextManager(this);
|
|
|
|
_parkour = new ParkourManager(this, donationManager, taskManager);
|
2013-10-25 10:20:14 +02:00
|
|
|
|
2013-09-08 02:16:39 +02:00
|
|
|
new MapManager(this);
|
2013-09-18 11:46:45 +02:00
|
|
|
new WorldManager(this);
|
|
|
|
new JumpManager(this);
|
2013-10-22 06:46:31 +02:00
|
|
|
new NewsManager(this);
|
2013-10-19 07:52:15 +02:00
|
|
|
|
2013-12-21 10:05:42 +01:00
|
|
|
_mountManager = new MountManager(this);
|
|
|
|
_gadgetManager = new GadgetManager(this, _mountManager);
|
2013-09-04 23:44:53 +02:00
|
|
|
|
2013-09-09 10:28:35 +02:00
|
|
|
_partyManager = partyManager;
|
2013-09-07 06:09:12 +02:00
|
|
|
_tutorialManager = new TutorialManager(this, donationManager, taskManager, _textCreator);
|
2013-10-25 10:20:14 +02:00
|
|
|
_visibilityManager = new VisibilityManager(this);
|
2013-12-14 06:38:16 +01:00
|
|
|
|
|
|
|
_statsManager = new StatsManager(plugin);
|
2013-12-18 11:56:59 +01:00
|
|
|
|
|
|
|
((CraftWorld)Bukkit.getWorlds().get(0)).getHandle().pvpMode = true;
|
2013-09-01 00:34:53 +02:00
|
|
|
}
|
2013-09-07 02:43:45 +02:00
|
|
|
|
|
|
|
@EventHandler(priority = EventPriority.HIGHEST)
|
|
|
|
public void reflectMotd(ServerListPingEvent event)
|
|
|
|
{
|
|
|
|
if (_shuttingDown)
|
|
|
|
{
|
|
|
|
event.setMotd("Restarting soon");
|
|
|
|
}
|
|
|
|
}
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-12-16 04:32:51 +01:00
|
|
|
@EventHandler
|
|
|
|
public void BumpJoin(PlayerJoinEvent event)
|
|
|
|
{
|
|
|
|
event.getPlayer().getInventory().setItem(_slot, ItemStackFactory.Instance.CreateStack(Material.SLIME_BALL, (byte)0, 1,
|
|
|
|
C.cYellow + "Stacker" + C.cWhite + " - " + C.cGreen + "Enabled"));
|
|
|
|
}
|
|
|
|
|
|
|
|
@EventHandler
|
|
|
|
public void BumpQuit(PlayerQuitEvent event)
|
|
|
|
{
|
|
|
|
_disabled.remove(event.getPlayer());
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean BumpDisabled(Entity ent)
|
|
|
|
{
|
|
|
|
if (ent == null)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
return _disabled.contains(ent);
|
|
|
|
}
|
|
|
|
|
|
|
|
@EventHandler
|
|
|
|
public void BumpToggle(PlayerInteractEvent event)
|
|
|
|
{
|
|
|
|
if (event.getAction() == Action.PHYSICAL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
Player player = event.getPlayer();
|
|
|
|
|
|
|
|
if (player.getInventory().getHeldItemSlot() != _slot)
|
|
|
|
return;
|
|
|
|
|
|
|
|
event.setCancelled(true);
|
|
|
|
|
|
|
|
if (_disabled.remove(player))
|
|
|
|
{
|
|
|
|
UtilPlayer.message(player, F.main("Hub Games", "You are back in the Hub Games!"));
|
|
|
|
|
|
|
|
player.getInventory().setItem(_slot, ItemStackFactory.Instance.CreateStack(Material.SLIME_BALL, (byte)0, 1,
|
|
|
|
C.cYellow + "Stacker" + C.cWhite + " - " + C.cGreen + "Enabled"));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
_disabled.add(player);
|
|
|
|
UtilPlayer.message(player, F.main("Hub Games", "You are no longer partaking in Hub Games."));
|
|
|
|
|
|
|
|
player.getInventory().setItem(_slot, ItemStackFactory.Instance.CreateStack(Material.MAGMA_CREAM, (byte)0, 1,
|
|
|
|
C.cYellow + "Stacker" + C.cWhite + " - " + C.cRed + "Disabled"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@EventHandler
|
|
|
|
public void orderThatItem(final PlayerDropItemEvent event)
|
|
|
|
{
|
|
|
|
if (event.getItemDrop().getItemStack().getType() == Material.REDSTONE_TORCH_OFF || event.getItemDrop().getItemStack().getType() == Material.REDSTONE_TORCH_ON)
|
|
|
|
{
|
|
|
|
Bukkit.getScheduler().scheduleSyncDelayedTask(GetPlugin(), new Runnable()
|
|
|
|
{
|
|
|
|
public void run()
|
|
|
|
{
|
|
|
|
if (event.getPlayer().isOnline())
|
|
|
|
{
|
|
|
|
event.getPlayer().getInventory().remove(event.getItemDrop().getItemStack().getType());
|
|
|
|
event.getPlayer().getInventory().setItem(_slot, ItemStackFactory.Instance.CreateStack(event.getItemDrop().getItemStack().getType(), (byte)0, 1, ChatColor.RESET + C.cYellow + "Stacker" + C.cWhite + (_disabled.contains(event.getPlayer()) ? C.cWhite + " - " + C.cRed + "Disabled" : " - " + C.cGreen + "Enabled")));
|
|
|
|
event.getPlayer().updateInventory();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-07 02:43:45 +02:00
|
|
|
@EventHandler
|
|
|
|
public void redirectStopCommand(PlayerCommandPreprocessEvent event)
|
|
|
|
{
|
|
|
|
if (event.getPlayer().isOp() && event.getMessage().equalsIgnoreCase("/stop"))
|
|
|
|
{
|
|
|
|
_shuttingDown = true;
|
|
|
|
|
|
|
|
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(_plugin, new Runnable()
|
|
|
|
{
|
|
|
|
public void run()
|
|
|
|
{
|
|
|
|
_portal.SendAllPlayers("Lobby");
|
|
|
|
|
|
|
|
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(_plugin, new Runnable()
|
|
|
|
{
|
|
|
|
public void run()
|
|
|
|
{
|
|
|
|
Bukkit.shutdown();
|
|
|
|
}
|
|
|
|
}, 40L);
|
|
|
|
}
|
|
|
|
}, 60L);
|
|
|
|
|
|
|
|
event.setCancelled(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-04 20:35:59 +02:00
|
|
|
@EventHandler
|
|
|
|
public void preventEggSpawn(ItemSpawnEvent event)
|
|
|
|
{
|
|
|
|
if (event.getEntity() instanceof Egg)
|
|
|
|
{
|
|
|
|
event.setCancelled(true);
|
|
|
|
}
|
|
|
|
}
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
@EventHandler
|
|
|
|
public void PlayerRespawn(PlayerRespawnEvent event)
|
|
|
|
{
|
2013-08-31 10:19:23 +02:00
|
|
|
event.setRespawnLocation(GetSpawn());
|
2013-08-27 17:14:08 +02:00
|
|
|
}
|
2013-09-04 23:44:53 +02:00
|
|
|
|
|
|
|
@EventHandler(priority = EventPriority.MONITOR)
|
|
|
|
public void OnChunkLoad(ChunkLoadEvent event)
|
|
|
|
{
|
|
|
|
for (Entity entity : event.getChunk().getEntities())
|
|
|
|
{
|
|
|
|
if (entity instanceof LivingEntity)
|
|
|
|
{
|
|
|
|
if (((LivingEntity)entity).isCustomNameVisible() && ((LivingEntity)entity).getCustomName() != null)
|
|
|
|
{
|
2013-09-27 21:40:09 +02:00
|
|
|
if (ChatColor.stripColor(((LivingEntity)entity).getCustomName()).equalsIgnoreCase("Minekart"))
|
2013-09-04 23:44:53 +02:00
|
|
|
{
|
2013-09-18 14:16:29 +02:00
|
|
|
_disguiseManager.disguise(new DisguisePlayer(entity, ChatColor.YELLOW + "MineKart"));
|
2013-09-04 23:44:53 +02:00
|
|
|
}
|
2013-11-16 11:59:28 +01:00
|
|
|
else if (ChatColor.stripColor(((LivingEntity)entity).getCustomName()).equalsIgnoreCase("Block Hunt"))
|
|
|
|
{
|
|
|
|
DisguiseSlime disguise = new DisguiseSlime(entity);
|
|
|
|
disguise.SetCustomNameVisible(true);
|
|
|
|
disguise.SetName(((LivingEntity)entity).getCustomName());
|
|
|
|
disguise.SetSize(2);
|
|
|
|
_disguiseManager.disguise(disguise);
|
|
|
|
}
|
2013-09-04 23:44:53 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-02-28 10:18:32 +01:00
|
|
|
|
|
|
|
@EventHandler(priority = EventPriority.LOW)
|
|
|
|
public void login(final PlayerLoginEvent event)
|
|
|
|
{
|
|
|
|
CoreClient client = _clientManager.Get(event.getPlayer().getName());
|
|
|
|
|
|
|
|
// Reserved Slot Check
|
|
|
|
if (Bukkit.getOnlinePlayers().length >= Bukkit.getServer().getMaxPlayers())
|
|
|
|
{
|
|
|
|
if (!client.GetRank().Has(Rank.ULTRA))
|
|
|
|
{
|
|
|
|
Bukkit.getScheduler().scheduleSyncDelayedTask(GetPlugin(), new Runnable()
|
|
|
|
{
|
|
|
|
public void run()
|
|
|
|
{
|
|
|
|
_portal.SendPlayerToServer(event.getPlayer(), "Lobby");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
event.allow();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-09-04 23:44:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
@EventHandler(priority = EventPriority.LOW)
|
|
|
|
public void PlayerJoin(PlayerJoinEvent event)
|
|
|
|
{
|
2013-09-23 22:30:40 +02:00
|
|
|
try
|
2013-08-27 17:14:08 +02:00
|
|
|
{
|
2013-09-23 22:30:40 +02:00
|
|
|
final Player player = event.getPlayer();
|
|
|
|
|
|
|
|
//Survival
|
|
|
|
player.setGameMode(GameMode.SURVIVAL);
|
|
|
|
|
|
|
|
//Public Message
|
|
|
|
event.setJoinMessage(null);
|
|
|
|
|
|
|
|
//Teleport
|
|
|
|
player.teleport(GetSpawn());
|
|
|
|
|
|
|
|
//Allow Double Jump
|
|
|
|
player.setAllowFlight(true);
|
|
|
|
|
|
|
|
UtilInv.Clear(player);
|
|
|
|
|
|
|
|
//Scoreboard
|
|
|
|
Scoreboard board = Bukkit.getScoreboardManager().getNewScoreboard();
|
|
|
|
player.setScoreboard(board);
|
|
|
|
_scoreboards.put(player, board);
|
|
|
|
|
|
|
|
//Objective
|
|
|
|
Objective obj = board.registerNewObjective(C.Bold + "Player Data", "dummy");
|
|
|
|
obj.setDisplaySlot(DisplaySlot.SIDEBAR);
|
|
|
|
|
2014-04-11 02:15:44 +02:00
|
|
|
|
2013-09-23 22:30:40 +02:00
|
|
|
for (Rank rank : Rank.values())
|
2013-09-10 02:17:55 +02:00
|
|
|
{
|
2013-09-23 22:30:40 +02:00
|
|
|
if (rank != Rank.ALL)
|
2013-11-07 05:38:33 +01:00
|
|
|
board.registerNewTeam(rank.Name).setPrefix(rank.GetTag(true, true) + ChatColor.RESET + " ");
|
2013-09-23 22:30:40 +02:00
|
|
|
else
|
|
|
|
board.registerNewTeam(rank.Name).setPrefix("");
|
2013-09-10 02:17:55 +02:00
|
|
|
}
|
2013-09-23 22:30:40 +02:00
|
|
|
|
|
|
|
for (Player otherPlayer : Bukkit.getOnlinePlayers())
|
2013-09-10 02:17:55 +02:00
|
|
|
{
|
2013-09-23 22:30:40 +02:00
|
|
|
String rankName = _clientManager.Get(player).GetRank().Name;
|
|
|
|
String otherRankName = _clientManager.Get(otherPlayer).GetRank().Name;
|
|
|
|
|
|
|
|
if (!_clientManager.Get(player).GetRank().Has(Rank.ULTRA) && _donationManager.Get(player.getName()).OwnsUltraPackage())
|
|
|
|
{
|
|
|
|
rankName = Rank.ULTRA.Name;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!_clientManager.Get(otherPlayer).GetRank().Has(Rank.ULTRA) && _donationManager.Get(otherPlayer.getName()).OwnsUltraPackage())
|
|
|
|
{
|
|
|
|
otherRankName = Rank.ULTRA.Name;
|
|
|
|
}
|
|
|
|
|
|
|
|
//Add Other to Self
|
|
|
|
board.getTeam(otherRankName).addPlayer(otherPlayer);
|
|
|
|
|
|
|
|
//Add Self to Other
|
|
|
|
otherPlayer.getScoreboard().getTeam(rankName).addPlayer(player);
|
2013-09-10 02:17:55 +02:00
|
|
|
}
|
2014-04-11 02:15:44 +02:00
|
|
|
|
2013-09-23 22:30:40 +02:00
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
System.out.println("[HubManager] Player Join exception");
|
|
|
|
throw ex;
|
2013-08-27 17:14:08 +02:00
|
|
|
}
|
2013-10-13 05:31:43 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
if (Bukkit.getOnlinePlayers().length == 1)
|
|
|
|
{
|
|
|
|
new Dragon(this).Spawn();
|
|
|
|
}
|
|
|
|
*/
|
2013-08-27 17:14:08 +02:00
|
|
|
}
|
2013-12-14 06:38:16 +01:00
|
|
|
|
2013-12-17 01:06:04 +01:00
|
|
|
/* XXX TOURNEY
|
2013-12-14 06:38:16 +01:00
|
|
|
@EventHandler(priority = EventPriority.HIGHEST)
|
|
|
|
public void TournamentWins(PlayerJoinEvent event)
|
|
|
|
{
|
|
|
|
for (Player player : Bukkit.getOnlinePlayers())
|
|
|
|
{
|
|
|
|
Scoreboard board = player.getScoreboard();
|
|
|
|
if (board == null)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
Objective obj = board.getObjective(DisplaySlot.BELOW_NAME);
|
|
|
|
if (obj == null)
|
|
|
|
{
|
2013-12-14 06:51:08 +01:00
|
|
|
obj = board.registerNewObjective("SG Tourney Kills", "dummy");
|
2013-12-14 06:38:16 +01:00
|
|
|
obj.setDisplaySlot(DisplaySlot.BELOW_NAME);
|
|
|
|
}
|
|
|
|
|
2013-12-14 06:51:08 +01:00
|
|
|
obj.getScore(event.getPlayer()).setScore(GetStats().getStat(event.getPlayer(), "Pvp", "Kills"));
|
2013-12-14 06:38:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (event.getPlayer().getScoreboard() != null)
|
|
|
|
{
|
|
|
|
Scoreboard board = event.getPlayer().getScoreboard();
|
|
|
|
|
|
|
|
Objective obj = board.getObjective(DisplaySlot.BELOW_NAME);
|
|
|
|
if (obj == null)
|
|
|
|
{
|
2013-12-14 06:51:08 +01:00
|
|
|
obj = board.registerNewObjective("SG Tournament Kills", "dummy");
|
2013-12-14 06:38:16 +01:00
|
|
|
obj.setDisplaySlot(DisplaySlot.BELOW_NAME);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (Player player : Bukkit.getOnlinePlayers())
|
|
|
|
{
|
|
|
|
if (player.equals(event.getPlayer()))
|
|
|
|
continue;
|
|
|
|
|
2013-12-14 06:51:08 +01:00
|
|
|
obj.getScore(player).setScore(GetStats().getStat(player, "Pvp", "Kills"));
|
2013-12-14 06:38:16 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-12-17 01:06:04 +01:00
|
|
|
*/
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
@EventHandler
|
|
|
|
public void PlayerQuit(PlayerQuitEvent event)
|
|
|
|
{
|
|
|
|
event.setQuitMessage(null);
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
event.getPlayer().leaveVehicle();
|
|
|
|
event.getPlayer().eject();
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
for (Player player : UtilServer.getPlayers())
|
2014-04-25 09:44:14 +02:00
|
|
|
player.getScoreboard().resetScores(event.getPlayer().getName());
|
2013-09-07 06:09:12 +02:00
|
|
|
|
|
|
|
_scoreboards.remove(event.getPlayer());
|
2013-10-26 10:01:26 +02:00
|
|
|
|
|
|
|
_portalTime.remove(event.getPlayer().getName());
|
2013-08-27 17:14:08 +02:00
|
|
|
}
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
@EventHandler
|
|
|
|
public void PlayerChat(AsyncPlayerChatEvent event)
|
|
|
|
{
|
|
|
|
if (event.isCancelled())
|
|
|
|
return;
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
event.setCancelled(true);
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
Player player = event.getPlayer();
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
Rank rank = GetClients().Get(player).GetRank();
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-10-17 09:37:57 +02:00
|
|
|
boolean ownsUltra = _donationManager.Get(player.getName()).OwnsUltraPackage();
|
|
|
|
|
|
|
|
//Rank Prefix
|
2013-08-27 17:14:08 +02:00
|
|
|
String rankStr = "";
|
|
|
|
if (rank != Rank.ALL)
|
2013-11-07 00:18:36 +01:00
|
|
|
rankStr = rank.GetTag(true, true) + " ";
|
2013-10-17 09:37:57 +02:00
|
|
|
|
|
|
|
if (ownsUltra && !rank.Has(Rank.ULTRA))
|
2013-11-07 00:18:36 +01:00
|
|
|
rankStr = Rank.ULTRA.GetTag(true, true) + " ";
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-09-07 06:09:12 +02:00
|
|
|
//Party Chat
|
|
|
|
if (event.getMessage().charAt(0) == '@')
|
|
|
|
{
|
|
|
|
Party party = _partyManager.GetParty(player);
|
|
|
|
if (party != null)
|
|
|
|
{
|
|
|
|
for (String name : party.GetPlayers())
|
|
|
|
{
|
|
|
|
Player other = UtilPlayer.searchExact(name);
|
|
|
|
if (other != null)
|
|
|
|
UtilPlayer.message(other, C.cDPurple + C.Bold + "Party " + C.cWhite + C.Bold + player.getName() + ChatColor.RESET + " " + C.cPurple + event.getMessage().substring(1, event.getMessage().length()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
UtilPlayer.message(player, F.main("Party", "You are not in a Party."));
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
for (Player other : UtilServer.getPlayers())
|
|
|
|
{
|
2013-09-07 06:09:12 +02:00
|
|
|
if (_tutorialManager.InTutorial(other))
|
2013-09-03 02:16:44 +02:00
|
|
|
continue;
|
2013-09-04 23:44:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
UtilPlayer.message(other, rankStr + C.cYellow + player.getName() + " " + C.cWhite + event.getMessage());
|
|
|
|
}
|
|
|
|
}
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
@EventHandler
|
|
|
|
public void Damage(EntityDamageEvent event)
|
|
|
|
{
|
2013-09-02 00:24:37 +02:00
|
|
|
if (event.getCause() == DamageCause.VOID)
|
|
|
|
if (event.getEntity() instanceof Player)
|
2013-09-18 11:46:45 +02:00
|
|
|
{
|
|
|
|
event.getEntity().eject();
|
|
|
|
event.getEntity().leaveVehicle();
|
2013-09-02 00:24:37 +02:00
|
|
|
event.getEntity().teleport(GetSpawn());
|
2013-09-18 11:46:45 +02:00
|
|
|
}
|
|
|
|
|
2013-09-02 00:24:37 +02:00
|
|
|
else
|
|
|
|
event.getEntity().remove();
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
event.setCancelled(true);
|
|
|
|
}
|
2013-09-01 00:34:53 +02:00
|
|
|
|
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
@EventHandler
|
|
|
|
public void FoodHealthUpdate(UpdateEvent event)
|
|
|
|
{
|
|
|
|
if (event.getType() != UpdateType.SLOW)
|
|
|
|
return;
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
for (Player player : UtilServer.getPlayers())
|
|
|
|
{
|
|
|
|
player.setHealth(20);
|
|
|
|
player.setFoodLevel(20);
|
|
|
|
}
|
|
|
|
}
|
2014-04-05 07:52:23 +02:00
|
|
|
|
2013-10-25 10:20:14 +02:00
|
|
|
@EventHandler
|
|
|
|
public void InventoryCancel(InventoryClickEvent event)
|
|
|
|
{
|
2013-11-22 23:17:00 +01:00
|
|
|
if (event.getWhoClicked() instanceof Player && ((Player)event.getWhoClicked()).getGameMode() != GameMode.CREATIVE)
|
|
|
|
event.setCancelled(true);
|
2013-10-25 10:20:14 +02:00
|
|
|
}
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
@EventHandler
|
|
|
|
public void UpdateScoreboard(UpdateEvent event)
|
|
|
|
{
|
|
|
|
if (event.getType() != UpdateType.TICK)
|
|
|
|
return;
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
_scoreboardTick = (_scoreboardTick + 1)%3;
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
if (_scoreboardTick != 0)
|
|
|
|
return;
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
int bestPig = 0;
|
|
|
|
for (Player player : UtilServer.getPlayers())
|
|
|
|
{
|
|
|
|
if (player.getVehicle() != null)
|
|
|
|
continue;
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
int count = 0;
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
Entity ent = player;
|
|
|
|
while (ent.getPassenger() != null)
|
|
|
|
{
|
|
|
|
ent = ent.getPassenger();
|
|
|
|
count++;
|
|
|
|
}
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
if (count > bestPig)
|
|
|
|
{
|
|
|
|
_pigStacker = player.getName();
|
|
|
|
bestPig = count;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (bestPig == 0)
|
|
|
|
{
|
|
|
|
_pigStacker = "0 - Nobody";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
_pigStacker = bestPig + " - " + _pigStacker;
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
if (_pigStacker.length() > 16)
|
|
|
|
_pigStacker = _pigStacker.substring(0, 16);
|
|
|
|
}
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
for (Player player : UtilServer.getPlayers())
|
|
|
|
{
|
2013-09-07 06:09:12 +02:00
|
|
|
//Dont Waste Time
|
|
|
|
if (_partyManager.GetParty(player) != null)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
//Return to Main Scoreboard
|
|
|
|
if (!player.getScoreboard().equals(_scoreboards.get(player)))
|
|
|
|
player.setScoreboard(_scoreboards.get(player));
|
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
//Objective
|
|
|
|
Objective obj = player.getScoreboard().getObjective(DisplaySlot.SIDEBAR);
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
//Title
|
|
|
|
obj.setDisplayName(C.cWhite + C.Bold + Get(player).GetScoreboardText());
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
int line = 15;
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2014-04-25 09:44:14 +02:00
|
|
|
obj.getScore(C.cGreen + C.Bold + "Gems").setScore(line--);
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
// Remove Old
|
2014-04-25 09:44:14 +02:00
|
|
|
player.getScoreboard().resetScores(Get(player.getName()).GetLastGemCount() + "");
|
2013-08-27 17:14:08 +02:00
|
|
|
// Add New
|
2014-04-25 09:44:14 +02:00
|
|
|
obj.getScore(GetDonation().Get(player.getName()).GetGems() + "").setScore(line--);
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
Get(player.getName()).SetLastGemCount(GetDonation().Get(player.getName()).GetGems());
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
//Space
|
2014-04-25 09:44:14 +02:00
|
|
|
obj.getScore(" ").setScore(line--);
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
/*
|
|
|
|
//News
|
2014-04-25 09:44:14 +02:00
|
|
|
obj.getScore(C.cGray + C.Bold + "Latest News")).setScore(line--);
|
|
|
|
player.getScoreboard().resetScores(Get(player).GetNewsText(false)));
|
|
|
|
obj.getScore(Get(player).GetNewsText(true))).setScore(line--);
|
2013-09-01 00:34:53 +02:00
|
|
|
*/
|
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
//Stacker
|
2014-04-25 09:44:14 +02:00
|
|
|
obj.getScore(C.cGray + C.Bold + "Stacker").setScore(line--);
|
|
|
|
player.getScoreboard().resetScores(Get(player).BestPig);
|
2013-08-27 17:14:08 +02:00
|
|
|
Get(player).BestPig = _pigStacker;
|
2014-04-25 09:44:14 +02:00
|
|
|
obj.getScore(Get(player).BestPig).setScore(line--);
|
2013-08-27 17:14:08 +02:00
|
|
|
|
|
|
|
//Space
|
2014-04-25 09:44:14 +02:00
|
|
|
obj.getScore(" ").setScore(line--);
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
//Display Rank
|
2014-04-05 07:52:23 +02:00
|
|
|
if (GetClients().Get(player).GetRank().Has(Rank.HERO))
|
|
|
|
{
|
2014-04-25 09:44:14 +02:00
|
|
|
obj.getScore(C.cPurple + C.Bold + "Hero Rank").setScore(line--);
|
2014-04-05 07:52:23 +02:00
|
|
|
|
2014-04-25 09:44:14 +02:00
|
|
|
player.getScoreboard().resetScores(Get(player).GetUltraText(false));
|
|
|
|
obj.getScore(Get(player).GetUltraText(true)).setScore(line--);
|
2014-04-05 07:52:23 +02:00
|
|
|
}
|
|
|
|
else if (GetClients().Get(player).GetRank().Has(Rank.ULTRA))
|
2013-08-27 17:14:08 +02:00
|
|
|
{
|
2014-04-25 09:44:14 +02:00
|
|
|
obj.getScore(C.cAqua + C.Bold + "Ultra Rank").setScore(line--);
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2014-04-25 09:44:14 +02:00
|
|
|
player.getScoreboard().resetScores(Get(player).GetUltraText(false));
|
|
|
|
obj.getScore(Get(player).GetUltraText(true)).setScore(line--);
|
2013-08-27 17:14:08 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-04-25 09:44:14 +02:00
|
|
|
obj.getScore(C.cRed + C.Bold + "No Rank").setScore(line--);
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2014-04-25 09:44:14 +02:00
|
|
|
player.getScoreboard().resetScores(Get(player).GetPurchaseText(false));
|
|
|
|
obj.getScore(Get(player).GetPurchaseText(true)).setScore(line--);
|
2013-08-27 17:14:08 +02:00
|
|
|
}
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
//Space
|
2014-04-25 09:44:14 +02:00
|
|
|
obj.getScore(" ").setScore(line--);
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
//Display Staff
|
2014-04-25 09:44:14 +02:00
|
|
|
obj.getScore(C.cGold + C.Bold + "Online Staff").setScore(line--);
|
2013-08-27 17:14:08 +02:00
|
|
|
String staff = "";
|
|
|
|
for (Player other : UtilServer.getPlayers())
|
|
|
|
{
|
|
|
|
Rank rank = GetClients().Get(other).GetRank();
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
if (!rank.Has(Rank.HELPER))
|
|
|
|
continue;
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
staff += other.getName() + " ";
|
|
|
|
}
|
|
|
|
if (staff.length() == 0)
|
|
|
|
staff = "None";
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2014-04-25 09:44:14 +02:00
|
|
|
player.getScoreboard().resetScores(Get(player).GetStaffText(false));
|
2013-08-27 17:14:08 +02:00
|
|
|
Get(player).StaffString = staff;
|
2014-04-25 09:44:14 +02:00
|
|
|
obj.getScore(Get(player).GetStaffText(true)).setScore(line--);
|
2013-08-27 17:14:08 +02:00
|
|
|
|
|
|
|
//Space
|
2014-04-25 09:44:14 +02:00
|
|
|
obj.getScore(" ").setScore(line--);
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
//Website
|
2014-04-25 09:44:14 +02:00
|
|
|
obj.getScore(C.cYellow + C.Bold + "Website").setScore(line--);
|
|
|
|
obj.getScore("www.mineplex.com").setScore(line--);
|
|
|
|
obj.getScore("----------------").setScore(line--);
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
}
|
|
|
|
}
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
@Override
|
|
|
|
protected HubClient AddPlayer(String player)
|
|
|
|
{
|
|
|
|
return new HubClient(player);
|
|
|
|
}
|
2013-10-22 06:46:31 +02:00
|
|
|
|
|
|
|
public BlockRestore GetBlockRestore()
|
|
|
|
{
|
|
|
|
return _blockRestore;
|
|
|
|
}
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
public CoreClientManager GetClients()
|
|
|
|
{
|
|
|
|
return _clientManager;
|
|
|
|
}
|
2013-10-19 07:52:15 +02:00
|
|
|
|
|
|
|
public ConditionManager GetCondition()
|
|
|
|
{
|
|
|
|
return _conditionManager;
|
|
|
|
}
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
public DonationManager GetDonation()
|
|
|
|
{
|
|
|
|
return _donationManager;
|
|
|
|
}
|
2013-09-18 11:46:45 +02:00
|
|
|
|
2013-10-25 10:20:14 +02:00
|
|
|
public DisguiseManager GetDisguise()
|
|
|
|
{
|
|
|
|
return _disguiseManager;
|
|
|
|
}
|
|
|
|
|
2013-12-21 10:05:42 +01:00
|
|
|
public GadgetManager GetGadget()
|
|
|
|
{
|
|
|
|
return _gadgetManager;
|
|
|
|
}
|
|
|
|
|
|
|
|
public MountManager GetMount()
|
|
|
|
{
|
|
|
|
return _mountManager;
|
|
|
|
}
|
|
|
|
|
2013-09-18 11:46:45 +02:00
|
|
|
public ParkourManager GetParkour()
|
|
|
|
{
|
|
|
|
return _parkour;
|
|
|
|
}
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-08-31 10:19:23 +02:00
|
|
|
public Location GetSpawn()
|
2013-08-27 17:14:08 +02:00
|
|
|
{
|
2013-08-31 10:19:23 +02:00
|
|
|
return _spawn.clone();
|
2013-08-27 17:14:08 +02:00
|
|
|
}
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-10-25 10:20:14 +02:00
|
|
|
public TutorialManager GetTutorial()
|
2013-08-27 17:14:08 +02:00
|
|
|
{
|
2013-10-25 10:20:14 +02:00
|
|
|
return _tutorialManager;
|
|
|
|
}
|
2013-12-14 06:38:16 +01:00
|
|
|
|
|
|
|
public StatsManager GetStats()
|
|
|
|
{
|
|
|
|
return _statsManager;
|
|
|
|
}
|
2013-09-01 00:34:53 +02:00
|
|
|
|
2013-10-25 10:20:14 +02:00
|
|
|
public VisibilityManager GetVisibility()
|
|
|
|
{
|
|
|
|
return _visibilityManager;
|
2013-08-31 10:19:23 +02:00
|
|
|
}
|
2013-10-29 00:41:53 +01:00
|
|
|
|
|
|
|
public void SetPortalDelay(Entity ent)
|
|
|
|
{
|
|
|
|
if (ent instanceof Player)
|
|
|
|
_portalTime.put(((Player)ent).getName(), System.currentTimeMillis());
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean CanPortal(Player player)
|
|
|
|
{
|
|
|
|
//Riding
|
2013-12-23 10:16:53 +01:00
|
|
|
if (player.getVehicle() != null || player.getPassenger() != null)
|
2013-10-29 00:41:53 +01:00
|
|
|
return false;
|
|
|
|
|
|
|
|
//Portal Delay
|
|
|
|
if (!_portalTime.containsKey(player.getName()))
|
|
|
|
return true;
|
|
|
|
|
|
|
|
return UtilTime.elapsed(_portalTime.get(player.getName()), 5000);
|
|
|
|
}
|
2013-10-25 13:56:28 +02:00
|
|
|
|
|
|
|
@EventHandler
|
|
|
|
public void HeartDisplay(UpdateEvent event)
|
|
|
|
{
|
|
|
|
if (event.getType() != UpdateType.FASTER)
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (Player player : UtilServer.getPlayers())
|
|
|
|
{
|
2013-10-29 00:41:53 +01:00
|
|
|
if (!player.isOp() && !player.getName().equals("MonsieurApple"))
|
2013-10-25 13:56:28 +02:00
|
|
|
continue;
|
|
|
|
|
|
|
|
for (Player other : UtilServer.getPlayers())
|
|
|
|
{
|
|
|
|
if (player.getName().equalsIgnoreCase("Chiss"))
|
|
|
|
UtilParticle.PlayParticle(other, ParticleType.HEART, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 1);
|
|
|
|
|
|
|
|
else if (player.getName().equalsIgnoreCase("defek7"))
|
2013-10-27 05:24:28 +01:00
|
|
|
UtilParticle.PlayParticle(other, ParticleType.FIREWORKS_SPARK, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 2);
|
2013-10-25 13:56:28 +02:00
|
|
|
|
|
|
|
else if (player.getName().equalsIgnoreCase("Spu_"))
|
2013-10-27 05:24:28 +01:00
|
|
|
UtilParticle.PlayParticle(other, ParticleType.FLAME, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 2);
|
2013-10-25 13:56:28 +02:00
|
|
|
|
|
|
|
else if (player.getName().equalsIgnoreCase("sterling_"))
|
|
|
|
UtilParticle.PlayParticle(other, ParticleType.WITCH_MAGIC, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 2);
|
2013-10-29 00:41:53 +01:00
|
|
|
|
|
|
|
else if (player.getName().equalsIgnoreCase("MonsieurApple"))
|
|
|
|
UtilParticle.PlayParticle(other, ParticleType.SPLASH, player.getLocation().add(0, 1, 0), 0.25f, 0.5f, 0.25f, 0, 10);
|
2013-10-25 13:56:28 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-08-27 17:14:08 +02:00
|
|
|
}
|