mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Adds support for villager trading (#1316)
* adds villager trading support Adds handler for tradeList packet and selectTrade packet * added extra line at end * removed tab; removed size and hasSecondItem removed a mistakenly added tab instead of 4 spaces. SelectTrade was already added in 1.13. Removed unnecessary size and hasSecondItem from trade dataType. * Added VillagerInfo class and capitalized vars in Trade class * Update VillagerInfo.cs * Small formatting/naming adjustments Co-authored-by: ORelio <ORelio@users.noreply.github.com>
This commit is contained in:
parent
2a7f0c7f16
commit
28f47cc532
11 changed files with 186 additions and 1 deletions
13
MinecraftClient/Inventory/VillagerInfo.cs
Normal file
13
MinecraftClient/Inventory/VillagerInfo.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
namespace MinecraftClient.Mapping
|
||||
{
|
||||
/// <summary>
|
||||
/// Properties of a villager
|
||||
/// </summary>
|
||||
public class VillagerInfo
|
||||
{
|
||||
public int Level { get; set; }
|
||||
public int Experience { get; set; }
|
||||
public bool IsRegularVillager { get; set; }
|
||||
public bool CanRestock { get; set; }
|
||||
}
|
||||
}
|
||||
33
MinecraftClient/Inventory/VillagerTrade.cs
Normal file
33
MinecraftClient/Inventory/VillagerTrade.cs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
namespace MinecraftClient.Inventory
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a trade of a villager
|
||||
/// </summary>
|
||||
public class VillagerTrade
|
||||
{
|
||||
public Item InputItem1;
|
||||
public Item OutputItem;
|
||||
public Item InputItem2;
|
||||
public bool TradeDisabled;
|
||||
public int NumberOfTradeUses;
|
||||
public int MaximumNumberOfTradeUses;
|
||||
public int Xp;
|
||||
public int SpecialPrice;
|
||||
public float PriceMultiplier;
|
||||
public int Demand;
|
||||
|
||||
public VillagerTrade(Item inputItem1, Item outputItem, Item inputItem2, bool tradeDisabled, int numberOfTradeUses, int maximumNumberOfTradeUses, int xp, int specialPrice, float priceMultiplier, int demand)
|
||||
{
|
||||
this.InputItem1 = inputItem1;
|
||||
this.OutputItem = outputItem;
|
||||
this.InputItem2 = inputItem2;
|
||||
this.TradeDisabled = tradeDisabled;
|
||||
this.NumberOfTradeUses = numberOfTradeUses;
|
||||
this.MaximumNumberOfTradeUses = maximumNumberOfTradeUses;
|
||||
this.Xp = xp;
|
||||
this.SpecialPrice = specialPrice;
|
||||
this.PriceMultiplier = priceMultiplier;
|
||||
this.Demand = demand;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue