Skip to content

Commit

Permalink
Added Configuration Packets mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
milutinke committed Jan 29, 2024
1 parent 7aabe8b commit e13ba93
Show file tree
Hide file tree
Showing 22 changed files with 250 additions and 212 deletions.
16 changes: 16 additions & 0 deletions MinecraftClient/Protocol/Handlers/ConfigurationPacketTypesIn.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace MinecraftClient.Protocol.Handlers;

public enum ConfigurationPacketTypesIn
{
PluginMessage,
Disconnect,
FinishConfiguration,
KeepAlive,
Ping,
RegistryData,
ResourcePack,
FeatureFlags,
UpdateTags,

Unknown
}
13 changes: 13 additions & 0 deletions MinecraftClient/Protocol/Handlers/ConfigurationPacketTypesOut.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace MinecraftClient.Protocol.Handlers;

public enum ConfigurationPacketTypesOut
{
ClientInformation,
PluginMessage,
FinishConfiguration,
KeepAlive,
Pong,
ResourcePackResponse,

Unknown
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,9 @@ public class PacketPalette110 : PacketTypePalette
{ 0x1D, PacketTypesOut.UseItem },
};

protected override Dictionary<int, PacketTypesIn> GetListIn()
{
return typeIn;
}

protected override Dictionary<int, PacketTypesOut> GetListOut()
{
return typeOut;
}
protected override Dictionary<int, PacketTypesIn> GetListIn() => typeIn;
protected override Dictionary<int, PacketTypesOut> GetListOut() => typeOut;
protected override Dictionary<int, ConfigurationPacketTypesIn> GetConfigurationListIn() => null!;
protected override Dictionary<int, ConfigurationPacketTypesOut> GetConfigurationListOut() => null!;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,9 @@ public class PacketPalette112 : PacketTypePalette
{ 0x20, PacketTypesOut.UseItem },
};

protected override Dictionary<int, PacketTypesIn> GetListIn()
{
return typeIn;
}

protected override Dictionary<int, PacketTypesOut> GetListOut()
{
return typeOut;
}
protected override Dictionary<int, PacketTypesIn> GetListIn() => typeIn;
protected override Dictionary<int, PacketTypesOut> GetListOut() => typeOut;
protected override Dictionary<int, ConfigurationPacketTypesIn> GetConfigurationListIn() => null!;
protected override Dictionary<int, ConfigurationPacketTypesOut> GetConfigurationListOut() => null!;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,9 @@ public class PacketPalette1122 : PacketTypePalette
{ 0x20, PacketTypesOut.UseItem },
};

protected override Dictionary<int, PacketTypesIn> GetListIn()
{
return typeIn;
}

protected override Dictionary<int, PacketTypesOut> GetListOut()
{
return typeOut;
}
protected override Dictionary<int, PacketTypesIn> GetListIn() => typeIn;
protected override Dictionary<int, PacketTypesOut> GetListOut() => typeOut;
protected override Dictionary<int, ConfigurationPacketTypesIn> GetConfigurationListIn() => null!;
protected override Dictionary<int, ConfigurationPacketTypesOut> GetConfigurationListOut() => null!;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,9 @@ public class PacketPalette113 : PacketTypePalette
{ 0x2A, PacketTypesOut.UseItem },
};

protected override Dictionary<int, PacketTypesIn> GetListIn()
{
return typeIn;
}

protected override Dictionary<int, PacketTypesOut> GetListOut()
{
return typeOut;
}
protected override Dictionary<int, PacketTypesIn> GetListIn() => typeIn;
protected override Dictionary<int, PacketTypesOut> GetListOut() => typeOut;
protected override Dictionary<int, ConfigurationPacketTypesIn> GetConfigurationListIn() => null!;
protected override Dictionary<int, ConfigurationPacketTypesOut> GetConfigurationListOut() => null!;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,9 @@ public class PacketPalette114 : PacketTypePalette
{ 0x2D, PacketTypesOut.UseItem },
};

protected override Dictionary<int, PacketTypesIn> GetListIn()
{
return typeIn;
}

