mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
Modernize data carriers to records and add primary constructors
Convert 14 data carrier classes to records: - VillagerInfo, MapIcon, EnchantmentData: non-positional records (mutable properties) - ForgeMod, SkinInfo, VillagerTrade, Node, Response: positional records - CommandNode: sealed positional record - CommandArgumentDescriptor: readonly record struct - ColorRGBA: record struct (multiple constructors preserved) - RecipeConfig, Recipe, BannerLayer: non-positional records Add primary constructors to 6 classes: - DataTypes, Protocol18Terrain, Protocol18Forge, ItemMovingHelper, LastSeenMessageList, Acknowledgment, SuggestionTooltip Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
81b756292e
commit
654a16907b
18 changed files with 68 additions and 231 deletions
|
|
@ -202,21 +202,8 @@ namespace MinecraftClient.Protocol
|
|||
/// <summary>
|
||||
/// Basic HTTP response object.
|
||||
/// </summary>
|
||||
public class Response
|
||||
public record Response(int StatusCode, string Body, NameValueCollection Headers, NameValueCollection Cookies)
|
||||
{
|
||||
public int StatusCode;
|
||||
public string Body;
|
||||
public NameValueCollection Headers;
|
||||
public NameValueCollection Cookies;
|
||||
|
||||
public Response(int statusCode, string body, NameValueCollection headers, NameValueCollection cookies)
|
||||
{
|
||||
StatusCode = statusCode;
|
||||
Body = body;
|
||||
Headers = headers;
|
||||
Cookies = cookies;
|
||||
}
|
||||
|
||||
public static Response Empty() =>
|
||||
new(204, "", new NameValueCollection(), new NameValueCollection());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue