Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
LegacyTradeableComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/legacy/ActorUniqueID.h"
7#include "mc/world/ContainerID.h"
8#include "mc/world/item/HandSlot.h"
9
10// auto generated forward declare list
11// clang-format off
12class Actor;
13class CompoundTag;
14class DataLoadHelper;
15class Interaction;
17class Player;
19struct TradeTable;
20// clang-format on
21
22class LegacyTradeableComponent {
23public:
24 // member variables
25 // NOLINTBEGIN
26 ::ll::TypedStorage<1, 1, bool> mAddRecipeOnUpdate;
27 ::ll::TypedStorage<1, 1, bool> mResetLockedOnFirstTrade;
28 ::ll::TypedStorage<1, 1, bool> mWillingToBreed;
29 ::ll::TypedStorage<4, 4, int> mRiches;
30 ::ll::TypedStorage<4, 4, int> mTradeTier;
31 ::ll::TypedStorage<4, 4, int> mUpdateMerchantTimer;
32 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mLastPlayerTradeID;
33 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::MerchantRecipeList>> mOffers;
34 ::ll::TypedStorage<8, 32, ::std::string> mDisplayName;
35 ::ll::TypedStorage<8, 24, ::std::vector<int>> mTradeRecipeFirstTime;
36 // NOLINTEND
37
38public:
39 // prevent constructor by default
40 LegacyTradeableComponent& operator=(LegacyTradeableComponent const&);
41 LegacyTradeableComponent(LegacyTradeableComponent const&);
42 LegacyTradeableComponent();
43
44public:
45 // member functions
46 // NOLINTBEGIN
47 MCNAPI ::TradeTable* _getTradeTable(::Actor& owner);
48
49 MCNAPI bool _refreshTrades(::Actor& owner);
50
51 MCNAPI void addAdditionalSaveData(::CompoundTag& tag) const;
52
53 MCNAPI ::UpdateTradePacket createDataPacket(::Actor& owner, ::ContainerID containerID);
54
55 MCNAPI ::Interaction getInteraction(::Actor& owner, ::Player& player, ::HandSlot);
56
57 MCNAPI ::std::string const& loadDisplayName(::Actor& owner);
58
59 MCNAPI void notifyTrade(::Actor& owner, int recipeIndex, int numTrades);
60
61 MCNAPI ::LegacyTradeableComponent& operator=(::LegacyTradeableComponent&&);
62
64
65 MCNAPI void reloadComponent(::Actor& actor);
66
67 MCNAPI void restockAllRecipes(::Actor& owner);
68
69#ifdef LL_PLAT_C
70 MCNAPI void setDataFromPacket(::UpdateTradePacket const& packet);
71#endif
72
73 MCNAPI void setOffers(::MerchantRecipeList& offers);
74
75 MCNAPI bool shouldConvertTrades(::Actor& owner) const;
76
77 MCNAPI bool shouldPersistTrades(::Actor& owner) const;
78
79 MCNAPI void updateTradeTier(::Actor& owner);
80
82 // NOLINTEND
83
84public:
85 // static functions
86 // NOLINTBEGIN
87 MCNAPI static bool isUseNewTradeScreen(::Actor const& owner);
88 // NOLINTEND
89
90public:
91 // destructor thunk
92 // NOLINTBEGIN
93 MCNAPI void $dtor();
94 // NOLINTEND
95};
Definition Actor.h:116
Definition CompoundTag.h:18
Definition DataLoadHelper.h:20
Definition Interaction.h:9
MCAPI::TradeTable * _getTradeTable(::Actor &owner)
MCAPI::Interaction getInteraction(::Actor &owner, ::Player &player, ::HandSlot)
MCAPI::std::string const & loadDisplayName(::Actor &owner)
MCAPI bool shouldPersistTrades(::Actor &owner) const
MCAPI void readAdditionalSaveData(::Actor &owner, ::CompoundTag const &tag, ::DataLoadHelper &)
MCAPI::LegacyTradeableComponent & operator=(::LegacyTradeableComponent &&)
MCAPI void setOffers(::MerchantRecipeList &offers)
MCAPI void restockAllRecipes(::Actor &owner)
MCAPI bool _refreshTrades(::Actor &owner)
static MCAPI bool isUseNewTradeScreen(::Actor const &owner)
MCAPI bool shouldConvertTrades(::Actor &owner) const
MCAPI void notifyTrade(::Actor &owner, int recipeIndex, int numTrades)
MCAPI void reloadComponent(::Actor &actor)
MCAPI void addAdditionalSaveData(::CompoundTag &tag) const
MCAPI void updateTradeTier(::Actor &owner)
MCAPI::UpdateTradePacket createDataPacket(::Actor &owner, ::ContainerID containerID)
Definition MerchantRecipeList.h:13
Definition Player.h:131
Definition UpdateTradePacket.h:19
Definition TradeTable.h:13