Actually check if its a hub and start the hologram

This commit is contained in:
LCastr0 2017-04-26 01:26:01 -03:00
parent 19138eb501
commit 9796b5acba
1 changed files with 13 additions and 0 deletions

View File

@ -82,6 +82,9 @@ public class CastleManager extends MiniPlugin
@EventHandler
public void onEntitySpawn(EntitySpawnEvent event)
{
if (!isHub())
return;
if (event.getEntity() instanceof Player)
return;
@ -98,6 +101,9 @@ public class CastleManager extends MiniPlugin
@EventHandler
public void onPlayerMove(PlayerMoveEvent event)
{
if (!isHub())
return;
Player player = event.getPlayer();
if (_king != null)
@ -133,6 +139,9 @@ public class CastleManager extends MiniPlugin
@EventHandler
public void onUpdateKing(UpdateKingEvent event)
{
if (!isHub())
return;
King oldKing = event.getOldKing();
King newKing = event.getNewKing();
if (oldKing != null && oldKing.getKing().isOnline())
@ -153,7 +162,11 @@ public class CastleManager extends MiniPlugin
*/
private void spawnHologram()
{
if (!isHub())
return;
_hologram = new Hologram(_hologramManager, _hologramLocation, "Mineplex Castle", "Current King: " + F.name("No one") + "!");
_hologram.start();
}
/**