Respawn holograms since setText doesn't work, and actually send the correct information to the event
This commit is contained in:
parent
56f19ec937
commit
fb03e9adec
@ -175,16 +175,20 @@ public class CastleManager extends MiniPlugin
|
|||||||
*/
|
*/
|
||||||
private void updateHologram()
|
private void updateHologram()
|
||||||
{
|
{
|
||||||
if (_hologram == null)
|
if (_hologram != null)
|
||||||
return;
|
{
|
||||||
|
_hologram.stop();
|
||||||
|
}
|
||||||
|
|
||||||
if (_king != null && _king.getKing().isOnline())
|
if (_king != null && _king.getKing().isOnline())
|
||||||
{
|
{
|
||||||
_hologram.setText("Mineplex Castle", "Current King: " + F.name(_king.getKing().getName()) + "!");
|
_hologram = new Hologram(_hologramManager, _hologramLocation, "Mineplex Castle", "Current King: " + F.name(_king.getKing().getName()) + "!");
|
||||||
|
_hologram.start();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_hologram.setText("Mineplex Castle", "Current King: " + F.name("No one") + "!");
|
_hologram = new Hologram(_hologramManager, _hologramLocation, "Mineplex Castle", "Current King: " + F.name("No one") + "!");
|
||||||
|
_hologram.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,6 +200,9 @@ public class ParticleKing extends ParticleGadget
|
|||||||
{
|
{
|
||||||
if (_kings.size() == 0)
|
if (_kings.size() == 0)
|
||||||
return null;
|
return null;
|
||||||
|
else if (_kings.size() == 1)
|
||||||
|
return _kings.get(0);
|
||||||
|
|
||||||
King lobbyKing = null;
|
King lobbyKing = null;
|
||||||
int peasants = 0;
|
int peasants = 0;
|
||||||
for (King king : _kings)
|
for (King king : _kings)
|
||||||
@ -222,11 +225,11 @@ public class ParticleKing extends ParticleGadget
|
|||||||
{
|
{
|
||||||
if (!king.equals(oldKing))
|
if (!king.equals(oldKing))
|
||||||
{
|
{
|
||||||
Bukkit.getPluginManager().callEvent(new UpdateKingEvent(oldKing, king));
|
Bukkit.getPluginManager().callEvent(new UpdateKingEvent(king, oldKing));
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
Bukkit.getPluginManager().callEvent(new UpdateKingEvent(oldKing, king));
|
Bukkit.getPluginManager().callEvent(new UpdateKingEvent(king, oldKing));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user