mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-08-03 19:36:14 -04:00
Add ToggleBlockList CPE
This commit is contained in:
parent
834adbaf2d
commit
a62118f9da
@ -95,6 +95,7 @@ namespace MCGalaxy
|
||||
public const string LightingMode = "LightingMode";
|
||||
public const string CinematicGui = "CinematicGui";
|
||||
public const string NotifyAction = "NotifyAction";
|
||||
public const string ToggleBlockList = "ToggleBlockList";
|
||||
}
|
||||
|
||||
public sealed class CpeExtension
|
||||
|
@ -585,6 +585,14 @@ namespace MCGalaxy.Network
|
||||
(ushort)(barSize * ushort.MaxValue)));
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool SendToggleBlockList(bool toggle)
|
||||
{
|
||||
if (!Supports(CpeExt.ToggleBlockList)) return false;
|
||||
|
||||
Send(Packet.ToggleBlockList(toggle));
|
||||
return true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
@ -114,6 +114,8 @@ namespace MCGalaxy.Network
|
||||
public abstract bool SendRemoveSelection(byte id);
|
||||
/// <summary> Sends a cinematic gui definition to the client </summary>
|
||||
public abstract bool SendCinematicGui(CinematicGui gui);
|
||||
/// <summary> Sends a toggle block list packet to the client </summary>
|
||||
public abstract bool SendToggleBlockList(bool toggle);
|
||||
|
||||
/// <summary> Sends a level to the client </summary>
|
||||
public abstract void SendLevel(Level prev, Level level);
|
||||
|
@ -82,5 +82,6 @@ namespace MCGalaxy.Network {
|
||||
public const byte CpeCinematicGui = 56;
|
||||
public const byte CpeNotifyAction = 57;
|
||||
public const byte CpeNotifyPositionAction = 58;
|
||||
public const byte CpeToggleBlockList = 59;
|
||||
}
|
||||
}
|
||||
|
@ -707,8 +707,16 @@ namespace MCGalaxy.Network
|
||||
NetUtils.WriteU16(barSize, buffer, 8);
|
||||
return buffer;
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static byte[] ToggleBlockList(bool toggle)
|
||||
{
|
||||
byte[] buffer = new byte[2];
|
||||
buffer[0] = Opcode.CpeToggleBlockList;
|
||||
buffer[1] = (byte)(toggle ? 1 : 0);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Block definitions
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user