Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
ShareableComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated forward declare list
6// clang-format off
7class Actor;
8class ItemActor;
10class ItemStack;
11class Level;
12struct Shareable;
13// clang-format on
14
16public:
17 // member variables
18 // NOLINTBEGIN
19 ::ll::TypedStorage<8, 24, ::std::vector<::Shareable>> mItems;
20 ::ll::TypedStorage<1, 1, bool> mShareAllItems;
21 ::ll::TypedStorage<4, 4, int> mAllItemWantAmount;
22 ::ll::TypedStorage<4, 4, int> mAllItemSurplusAmount;
23 ::ll::TypedStorage<4, 4, int> mAllItemMaxAmount;
24 ::ll::TypedStorage<1, 1, bool> mSingularPickup;
25 // NOLINTEND
26
27public:
28 // member functions
29 // NOLINTBEGIN
30 MCNAPI bool _canPickupItem(
31 ::ItemStack const& item,
32 ::ItemStack const& carriedItem,
33 int maxAmount,
34 bool singularPickupOnly
35 ) const;
36
37 MCNAPI bool
38 _shouldReplaceItem(::ItemStack const& itemToReplace, ::ItemStack const& newItem, bool canPickupAnyItem) const;
39
40 MCNAPI int getCountToPickUp(::Actor const& owner, ::ItemStack const& item) const;
41
42 MCNAPI int getSlotToSwap(::Actor const& owner, ::ItemActor const& itemActor) const;
43
44 MCNAPI int hasSurplus(
45 ::Actor const& owner,
46 ::ItemStack const& item,
47 ::ItemStack& resultStack,
48 bool includeStackSizeofItem
49 ) const;
50
51 MCNAPI bool
52 itemBelongsInInventory(::Actor const& owner, ::ItemStack const& item, bool canPickupToHandOrEquipment) const;
53
54 MCNAPI int wantsMore(::Actor const& owner, ::ItemStack const& item) const;
55
56 MCNAPI bool willPickup(
57 ::Actor const& owner,
58 ::ItemStack const& item,
59 bool canPickupAnyItem,
60 bool canPickupToHandOrEquipment
61 ) const;
62 // NOLINTEND
63
64public:
65 // static functions
66 // NOLINTBEGIN
67 MCNAPI static bool _useLegacySurplusRules(::Level const& level);
68
69 MCNAPI static bool tryBuildDescriptor(::std::string_view name, ::ItemDescriptor& itemDescriptorOut);
70 // NOLINTEND
71};
Definition Actor.h:116
Definition ItemActor.h:30
Definition ItemDescriptor.h:24
Definition ItemStack.h:26
Definition Level.h:255
Definition ShareableComponent.h:15
MCAPI bool _canPickupItem(::ItemStack const &item, ::ItemStack const &carriedItem, int maxAmount, bool singularPickupOnly) const
MCAPI int getCountToPickUp(::Actor const &owner, ::ItemStack const &item) const
MCAPI int getSlotToSwap(::Actor const &owner, ::ItemActor const &itemActor) const
MCAPI int wantsMore(::Actor const &owner, ::ItemStack const &item) const
MCAPI bool willPickup(::Actor const &owner, ::ItemStack const &item, bool canPickupAnyItem, bool canPickupToHandOrEquipment) const
static MCAPI bool tryBuildDescriptor(::std::string_view name, ::ItemDescriptor &itemDescriptorOut)
MCAPI bool itemBelongsInInventory(::Actor const &owner, ::ItemStack const &item, bool canPickupToHandOrEquipment) const
MCAPI bool _shouldReplaceItem(::ItemStack const &itemToReplace, ::ItemStack const &newItem, bool canPickupAnyItem) const
MCAPI int hasSurplus(::Actor const &owner, ::ItemStack const &item, ::ItemStack &resultStack, bool includeStackSizeofItem) const
static MCAPI bool _useLegacySurplusRules(::Level const &level)
Definition Shareable.h:8