mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
Fix CS9107 warnings: use base class properties instead of captured primary constructor parameters
Replace lowercase primary constructor parameter references (dataTypes., subComponentRegistry., itemPalette.) with PascalCase base class property references (DataTypes., SubComponentRegistry., ItemPalette.) in method bodies of all StructuredComponent and SubComponent subclasses. This eliminates CS9107 warnings where subclass primary constructor parameters shadow the base class properties they are assigned to. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
94bf42710a
commit
640a4e39b7
90 changed files with 366 additions and 366 deletions
|
|
@ -15,12 +15,12 @@ public class AttributeSubComponent(DataTypes dataTypes, SubComponentRegistry sub
|
|||
|
||||
protected override void Parse(Queue<byte> data)
|
||||
{
|
||||
TypeId = dataTypes.ReadNextVarInt(data);
|
||||
Uuid = dataTypes.ReadNextUUID(data);
|
||||
Name = dataTypes.ReadNextString(data);
|
||||
Value = dataTypes.ReadNextDouble(data);
|
||||
Operation = dataTypes.ReadNextVarInt(data);
|
||||
Slot = dataTypes.ReadNextVarInt(data);
|
||||
TypeId = DataTypes.ReadNextVarInt(data);
|
||||
Uuid = DataTypes.ReadNextUUID(data);
|
||||
Name = DataTypes.ReadNextString(data);
|
||||
Value = DataTypes.ReadNextDouble(data);
|
||||
Operation = DataTypes.ReadNextVarInt(data);
|
||||
Slot = DataTypes.ReadNextVarInt(data);
|
||||
}
|
||||
|
||||
public override Queue<byte> Serialize()
|
||||
|
|
|
|||
|
|
@ -15,25 +15,25 @@ public class BlockPredicateSubcomponent(DataTypes dataTypes, SubComponentRegistr
|
|||
|
||||
protected override void Parse(Queue<byte> data)
|
||||
{
|
||||
HasBlocks = dataTypes.ReadNextBool(data);
|
||||
HasBlocks = DataTypes.ReadNextBool(data);
|
||||
|
||||
if (HasBlocks)
|
||||
BlockSet = (BlockSetSubcomponent)subComponentRegistry.ParseSubComponent(SubComponents.BlockSet, data);
|
||||
BlockSet = (BlockSetSubcomponent)SubComponentRegistry.ParseSubComponent(SubComponents.BlockSet, data);
|
||||
|
||||
HasProperities = dataTypes.ReadNextBool(data);
|
||||
HasProperities = DataTypes.ReadNextBool(data);
|
||||
|
||||
if (HasProperities)
|
||||
{
|
||||
Properties = new();
|
||||
var numberOfProperties = dataTypes.ReadNextVarInt(data);
|
||||
var numberOfProperties = DataTypes.ReadNextVarInt(data);
|
||||
for (var i = 0; i < numberOfProperties; i++)
|
||||
Properties.Add((PropertySubComponent)subComponentRegistry.ParseSubComponent(SubComponents.Property, data));
|
||||
Properties.Add((PropertySubComponent)SubComponentRegistry.ParseSubComponent(SubComponents.Property, data));
|
||||
}
|
||||
|
||||
HasNbt = dataTypes.ReadNextBool(data);
|
||||
HasNbt = DataTypes.ReadNextBool(data);
|
||||
|
||||
if (HasNbt)
|
||||
Nbt = dataTypes.ReadNextNbt(data);
|
||||
Nbt = DataTypes.ReadNextNbt(data);
|
||||
}
|
||||
|
||||
public override Queue<byte> Serialize()
|
||||
|
|
|
|||
|
|
@ -15,14 +15,14 @@ public class BlockSetSubcomponent(DataTypes dataTypes, SubComponentRegistry subC
|
|||
Type = DataTypes.ReadNextVarInt(data);
|
||||
|
||||
if (Type == 0)
|
||||
TagName = dataTypes.ReadNextString(data);
|
||||
TagName = DataTypes.ReadNextString(data);
|
||||
|
||||
if (Type == 0) return;
|
||||
|
||||
BlockIds = [];
|
||||
|
||||
for (var i = 0; i < Type - 1; i++)
|
||||
BlockIds.Add(dataTypes.ReadNextVarInt(data));
|
||||
BlockIds.Add(DataTypes.ReadNextVarInt(data));
|
||||
}
|
||||
|
||||
public override Queue<byte> Serialize()
|
||||
|
|
|
|||
|
|
@ -16,15 +16,15 @@ public class DetailsSubComponent(DataTypes dataTypes, SubComponentRegistry subCo
|
|||
|
||||
protected override void Parse(Queue<byte> data)
|
||||
{
|
||||
Amplifier = dataTypes.ReadNextVarInt(data);
|
||||
Duration = dataTypes.ReadNextVarInt(data);
|
||||
Ambient = dataTypes.ReadNextBool(data);
|
||||
ShowParticles = dataTypes.ReadNextBool(data);
|
||||
ShowIcon = dataTypes.ReadNextBool(data);
|
||||
HasHiddenEffects = dataTypes.ReadNextBool(data);
|
||||
Amplifier = DataTypes.ReadNextVarInt(data);
|
||||
Duration = DataTypes.ReadNextVarInt(data);
|
||||
Ambient = DataTypes.ReadNextBool(data);
|
||||
ShowParticles = DataTypes.ReadNextBool(data);
|
||||
ShowIcon = DataTypes.ReadNextBool(data);
|
||||
HasHiddenEffects = DataTypes.ReadNextBool(data);
|
||||
|
||||
if(HasHiddenEffects)
|
||||
Detail = (DetailsSubComponent)subComponentRegistry.ParseSubComponent(SubComponents.Details, data);
|
||||
Detail = (DetailsSubComponent)SubComponentRegistry.ParseSubComponent(SubComponents.Details, data);
|
||||
}
|
||||
|
||||
public override Queue<byte> Serialize()
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ public class EffectSubComponent(DataTypes dataTypes, SubComponentRegistry subCom
|
|||
|
||||
protected override void Parse(Queue<byte> data)
|
||||
{
|
||||
TypeId = (PotionEffectSubComponent)subComponentRegistry.ParseSubComponent(SubComponents.PotionEffect, data);
|
||||
Probability = dataTypes.ReadNextFloat(data);
|
||||
TypeId = (PotionEffectSubComponent)SubComponentRegistry.ParseSubComponent(SubComponents.PotionEffect, data);
|
||||
Probability = DataTypes.ReadNextFloat(data);
|
||||
}
|
||||
|
||||
public override Queue<byte> Serialize()
|
||||
|
|
|
|||
|
|
@ -16,19 +16,19 @@ public class FireworkExplosionSubComponent(DataTypes dataTypes, SubComponentRegi
|
|||
|
||||
protected override void Parse(Queue<byte> data)
|
||||
{
|
||||
Shape = dataTypes.ReadNextVarInt(data);
|
||||
NumberOfColors = dataTypes.ReadNextVarInt(data);
|
||||
Shape = DataTypes.ReadNextVarInt(data);
|
||||
NumberOfColors = DataTypes.ReadNextVarInt(data);
|
||||
|
||||
for (var i = 0; i < NumberOfColors; i++)
|
||||
Colors.Add(dataTypes.ReadNextInt(data));
|
||||
Colors.Add(DataTypes.ReadNextInt(data));
|
||||
|
||||
NumberOfFadeColors = dataTypes.ReadNextVarInt(data);
|
||||
NumberOfFadeColors = DataTypes.ReadNextVarInt(data);
|
||||
|
||||
for (var i = 0; i < NumberOfFadeColors; i++)
|
||||
FadeColors.Add(dataTypes.ReadNextInt(data));
|
||||
FadeColors.Add(DataTypes.ReadNextInt(data));
|
||||
|
||||
HasTrail = dataTypes.ReadNextBool(data);
|
||||
HasTwinkle = dataTypes.ReadNextBool(data);
|
||||
HasTrail = DataTypes.ReadNextBool(data);
|
||||
HasTwinkle = DataTypes.ReadNextBool(data);
|
||||
}
|
||||
|
||||
public override Queue<byte> Serialize()
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ public class PotionEffectSubComponent(DataTypes dataTypes, SubComponentRegistry
|
|||
|
||||
protected override void Parse(Queue<byte> data)
|
||||
{
|
||||
TypeId = dataTypes.ReadNextVarInt(data);
|
||||
Details = (DetailsSubComponent)subComponentRegistry.ParseSubComponent(SubComponents.Details, data);
|
||||
TypeId = DataTypes.ReadNextVarInt(data);
|
||||
Details = (DetailsSubComponent)SubComponentRegistry.ParseSubComponent(SubComponents.Details, data);
|
||||
}
|
||||
|
||||
public override Queue<byte> Serialize()
|
||||
|
|
|
|||
|
|
@ -14,17 +14,17 @@ public class PropertySubComponent(DataTypes dataTypes, SubComponentRegistry subC
|
|||
|
||||
protected override void Parse(Queue<byte> data)
|
||||
{
|
||||
Name = dataTypes.ReadNextString(data);
|
||||
IsExactMatch = dataTypes.ReadNextBool(data);
|
||||
Name = DataTypes.ReadNextString(data);
|
||||
IsExactMatch = DataTypes.ReadNextBool(data);
|
||||
|
||||
if (IsExactMatch)
|
||||
{
|
||||
ExactValue = dataTypes.ReadNextString(data);
|
||||
ExactValue = DataTypes.ReadNextString(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
MinValue = dataTypes.ReadNextBool(data) ? dataTypes.ReadNextString(data) : null;
|
||||
MaxValue = dataTypes.ReadNextBool(data) ? dataTypes.ReadNextString(data) : null;
|
||||
MinValue = DataTypes.ReadNextBool(data) ? DataTypes.ReadNextString(data) : null;
|
||||
MaxValue = DataTypes.ReadNextBool(data) ? DataTypes.ReadNextString(data) : null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,16 +14,16 @@ public class RuleSubComponent(DataTypes dataTypes, SubComponentRegistry subCompo
|
|||
|
||||
protected override void Parse(Queue<byte> data)
|
||||
{
|
||||
Blocks = (BlockSetSubcomponent)subComponentRegistry.ParseSubComponent(SubComponents.BlockSet, data);
|
||||
HasSpeed = dataTypes.ReadNextBool(data);
|
||||
Blocks = (BlockSetSubcomponent)SubComponentRegistry.ParseSubComponent(SubComponents.BlockSet, data);
|
||||
HasSpeed = DataTypes.ReadNextBool(data);
|
||||
|
||||
if(HasSpeed)
|
||||
Speed = dataTypes.ReadNextFloat(data);
|
||||
Speed = DataTypes.ReadNextFloat(data);
|
||||
|
||||
HasCorrectDropForBlocks = dataTypes.ReadNextBool(data);
|
||||
HasCorrectDropForBlocks = DataTypes.ReadNextBool(data);
|
||||
|
||||
if(HasCorrectDropForBlocks)
|
||||
CorrectDropForBlocks = dataTypes.ReadNextBool(data);
|
||||
CorrectDropForBlocks = DataTypes.ReadNextBool(data);
|
||||
}
|
||||
|
||||
public override Queue<byte> Serialize()
|
||||
|
|
|
|||
|
|
@ -14,11 +14,11 @@ public class AttributeSubComponent121(DataTypes dataTypes, SubComponentRegistry
|
|||
|
||||
protected override void Parse(Queue<byte> data)
|
||||
{
|
||||
TypeId = dataTypes.ReadNextVarInt(data);
|
||||
ResourceLocation = dataTypes.ReadNextString(data);
|
||||
Value = dataTypes.ReadNextDouble(data);
|
||||
Operation = dataTypes.ReadNextVarInt(data);
|
||||
Slot = dataTypes.ReadNextVarInt(data);
|
||||
TypeId = DataTypes.ReadNextVarInt(data);
|
||||
ResourceLocation = DataTypes.ReadNextString(data);
|
||||
Value = DataTypes.ReadNextDouble(data);
|
||||
Operation = DataTypes.ReadNextVarInt(data);
|
||||
Slot = DataTypes.ReadNextVarInt(data);
|
||||
}
|
||||
|
||||
public override Queue<byte> Serialize()
|
||||
|
|
|
|||
|
|
@ -13,15 +13,15 @@ public class SoundEventSubComponent(DataTypes dataTypes, SubComponentRegistry su
|
|||
|
||||
protected override void Parse(Queue<byte> data)
|
||||
{
|
||||
Type = dataTypes.ReadNextVarInt(data);
|
||||
Type = DataTypes.ReadNextVarInt(data);
|
||||
|
||||
if (Type != 0) return;
|
||||
|
||||
SoundName = dataTypes.ReadNextString(data);
|
||||
HasFixedRange = dataTypes.ReadNextBool(data);
|
||||
SoundName = DataTypes.ReadNextString(data);
|
||||
HasFixedRange = DataTypes.ReadNextBool(data);
|
||||
|
||||
if (HasFixedRange)
|
||||
FixedRange = dataTypes.ReadNextFloat(data);
|
||||
FixedRange = DataTypes.ReadNextFloat(data);
|
||||
}
|
||||
|
||||
public override Queue<byte> Serialize()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue