mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-26 14:54:12 -04:00
Only resend default texture pack when the url changes, thus meaning we can now avoid the full map refresh for the ClassicalSharp dev builds.
This commit is contained in:
parent
2b96cc8445
commit
98482bebc5
@ -177,9 +177,9 @@ namespace MCGalaxy
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateModels() {
|
public void UpdateModels() {
|
||||||
Player[] players = PlayerInfo.Online.Items;
|
Player[] players = PlayerInfo.Online.Items;
|
||||||
foreach (Player p in players) {
|
foreach (Player p in players) {
|
||||||
if (p.level != level) continue;
|
if (p.level != level) continue;
|
||||||
if (p == this) {
|
if (p == this) {
|
||||||
if (model != "humanoid") SendChangeModel(0xFF, model);
|
if (model != "humanoid") SendChangeModel(0xFF, model);
|
||||||
continue;
|
continue;
|
||||||
@ -197,22 +197,24 @@ namespace MCGalaxy
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string lastUrl = "";
|
||||||
public void SendCurrentMapAppearance() {
|
public void SendCurrentMapAppearance() {
|
||||||
byte edgeBlock = level.EdgeBlock, horBlock = level.HorizonBlock;
|
byte edgeBlock = level.EdgeBlock, horBlock = level.HorizonBlock;
|
||||||
if (edgeBlock >= Block.CpeCount && !hasBlockDefs)
|
if (edgeBlock >= Block.CpeCount && !hasBlockDefs)
|
||||||
edgeBlock = level.GetFallback(edgeBlock);
|
edgeBlock = level.GetFallback(edgeBlock);
|
||||||
if (horBlock >= Block.CpeCount && !hasBlockDefs)
|
if (horBlock >= Block.CpeCount && !hasBlockDefs)
|
||||||
horBlock = level.GetFallback(horBlock);
|
horBlock = level.GetFallback(horBlock);
|
||||||
|
|
||||||
if (EnvMapAppearance == 2) {
|
if (EnvMapAppearance == 2) {
|
||||||
string url = level.texturePackUrl == "" ? level.terrainUrl : level.texturePackUrl;
|
string url = level.texturePackUrl == "" ? level.terrainUrl : level.texturePackUrl;
|
||||||
if (url == "")
|
if (url == "")
|
||||||
url = Server.defaultTexturePackUrl == "" ? Server.defaultTerrainUrl : Server.defaultTexturePackUrl;
|
url = Server.defaultTexturePackUrl == "" ? Server.defaultTerrainUrl : Server.defaultTexturePackUrl;
|
||||||
|
|
||||||
// reset all other textures back to client default.
|
// reset all other textures back to client default.
|
||||||
SendSetMapAppearanceV2("", edgeBlock, horBlock, level.EdgeLevel, level.CloudsHeight, level.MaxFogDistance);
|
if (url != lastUrl)
|
||||||
if (url != "")
|
SendSetMapAppearanceV2("", edgeBlock, horBlock, level.EdgeLevel, level.CloudsHeight, level.MaxFogDistance);
|
||||||
SendSetMapAppearanceV2(url, edgeBlock, horBlock, level.EdgeLevel, level.CloudsHeight, level.MaxFogDistance);
|
SendSetMapAppearanceV2(url, edgeBlock, horBlock, level.EdgeLevel, level.CloudsHeight, level.MaxFogDistance);
|
||||||
|
lastUrl = url;
|
||||||
} else {
|
} else {
|
||||||
string url = level.terrainUrl == "" ? Server.defaultTerrainUrl : level.terrainUrl;
|
string url = level.terrainUrl == "" ? Server.defaultTerrainUrl : level.terrainUrl;
|
||||||
SendSetMapAppearance(url, edgeBlock, horBlock, level.EdgeLevel);
|
SendSetMapAppearance(url, edgeBlock, horBlock, level.EdgeLevel);
|
||||||
@ -276,8 +278,8 @@ namespace MCGalaxy
|
|||||||
}
|
}
|
||||||
|
|
||||||
public enum CpeMessageType : byte {
|
public enum CpeMessageType : byte {
|
||||||
Normal = 0, Status1 = 1, Status2 = 2, Status3 = 3,
|
Normal = 0, Status1 = 1, Status2 = 2, Status3 = 3,
|
||||||
BottomRight1 = 11, BottomRight2 = 12, BottomRight3 = 13,
|
BottomRight1 = 11, BottomRight2 = 12, BottomRight3 = 13,
|
||||||
Announcement = 100,
|
Announcement = 100,
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user