protected override Dictionary<int, PacketTypesOut> GetListOut()
{
return typeOut;
}
protected override Dictionary<int, PacketTypesIn> GetListIn() => typeIn;
protected override Dictionary<int, PacketTypesOut> GetListOut() => typeOut;
protected override Dictionary<int, ConfigurationPacketTypesIn> GetConfigurationListIn() => null!;
protected override Dictionary<int, ConfigurationPacketTypesOut> GetConfigurationListOut() => null!;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,9 @@ public class PacketPalette115 : PacketTypePalette
{ 0x2D, PacketTypesOut.UseItem },
};

protected override Dictionary<int, PacketTypesIn> GetListIn()
{
return typeIn;
}

protected override Dictionary<int, PacketTypesOut> GetListOut()
{
return typeOut;
}
protected override Dictionary<int, PacketTypesIn> GetListIn() => typeIn;
protected override Dictionary<int, PacketTypesOut> GetListOut() => typeOut;
protected override Dictionary<int, ConfigurationPacketTypesIn> GetConfigurationListIn() => null!;
protected override Dictionary<int, ConfigurationPacketTypesOut> GetConfigurationListOut() => null!;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,9 @@ public class PacketPalette116 : PacketTypePalette
{ 0x2E, PacketTypesOut.UseItem },
};

protected override Dictionary<int, PacketTypesIn> GetListIn()
{
return typeIn;
}

protected override Dictionary<int, PacketTypesOut> GetListOut()
{
return typeOut;
}
protected override Dictionary<int, PacketTypesIn> GetListIn() => typeIn;
protected override Dictionary<int, PacketTypesOut> GetListOut() => typeOut;
protected override Dictionary<int, ConfigurationPacketTypesIn> GetConfigurationListIn() => null!;
protected override Dictionary<int, ConfigurationPacketTypesOut> GetConfigurationListOut() => null!;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,9 @@ public class PacketPalette1162 : PacketTypePalette
{ 0x2F, PacketTypesOut.UseItem },
};

protected override Dictionary<int, PacketTypesIn> GetListIn()
{
return typeIn;
}

protected override Dictionary<int, PacketTypesOut> GetListOut()
{
return typeOut;
}
protected override Dictionary<int, PacketTypesIn> GetListIn() => typeIn;
protected override Dictionary<int, PacketTypesOut> GetListOut() => typeOut;
protected override Dictionary<int, ConfigurationPacketTypesIn> GetConfigurationListIn() => null!;
protected override Dictionary<int, ConfigurationPacketTypesOut> GetConfigurationListOut() => null!;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,9 @@ public class PacketPalette117 : PacketTypePalette
{ 0x2F, PacketTypesOut.UseItem },
};

protected override Dictionary<int, PacketTypesIn> GetListIn()
{
return typeIn;
}

protected override Dictionary<int, PacketTypesOut> GetListOut()
{
return typeOut;
}
protected override Dictionary<int, PacketTypesIn> GetListIn() => typeIn;
protected override Dictionary<int, PacketTypesOut> GetListOut() => typeOut;
protected override Dictionary<int, ConfigurationPacketTypesIn> GetConfigurationListIn() => null!;
protected override Dictionary<int, ConfigurationPacketTypesOut> GetConfigurationListOut() => null!;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,9 @@ public class PacketPalette118 : PacketTypePalette
{ 0x2F, PacketTypesOut.UseItem },
};

protected override Dictionary<int, PacketTypesIn> GetListIn()
{
return typeIn;
}

protected override Dictionary<int, PacketTypesOut> GetListOut()
{
return typeOut;
}
protected override Dictionary<int, PacketTypesIn> GetListIn() => typeIn;
protected override Dictionary<int, PacketTypesOut> GetListOut() => typeOut;
protected override Dictionary<int, ConfigurationPacketTypesIn> GetConfigurationListIn() => null!;
protected override Dictionary<int, ConfigurationPacketTypesOut> GetConfigurationListOut() => null!;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public class PacketPalette119 : PacketTypePalette
{ 0x00, PacketTypesOut.TeleportConfirm }, // (Wiki name: Confirm Teleportation)
{ 0x01, PacketTypesOut.QueryBlockNBT }, // (Wiki name: Query Block Entity Tag)
{ 0x02, PacketTypesOut.SetDifficulty }, // (Wiki name: Change Difficutly)
{ 0x03, PacketTypesOut.MessageAcknowledgment }, // TODO
{ 0x03, PacketTypesOut.MessageAcknowledgment }, //
{ 0x04, PacketTypesOut.ChatCommand }, // Added in 1.19
{ 0x05, PacketTypesOut.ChatMessage }, // Changed in 1.19 (Completely changed) (Wiki name: Chat)
{ 0x06, PacketTypesOut.ClientStatus }, // (Wiki name: Client Command)
Expand Down Expand Up @@ -147,7 +147,7 @@ public class PacketPalette119 : PacketTypePalette
{ 0x1D, PacketTypesOut.EntityAction }, // (Wiki name: Player Command)
{ 0x1E, PacketTypesOut.SteerVehicle }, // (Wiki name: Player Input)
{ 0x1F, PacketTypesOut.Pong }, // (Wiki name: Pong (play))
{ 0x20, PacketTypesOut.PlayerSession }, // Added in 1.19.3 TODO
{ 0x20, PacketTypesOut.PlayerSession }, // Added in 1.19.3
{ 0x21, PacketTypesOut.SetDisplayedRecipe }, // (Wiki name: Recipe Book Change Settings)
{ 0x22, PacketTypesOut.SetRecipeBookState }, // (Wiki name: Recipe Book Seen Recipe)
{ 0x23, PacketTypesOut.NameItem }, // (Wiki name: Rename Item)
Expand All @@ -168,14 +168,9 @@ public class PacketPalette119 : PacketTypePalette
{ 0x32, PacketTypesOut.UseItem }, // Changed in 1.19 (Added a "Sequence" field) (Wiki name: Use Item)
};

protected override Dictionary<int, PacketTypesIn> GetListIn()
{
return typeIn;
}

protected override Dictionary<int, PacketTypesOut> GetListOut()
{
return typeOut;
}
protected override Dictionary<int, PacketTypesIn> GetListIn() => typeIn;
protected override Dictionary<int, PacketTypesOut> GetListOut() => typeOut;
protected override Dictionary<int, ConfigurationPacketTypesIn> GetConfigurationListIn() => null!;
protected override Dictionary<int, ConfigurationPacketTypesOut> GetConfigurationListOut() => null!;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,9 @@ public class PacketPalette1192 : PacketTypePalette
{ 0x32, PacketTypesOut.UseItem }, // Changed in 1.19 (Added a "Sequence" field) (Wiki name: Use Item)
};

protected override Dictionary<int, PacketTypesIn> GetListIn()
{
return typeIn;
}

protected override Dictionary<int, PacketTypesOut> GetListOut()
{
return typeOut;
}
protected override Dictionary<int, PacketTypesIn> GetListIn() => typeIn;
protected override Dictionary<int, PacketTypesOut> GetListOut() => typeOut;
protected override Dictionary<int, ConfigurationPacketTypesIn> GetConfigurationListIn() => null!;
protected override Dictionary<int, ConfigurationPacketTypesOut> GetConfigurationListOut() => null!;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,9 @@ public class PacketPalette1193 : PacketTypePalette
{ 0x32, PacketTypesOut.UseItem }, // Changed in 1.19 (Added a "Sequence" field) (Wiki name: Use Item)
};

protected override Dictionary<int, PacketTypesIn> GetListIn()
{
return typeIn;
}

protected override Dictionary<int, PacketTypesOut> GetListOut()
{
return typeOut;
}
protected override Dictionary<int, PacketTypesIn> GetListIn() => typeIn;
protected override Dictionary<int, PacketTypesOut> GetListOut() => typeOut;
protected override Dictionary<int, ConfigurationPacketTypesIn> GetConfigurationListIn() => null!;
protected override Dictionary<int, ConfigurationPacketTypesOut> GetConfigurationListOut() => null!;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,9 @@ public class PacketPalette1194 : PacketTypePalette
{ 0x32, PacketTypesOut.UseItem }, // Changed in 1.19 (Added a "Sequence" field) (Wiki name: Use Item)
};

protected override Dictionary<int, PacketTypesIn> GetListIn()
{
return typeIn;
}

protected override Dictionary<int, PacketTypesOut> GetListOut()
{
return typeOut;
}
protected override Dictionary<int, PacketTypesIn> GetListIn() => typeIn;
protected override Dictionary<int, PacketTypesOut> GetListOut() => typeOut;
protected override Dictionary<int, ConfigurationPacketTypesIn> GetConfigurationListIn() => null!;
protected override Dictionary<int, ConfigurationPacketTypesOut> GetConfigurationListOut() => null!;
}
}
Loading

0 comments on commit e13ba93

Please sign in to comment.