From b691c43c44ff180d10e7d4a9afc83b98551ff586 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Sun, 1 Mar 2026 12:16:08 +0800 Subject: Initial commit --- Minecraft.World/MerchantRecipe.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Minecraft.World/MerchantRecipe.h (limited to 'Minecraft.World/MerchantRecipe.h') 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 buyA; + shared_ptr buyB; + shared_ptr sell; + int uses; + int maxUses; + + void _init(shared_ptr buyA, shared_ptr buyB, shared_ptr sell); + +public: + MerchantRecipe(CompoundTag *tag); + MerchantRecipe(shared_ptr buyA, shared_ptr buyB, shared_ptr sell, int uses = 0, int maxUses = 7); + MerchantRecipe(shared_ptr buy, shared_ptr sell); + MerchantRecipe(shared_ptr buy, Item *sell); + MerchantRecipe(shared_ptr buy, Tile *sell); + + shared_ptr getBuyAItem(); + shared_ptr getBuyBItem(); + bool hasSecondaryBuyItem(); + shared_ptr 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 -- cgit v1.2.3