Actually check if its a hub and start the hologram
This commit is contained in:
parent
19138eb501
commit
9796b5acba
@ -82,6 +82,9 @@ public class CastleManager extends MiniPlugin
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onEntitySpawn(EntitySpawnEvent event)
|
public void onEntitySpawn(EntitySpawnEvent event)
|
||||||
{
|
{
|
||||||
|
if (!isHub())
|
||||||
|
return;
|
||||||
|
|
||||||
if (event.getEntity() instanceof Player)
|
if (event.getEntity() instanceof Player)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -98,6 +101,9 @@ public class CastleManager extends MiniPlugin
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerMove(PlayerMoveEvent event)
|
public void onPlayerMove(PlayerMoveEvent event)
|
||||||
{
|
{
|
||||||
|
if (!isHub())
|
||||||
|
return;
|
||||||
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
if (_king != null)
|
if (_king != null)
|
||||||
@ -133,6 +139,9 @@ public class CastleManager extends MiniPlugin
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onUpdateKing(UpdateKingEvent event)
|
public void onUpdateKing(UpdateKingEvent event)
|
||||||
{
|
{
|
||||||
|
if (!isHub())
|
||||||
|
return;
|
||||||
|
|
||||||
King oldKing = event.getOldKing();
|
King oldKing = event.getOldKing();
|
||||||
King newKing = event.getNewKing();
|
King newKing = event.getNewKing();
|
||||||
if (oldKing != null && oldKing.getKing().isOnline())
|
if (oldKing != null && oldKing.getKing().isOnline())
|
||||||
@ -153,7 +162,11 @@ public class CastleManager extends MiniPlugin
|
|||||||
*/
|
*/
|
||||||
private void spawnHologram()
|
private void spawnHologram()
|
||||||
{
|
{
|
||||||
|
if (!isHub())
|
||||||
|
return;
|
||||||
|
|
||||||
_hologram = new Hologram(_hologramManager, _hologramLocation, "Mineplex Castle", "Current King: " + F.name("No one") + "!");
|
_hologram = new Hologram(_hologramManager, _hologramLocation, "Mineplex Castle", "Current King: " + F.name("No one") + "!");
|
||||||
|
_hologram.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user