Use IncognitoStatusChangeEvent for vanish fixes in BLD
This commit is contained in:
parent
449c6511e2
commit
d70f7a8ec0
@ -11,7 +11,7 @@ import java.util.UUID;
|
|||||||
|
|
||||||
import mineplex.core.account.permissions.Permission;
|
import mineplex.core.account.permissions.Permission;
|
||||||
import mineplex.core.account.permissions.PermissionGroup;
|
import mineplex.core.account.permissions.PermissionGroup;
|
||||||
import org.bukkit.Bukkit;
|
import mineplex.core.incognito.events.IncognitoStatusChangeEvent;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Effect;
|
import org.bukkit.Effect;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
@ -537,7 +537,7 @@ public class Build extends Game
|
|||||||
//Get Next View Data
|
//Get Next View Data
|
||||||
for (BuildData data : _data.values())
|
for (BuildData data : _data.values())
|
||||||
{
|
{
|
||||||
if (!data.Judged && !Manager.isVanished(data.Player))
|
if (!data.Judged)
|
||||||
{
|
{
|
||||||
_viewData = data;
|
_viewData = data;
|
||||||
break;
|
break;
|
||||||
@ -615,10 +615,6 @@ public class Build extends Game
|
|||||||
|
|
||||||
for (Player player : _data.keySet())
|
for (Player player : _data.keySet())
|
||||||
{
|
{
|
||||||
if (Manager.isVanished(player)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
double points = _data.get(player).getPoints();
|
double points = _data.get(player).getPoints();
|
||||||
|
|
||||||
if (bestPlayer == null || points > bestPoints)
|
if (bestPlayer == null || points > bestPoints)
|
||||||
@ -1669,6 +1665,23 @@ public class Build extends Game
|
|||||||
return GetTeamList().get(0).GetSpawn();
|
return GetTeamList().get(0).GetSpawn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onVanishEnable(IncognitoStatusChangeEvent event) {
|
||||||
|
// If user is leaving vanish, ignore it
|
||||||
|
if (!event.getNewState())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If they're not in the data map, don't bother
|
||||||
|
if (!_data.containsKey(event.getPlayer()))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_data.remove(event.getPlayer());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Player> getWinners()
|
public List<Player> getWinners()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user