mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-24 05:03:34 -04:00
Fix joining museums after joining a world not causing world to auto-unload, partially addresses #316
This commit is contained in:
parent
bfd4042f84
commit
1c3992cbb0
@ -63,18 +63,9 @@ namespace MCGalaxy.Commands.World {
|
||||
lvl.MapName = mapName;
|
||||
SetLevelProps(lvl);
|
||||
Level.LoadMetadata(lvl);
|
||||
if (!lvl.CanJoin(p)) return;
|
||||
|
||||
p.Loading = true;
|
||||
Entities.DespawnEntities(p);
|
||||
Level oldLevel = p.level;
|
||||
p.level = lvl;
|
||||
if (!p.SendRawMap(oldLevel, lvl)) return;
|
||||
|
||||
Entities.GlobalSpawn(p, lvl.SpawnPos, lvl.SpawnRot, true);
|
||||
if (!PlayerActions.ChangeMap(p, lvl)) return;
|
||||
p.ClearBlockchange();
|
||||
|
||||
Chat.MessageGlobal(p, p.ColoredName + " %Swent to the " + lvl.name, false, true);
|
||||
}
|
||||
|
||||
static void SetLevelProps(Level lvl) {
|
||||
|
@ -112,7 +112,8 @@ namespace MCGalaxy {
|
||||
CheckGamesJoin(p, oldLevel);
|
||||
|
||||
if (p.level.ShouldShowJoinMessage(oldLevel)) {
|
||||
Chat.MessageGlobal(p, p.ColoredName + " %Swent to " + lvl.ColoredName, false, true);
|
||||
string msg = p.level.IsMuseum ? "%Swent to the " : "%Swent to ";
|
||||
Chat.MessageGlobal(p, p.ColoredName + " %Swent " + lvl.ColoredName, false, true);
|
||||
Player.RaisePlayerAction(p, PlayerAction.JoinWorld, lvl.name);
|
||||
}
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user