mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +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,7 +7,7 @@ using MinecraftClient.Protocol.Handlers.StructuredComponents.Core;
|
|||
|
||||
namespace MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_20_6;
|
||||
|
||||
public class FoodComponentComponent(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry)
|
||||
public class FoodComponentComponent(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry)
|
||||
: StructuredComponent(dataTypes, itemPalette, subComponentRegistry)
|
||||
{
|
||||
public int Nutrition { get; set; }
|
||||
|
|
@ -15,7 +15,7 @@ public class FoodComponentComponent(DataTypes dataTypes, ItemPalette itemPalette
|
|||
public bool CanAlwaysEat { get; set; }
|
||||
public float SecondsToEat { get; set; }
|
||||
public List<EffectSubComponent> Effects { get; set; } = new();
|
||||
|
||||
|
||||
public override void Parse(Queue<byte> data)
|
||||
{
|
||||
Nutrition = DataTypes.ReadNextVarInt(data);
|
||||
|
|
@ -23,8 +23,8 @@ public class FoodComponentComponent(DataTypes dataTypes, ItemPalette itemPalette
|
|||
CanAlwaysEat = DataTypes.ReadNextBool(data);
|
||||
SecondsToEat = DataTypes.ReadNextFloat(data);
|
||||
var numberOfEffects = DataTypes.ReadNextVarInt(data);
|
||||
|
||||
for(var i = 0; i < numberOfEffects; i++)
|
||||
|
||||
for (var i = 0; i < numberOfEffects; i++)
|
||||
Effects.Add((EffectSubComponent)SubComponentRegistry.ParseSubComponent(SubComponents.Effect, data));
|
||||
}
|
||||
|
||||
|
|
@ -37,9 +37,9 @@ public class FoodComponentComponent(DataTypes dataTypes, ItemPalette itemPalette
|
|||
data.AddRange(DataTypes.GetFloat(SecondsToEat));
|
||||
data.AddRange(DataTypes.GetVarInt(Effects.Count));
|
||||
|
||||
foreach(var effect in Effects)
|
||||
foreach (var effect in Effects)
|
||||
data.AddRange(effect.Serialize());
|
||||
|
||||
|
||||
return new Queue<byte>(data);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue