mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-29 13:04:59 +00:00
Formatted the code and removed logs from Auto Attack
This commit is contained in:
parent
a4ff7ae438
commit
c6ca3dc13d
117 changed files with 602 additions and 585 deletions
|
|
@ -7,13 +7,13 @@ using MinecraftClient.Protocol.Handlers.StructuredComponents.Core;
|
|||
|
||||
namespace MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_20_6;
|
||||
|
||||
public class CanBreakComponent(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry)
|
||||
public class CanBreakComponent(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry)
|
||||
: StructuredComponent(dataTypes, itemPalette, subComponentRegistry)
|
||||
{
|
||||
public int NumberOfPredicates { get; set; }
|
||||
public List<BlockPredicateSubcomponent> BlockPredicates { get; set; } = new();
|
||||
public bool ShowInTooltip { get; set; }
|
||||
|
||||
|
||||
public override void Parse(Queue<byte> data)
|
||||
{
|
||||
NumberOfPredicates = DataTypes.ReadNextVarInt(data);
|
||||
|
|
@ -28,13 +28,13 @@ public class CanBreakComponent(DataTypes dataTypes, ItemPalette itemPalette, Sub
|
|||
{
|
||||
var data = new List<byte>();
|
||||
data.AddRange(DataTypes.GetVarInt(NumberOfPredicates));
|
||||
|
||||
if(NumberOfPredicates > 0 && BlockPredicates.Count == 0)
|
||||
|
||||
if (NumberOfPredicates > 0 && BlockPredicates.Count == 0)
|
||||
throw new ArgumentNullException($"Can not serialize a CanBreakComponent when the BlockPredicates is empty but NumberOfPredicates is > 0!");
|
||||
|
||||
|
||||
foreach (var blockPredicate in BlockPredicates)
|
||||
data.AddRange(blockPredicate.Serialize());
|
||||
|
||||
|
||||
data.AddRange(DataTypes.GetBool(ShowInTooltip));
|
||||
return new Queue<byte>(data);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue