Fixed issues that came up when I ran through the update
This commit is contained in:
parent
31fa194b7f
commit
0f749f7794
@ -73,7 +73,7 @@ public class HubPlayerManager extends MiniPlugin
|
||||
float levelPercentage = (float) data.getExpRemainder() / data.getExpNextLevel();
|
||||
|
||||
player.setLevel(data.getLevel());
|
||||
player.setExp(Math.min(0, Math.max(0.999F, levelPercentage)));
|
||||
player.setExp(Math.max(0, Math.min(0.999F, levelPercentage)));
|
||||
}
|
||||
|
||||
public void giveHotbar(Player player)
|
||||
|
@ -3,6 +3,7 @@ package nautilus.game.arcade.game.games.build;
|
||||
import java.util.AbstractMap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -1728,7 +1729,7 @@ public class Build extends Game
|
||||
@Override
|
||||
public Location GetSpectatorLocation()
|
||||
{
|
||||
return GetTeamList().get(0).GetSpawn();
|
||||
return GetTeamList().get(0).GetSpawns().get(0);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -1740,12 +1741,6 @@ public class Build extends Game
|
||||
return;
|
||||
}
|
||||
|
||||
// If they're not in the data map, don't bother
|
||||
if (!_data.containsKey(event.getPlayer()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_data.remove(event.getPlayer());
|
||||
}
|
||||
|
||||
@ -1758,7 +1753,7 @@ public class Build extends Game
|
||||
return null;
|
||||
}
|
||||
|
||||
return Arrays.asList(player);
|
||||
return Collections.singletonList(player);
|
||||
}
|
||||
|
||||
protected String getNextWord()
|
||||
@ -1831,7 +1826,7 @@ public class Build extends Game
|
||||
@Override
|
||||
public void EndCheck()
|
||||
{
|
||||
if (GetPlayers(true).isEmpty())
|
||||
if (IsLive() && GetPlayers(true).isEmpty())
|
||||
{
|
||||
SetState(GameState.End);
|
||||
}
|
||||
@ -1858,9 +1853,6 @@ public class Build extends Game
|
||||
super.disqualify(player);
|
||||
|
||||
// Remove the player from the map so players don't vote on it
|
||||
if (_data.containsKey(player))
|
||||
{
|
||||
_data.remove(player);
|
||||
}
|
||||
}
|
||||
}
|
@ -3,10 +3,12 @@ package nautilus.game.arcade.game.modules.gamesummary;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import net.md_5.bungee.api.chat.HoverEvent;
|
||||
import net.md_5.bungee.api.chat.HoverEvent.Action;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
|
||||
import mineplex.core.common.jsonchat.HoverEvent;
|
||||
import mineplex.core.common.jsonchat.JsonMessage;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public abstract class GameSummaryComponent<T>
|
||||
{
|
||||
@ -42,14 +44,20 @@ public abstract class GameSummaryComponent<T>
|
||||
return false;
|
||||
}
|
||||
|
||||
StringBuilder hoverTextBuilder = new StringBuilder();
|
||||
BaseComponent[] message = TextComponent.fromLegacyText(mainText);
|
||||
String hoverTextString = String.join("\n", hoverText);
|
||||
|
||||
hoverText.forEach(text -> hoverTextBuilder.append("\n").append(text));
|
||||
if (!hoverTextString.isEmpty())
|
||||
{
|
||||
HoverEvent hoverEvent = new HoverEvent(Action.SHOW_TEXT, TextComponent.fromLegacyText(hoverTextString));
|
||||
|
||||
new JsonMessage(mainText)
|
||||
.hover(HoverEvent.SHOW_TEXT, hoverTextBuilder.toString().substring(1))
|
||||
.sendToPlayer(player);
|
||||
for (BaseComponent component : message)
|
||||
{
|
||||
component.setHoverEvent(hoverEvent);
|
||||
}
|
||||
}
|
||||
|
||||
player.spigot().sendMessage(message);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -288,7 +288,7 @@ public class GameCreationManager implements Listener
|
||||
ModePref = null;
|
||||
|
||||
// No map voting, load the maps now
|
||||
boolean loadMapsNow = !Manager.GetServerConfig().MapVoting;
|
||||
boolean loadMapsNow = !Manager.GetServerConfig().MapVoting || MapPref != null;
|
||||
|
||||
try
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user