Add fix for new game lobbies

This commit is contained in:
Sarah 2017-06-02 03:41:06 +02:00
parent 4b54232514
commit 73897e407b
7 changed files with 39 additions and 7 deletions

View File

@ -1261,4 +1261,9 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
{ {
_carlLocation = carlLocation; _carlLocation = carlLocation;
} }
public Npc getCarl()
{
return _carlNpc;
}
} }

View File

@ -11,6 +11,7 @@ import java.util.function.Consumer;
import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.ChatColor;
import org.apache.commons.lang3.tuple.Triple; import org.apache.commons.lang3.tuple.Triple;
import org.bukkit.Location;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.entity.Slime; import org.bukkit.entity.Slime;
@ -78,7 +79,7 @@ public class QuestManager extends MiniClientPlugin<QuestClientData>
private HologramManager _hologramManager; private HologramManager _hologramManager;
private boolean _visualTick; private boolean _visualTick;
public QuestManager(HologramManager hologramManager, InventoryManager inventoryManager, DonationManager donationManager) public QuestManager(HologramManager hologramManager, Location npc, InventoryManager inventoryManager, DonationManager donationManager)
{ {
super("Quest Manager"); super("Quest Manager");
@ -101,6 +102,10 @@ public class QuestManager extends MiniClientPlugin<QuestClientData>
{ {
Slime slime = (Slime) _questNPC.getEntity(); Slime slime = (Slime) _questNPC.getEntity();
slime.setSize(3); slime.setSize(3);
if (npc != null)
{
_questNPC.setLocation(npc);
}
_enableNPC = true; _enableNPC = true;
} }
} }

View File

@ -294,7 +294,7 @@ public class HubManager extends MiniClientPlugin<HubClient> implements IChatMess
new EasterEggHunt(plugin, _clientManager); new EasterEggHunt(plugin, _clientManager);
_questManager = new QuestManager(hologramManager, _inventoryManager, _donationManager); _questManager = new QuestManager(hologramManager, null, _inventoryManager, _donationManager);
new TemporaryGemHuntersServerSender(_portal); new TemporaryGemHuntersServerSender(_portal);

View File

@ -391,7 +391,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
_kitProgressionManager = new KitProgressionManager(getPlugin(), donationManager, clientManager); _kitProgressionManager = new KitProgressionManager(getPlugin(), donationManager, clientManager);
_progressionKitManager = new ProgressingKitManager(this); _progressionKitManager = new ProgressingKitManager(this);
_serverUptimeManager = new ServerUptimeManager(this); _serverUptimeManager = new ServerUptimeManager(this);
_questManager = new QuestManager(hologramManager, _inventoryManager, _donationManager); _questManager = new QuestManager(hologramManager, _gameLobbyManager.getMissions(), _inventoryManager, _donationManager);
if (GetHost() != null && !GetHost().isEmpty() && !GetHost().startsWith("COM-")) if (GetHost() != null && !GetHost().isEmpty() && !GetHost().startsWith("COM-"))
{ {

View File

@ -83,12 +83,13 @@ public abstract class LobbyManager implements Listener
private Location _kitText; private Location _kitText;
private Location _teamText; private Location _teamText;
private Location _carl; private Location _carl;
private Location _missions;
private Location _spawn; private Location _spawn;
private Location _ampStand; private Location _ampStand;
private boolean _colorTick = false; private boolean _colorTick = false;
private boolean _generatePodiums = false; private boolean _generatePodiums = false;
public LobbyManager(ArcadeManager manager, Location carl, Location spawn, Location ampStand) public LobbyManager(ArcadeManager manager, Location missions, Location carl, Location spawn, Location ampStand)
{ {
_manager = manager; _manager = manager;
@ -892,4 +893,14 @@ public abstract class LobbyManager implements Listener
{ {
return _generatePodiums; return _generatePodiums;
} }
public Location getMissions()
{
return _missions;
}
public void setMissions(Location loc)
{
_missions = loc;
}
} }

View File

@ -58,6 +58,7 @@ public class NewGameLobbyManager extends LobbyManager
public enum DataLoc public enum DataLoc
{ {
CARL, CARL,
MISSIONS,
AMP, AMP,
SPAWN,; SPAWN,;
} }
@ -70,7 +71,7 @@ public class NewGameLobbyManager extends LobbyManager
public NewGameLobbyManager(ArcadeManager manager) public NewGameLobbyManager(ArcadeManager manager)
{ {
super(manager, null, null, null); super(manager, null, null, null, null);
_run = CONFIG.exists(); _run = CONFIG.exists();
if (_run) if (_run)
@ -519,7 +520,7 @@ public class NewGameLobbyManager extends LobbyManager
continue; continue;
} }
if (!lastName.equalsIgnoreCase("SPAWN") || lastName.equalsIgnoreCase("CARL")) if (!lastName.equalsIgnoreCase("SPAWN") || lastName.equalsIgnoreCase("CARL") || lastName.equalsIgnoreCase("MISSIONS"))
{ {
loc.subtract(0, 0.5, 0); loc.subtract(0, 0.5, 0);
} }
@ -558,6 +559,16 @@ public class NewGameLobbyManager extends LobbyManager
setCarl(carl); setCarl(carl);
} }
Location missions = _singleLocs.get(DataLoc.MISSIONS.name());
if (missions != null)
{
missions.add(0, 0.5, 0);
float yaw = UtilAlg.GetYaw(UtilAlg.getTrajectory2d(missions, getSpawn()));
missions.setYaw(yaw);
setMissions(missions);
}
Location amp = _singleLocs.get(DataLoc.AMP.name()); Location amp = _singleLocs.get(DataLoc.AMP.name());
if (amp != null) if (amp != null)
{ {

View File

@ -39,7 +39,7 @@ public class LegacyGameLobbyManager extends LobbyManager
public LegacyGameLobbyManager(ArcadeManager manager) public LegacyGameLobbyManager(ArcadeManager manager)
{ {
super(manager, null, null, new Location(UtilWorld.getWorld("world"), 0, 102.5, -15)); super(manager, null, null, null, new Location(UtilWorld.getWorld("world"), 0, 102.5, -15));
setSpawn(new Location(WORLD, 0, 104, 0, 0, 0)); setSpawn(new Location(WORLD, 0, 104, 0, 0, 0));