From b791a246732d0bf5c28442ddf6528453ee39b24b Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Fri, 7 Jul 2017 19:51:03 +1000 Subject: [PATCH] Fix sending BlockPermissions packet when changing rank, even if client doesn't indicate support for it --- MCGalaxy/CorePlugin/MiscHandlers.cs | 3 +-- MCGalaxy/Levels/Level.cs | 1 - MCGalaxy/Player/Player.CPE.cs | 2 ++ 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MCGalaxy/CorePlugin/MiscHandlers.cs b/MCGalaxy/CorePlugin/MiscHandlers.cs index d48d9f9c8..0f74aac4c 100644 --- a/MCGalaxy/CorePlugin/MiscHandlers.cs +++ b/MCGalaxy/CorePlugin/MiscHandlers.cs @@ -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; diff --git a/MCGalaxy/Levels/Level.cs b/MCGalaxy/Levels/Level.cs index f12543075..f56417a65 100644 --- a/MCGalaxy/Levels/Level.cs +++ b/MCGalaxy/Levels/Level.cs @@ -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(); } } diff --git a/MCGalaxy/Player/Player.CPE.cs b/MCGalaxy/Player/Player.CPE.cs index a1befe825..efa69bf51 100644 --- a/MCGalaxy/Player/Player.CPE.cs +++ b/MCGalaxy/Player/Player.CPE.cs @@ -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];