diff options
| author | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
|---|---|---|
| committer | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
| commit | b691c43c44ff180d10e7d4a9afc83b98551ff586 (patch) | |
| tree | 3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/MerchantRecipe.h | |
| parent | def8cb415354ac390b7e89052a50605285f1aca9 (diff) | |
Initial commit
Diffstat (limited to 'Minecraft.World/MerchantRecipe.h')
| -rw-r--r-- | Minecraft.World/MerchantRecipe.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Minecraft.World/MerchantRecipe.h b/Minecraft.World/MerchantRecipe.h new file mode 100644 index 00000000..0ed84898 --- /dev/null +++ b/Minecraft.World/MerchantRecipe.h @@ -0,0 +1,35 @@ +#pragma once + +class MerchantRecipe +{ +private: + shared_ptr<ItemInstance> buyA; + shared_ptr<ItemInstance> buyB; + shared_ptr<ItemInstance> sell; + int uses; + int maxUses; + + void _init(shared_ptr<ItemInstance> buyA, shared_ptr<ItemInstance> buyB, shared_ptr<ItemInstance> sell); + +public: + MerchantRecipe(CompoundTag *tag); + MerchantRecipe(shared_ptr<ItemInstance> buyA, shared_ptr<ItemInstance> buyB, shared_ptr<ItemInstance> sell, int uses = 0, int maxUses = 7); + MerchantRecipe(shared_ptr<ItemInstance> buy, shared_ptr<ItemInstance> sell); + MerchantRecipe(shared_ptr<ItemInstance> buy, Item *sell); + MerchantRecipe(shared_ptr<ItemInstance> buy, Tile *sell); + + shared_ptr<ItemInstance> getBuyAItem(); + shared_ptr<ItemInstance> getBuyBItem(); + bool hasSecondaryBuyItem(); + shared_ptr<ItemInstance> getSellItem(); + bool isSame(MerchantRecipe *other); + bool isSameSameButBetter(MerchantRecipe *other); + int getUses(); + int getMaxUses(); + void increaseUses(); + void increaseMaxUses(int amount); + bool isDeprecated(); + void enforceDeprecated(); + void load(CompoundTag *tag); + CompoundTag *createTag(); +};
\ No newline at end of file |
