mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-29 13:04:59 +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
|
|
@ -7,24 +7,10 @@ namespace MinecraftClient.Inventory
|
|||
/// <summary>
|
||||
/// Class that contains useful methods to move item around in a container
|
||||
/// </summary>
|
||||
public class ItemMovingHelper
|
||||
public class ItemMovingHelper(Container c, McClient mc)
|
||||
{
|
||||
private readonly Container c;
|
||||
private readonly McClient mc;
|
||||
|
||||
/// <summary>
|
||||
/// Create a helper that contains useful methods to move item around in container
|
||||
/// </summary>
|
||||
/// <param name="c">Source container to use. All method will use this container for handling first slot parameter</param>
|
||||
/// <param name="mc">McClient handler. Needed for sending WindowAction packet to the server</param>
|
||||
/// <remarks>
|
||||
/// If you are using ChatBot API and cannot have direct access to McClient handler, use <see cref="ChatBot.WindowAction(int, int, WindowActionType)"/> as second parameter
|
||||
/// </remarks>
|
||||
public ItemMovingHelper(Container c, McClient mc)
|
||||
{
|
||||
this.c = c;
|
||||
this.mc = mc;
|
||||
}
|
||||
private readonly Container c = c;
|
||||
private readonly McClient mc = mc;
|
||||
|
||||
/// <summary>
|
||||
/// Move an item fron source to dest. Source should contain an item and dest slot should be empty
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue