Fix sending BlockPermissions packet when changing rank, even if client doesn't indicate support for it

This commit is contained in:
UnknownShadow200 2017-07-07 19:51:03 +10:00
parent f10952091e
commit b791a24673
3 changed files with 3 additions and 3 deletions

View File

@ -54,8 +54,7 @@ namespace MCGalaxy.Core {
if (p.HasCpeExt(CpeExt.EnvColors))
p.SendCurrentEnvColors();
p.SendCurrentMapAppearance();
if (p.HasCpeExt(CpeExt.BlockPermissions))
p.SendCurrentBlockPermissions();
p.SendCurrentBlockPermissions();
if (!level.Config.Guns && p.aiming) {
p.aiming = false;

View File

@ -428,7 +428,6 @@ namespace MCGalaxy {
Player[] players = PlayerInfo.Online.Items;
foreach (Player p in players) {
if (p.level != this) continue;
if (!p.HasCpeExt(CpeExt.BlockPermissions)) continue;
p.SendCurrentBlockPermissions();
}
}

View File

@ -202,6 +202,8 @@ namespace MCGalaxy {
}
public void SendCurrentBlockPermissions() {
if (!HasCpeExt(CpeExt.BlockPermissions)) return;
// Write the block permissions as one bulk TCP packet
int count = NumBlockPermissions();
byte[] bulk = new byte[4 * count];