3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/deps/shared_types/legacy/LevelSoundEvent.h"
7#include "mc/legacy/ActorUniqueID.h"
8#include "mc/world/level/BlockPos.h"
9#include "mc/world/level/block/ChestType.h"
10#include "mc/world/level/block/actor/BlockActorRendererId.h"
11#include "mc/world/level/block/actor/BlockActorType.h"
12#include "mc/world/level/block/actor/RandomizableBlockActorFillingContainer.h"
33class ChestBlockActor :
public ::RandomizableBlockActorFillingContainer {
45 ::ll::TypedStorage<8, 8, ::ChestBlockActor&> mChest;
46 ::ll::TypedStorage<1, 1, bool> mIsUsed;
47 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mActorId;
52 ChestCloser& operator=(ChestCloser
const&);
53 ChestCloser(ChestCloser
const&);
66 ::ll::TypedStorage<4, 4, float> mSpeed;
67 ::ll::TypedStorage<1, 1, bool> mIsGlobalChest;
68 ::ll::TypedStorage<1, 1, bool> mAlwayCheckObstructionComponent;
69 ::ll::TypedStorage<4, 4, float> mObstructionHeight;
71 ::ll::TypedStorage<4, 4, float> mOpenness;
72 ::ll::TypedStorage<4, 4, float> mOldOpenness;
73 ::ll::TypedStorage<1, 1, bool> mIsOpen;
74 ::ll::TypedStorage<4, 4, int> mTickInterval;
75 bool mPairingChanged : 1;
77 bool mDeferredPairLoad : 1;
79 ::ll::TypedStorage<4, 4, int> mDeferredPairX;
80 ::ll::TypedStorage<4, 4, int> mDeferredPairZ;
81 ::ll::TypedStorage<8, 8, ::ChestBlockActor*> mLargeChestPaired;
82 ::ll::TypedStorage<4, 12, ::BlockPos> mLargeChestPairedPosition;
83 ::ll::TypedStorage<1, 2, ::std::optional<::ChestType>> mChestType;
84 ::ll::TypedStorage<1, 1, bool> mIsFindable;
85 ::ll::TypedStorage<8, 64, ::std::unordered_set<::ActorUniqueID>> mOpenedByIds;
86 ::ll::TypedStorage<4, 4, int> mUpdateFlags;
87 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::ChestBlockActor::ChestCloser>>> mChestClosers;
97 virtual ~ChestBlockActor() ;
99 virtual bool isTypeOrDerived(::BlockActorType type)
const ;
101 virtual int getContainerSize() const ;
103 virtual
int getMaxStackSize() const ;
105 virtual ::
std::
string getName() const ;
107 virtual ::
ItemStack const& getItem(
int slot) const ;
109 virtual
void setItem(
int slot, ::
ItemStack const& item) ;
111 virtual
void setItemWithForceBalance(
int slot, ::
ItemStack const& item,
bool forceBalanced) ;
113 virtual
void serverInitItemStackIds(
116 ::
std::function<
void(
int, ::
ItemStack const&)> onNetIdChanged
127 virtual
bool saveItemInstanceData(::
CompoundTag& base) const ;
131 virtual
void triggerEvent(
int b0,
int b1) ;
133 virtual
void startOpen(::
Actor& actor) ;
137 virtual
void stopOpen(::
Actor& actor) ;
146 virtual
int clearInventory(
int resizeTo) ;
148 virtual ::Container* getContainer() ;
150 virtual ::Container const* getContainer() const ;
152 virtual
void onMove() ;
156 virtual
void openBy(::
Player& p);
158 virtual
void setContainerChanged(
int slot) ;
160 virtual
bool canPushInItem(
int slot,
int face, ::
ItemStack const& item) const ;
162 virtual
bool canPullOutItem(
int,
int, ::
ItemStack const&) const ;
164 virtual
void getDebugText(
165 ::
std::vector<::
std::
string>& outputInfo,
174 virtual
void initializeContainerContents(::
BlockSource& region) ;
182 virtual
bool _canOpenThis(::
BlockSource& region) const;
184 virtual ::
AABB getObstructionAABB() const;
186 virtual
bool _detectEntityObstruction(::
BlockSource& region) const;
188 virtual ::SharedTypes::Legacy::LevelSoundEvent getOpenSound() const;
190 virtual ::SharedTypes::Legacy::LevelSoundEvent getCloseSound() const;
196 MCNAPI ChestBlockActor(
197 ::BlockActorType type,
198 ::BlockActorRendererId renderId,
199 ::
std::optional<::ChestType> chestType,
205 MCAPI
void _pairWith(::ChestBlockActor* chest, ::
BlockSource& region,
bool isLead);
221 MCNAPI static ::
std::unique_ptr<::ChestBlockActor>
229 ::BlockActorType type,
230 ::BlockActorRendererId renderId,
231 ::
std::optional<::ChestType> chestType,
262 ::
std::function<
void(
int, ::
ItemStack const&)> onNetIdChanged
279 MCAPI
void $startOpen(::
Actor& actor);
310 ::
std::vector<::
std::
string>& outputInfo,
327 MCAPI
bool $_canOpenThis(::
BlockSource& region) const;
331 MCAPI
bool $_detectEntityObstruction(::
BlockSource& region) const;
Definition BlockActorDataPacket.h:19
Definition BlockActor.h:30
Definition BlockSource.h:72
Definition ChestBlockActor.h:41
MCAPI bool $canPullOutItem(int, int, ::ItemStack const &) const
static MCAPI void ** $vftableForIVanillaMainBlockActorComponent()
MCAPI void $_onUpdatePacket(::CompoundTag const &data, ::BlockSource ®ion)
MCAPI int $clearInventory(int resizeTo)
MCAPI bool $isTypeOrDerived(::BlockActorType type) const
MCAPI void $setItem(int slot, ::ItemStack const &item)
MCAPI::AABB $getObstructionAABB() const
MCAPI::SharedTypes::Legacy::LevelSoundEvent $getOpenSound() const
static MCAPI void ** $vftableForIVanillaTickBlockActorComponent()
MCAPI void unpair(::BlockSource ®ion)
MCAPI::std::string $getName() const
MCAPI bool $canPushInItem(int slot, int face, ::ItemStack const &item) const
MCAPI::IVanillaRenderBlockActorComponent * $getCrackEntity(::BlockSource ®ion, ::BlockPos const &pos)
MCAPI void $onRemoved(::BlockSource ®ion)
MCAPI int $getContainerSize() const
MCAPI void $removeContentChangeListener(::ContainerContentChangeListener *listener)
MCAPI void _closeChest(::BlockSource ®ion, ::Actor *actor)
static MCAPI void ** $vftableForIVanillaRenderBlockActorComponent()
MCAPI bool $save(::CompoundTag &tag, ::SaveContext const &saveContext) const
MCAPI void $setItemWithForceBalance(int slot, ::ItemStack const &item, bool forceBalanced)
MCAPI::SharedTypes::Legacy::LevelSoundEvent $getCloseSound() const
MCAPI bool $saveItems(::CompoundTag &base, ::SaveContext const &saveContext) const
MCAPI::Container * $getContainer()
MCAPI void $triggerEvent(int b0, int b1)
MCAPI void $addContentChangeListener(::ContainerContentChangeListener *listener)
MCAPI void $serverInitItemStackIds(int containerSlot, int count, ::std::function< void(int, ::ItemStack const &)> onNetIdChanged)
MCAPI ::std::weak_ptr<::ChestBlockActor::ChestCloser > getChestCloser(::Actor &closingActor)
MCAPI void $onNeighborChanged(::BlockSource ®ion, ::BlockPos const &position)
MCAPI void $onPlace(::BlockSource ®ion)
MCAPI void $loadItems(::CompoundTag const &base, ::ILevel &level)
static MCAPI ::std::unique_ptr<::ChestBlockActor > createChestBlockEntity(::std::optional<::ChestType > const &chestType, ::BlockPos const &pos)
static MCAPI void ** $vftable()
MCAPI void $stopOpen(::Actor &actor)
MCAPI void $initializeContainerContents(::BlockSource ®ion)
static MCAPI void ** $vftableForBlockActor()
MCAPI int $getMaxStackSize() const
MCAPI void $getDebugText(::std::vector<::std::string > &outputInfo, ::BlockPos const &debugPos, ::BlockSource const *region) const
MCAPI ::std::unique_ptr<::BlockActorDataPacket > $_getUpdatePacket(::BlockSource ®ion)
MCAPI void $load(::ILevel &level, ::CompoundTag const &base, ::DataLoadHelper &dataLoadHelper)
MCAPI void $setContainerChanged(int slot)
MCAPI bool _saveClientSideState(::CompoundTag &tag, ::SaveContext const &saveContext) const
MCAPI void $onChanged(::BlockSource ®ion)
MCAPI void $openBy(::Player &p)
MCAPI bool $saveItemInstanceData(::CompoundTag &base) const
MCAPI::ItemStack const & $getItem(int slot) const
MCAPI void $receiveContainerLifetimes(::DynamicContainerTracker const &tracker)
MCAPI void * $ctor(::BlockActorType type, ::BlockActorRendererId renderId, ::std::optional<::ChestType > chestType, ::BlockPos const &pos)
Definition CompoundTag.h:18
Definition ContainerContentChangeListener.h:5
Definition Container.h:36
Definition DataLoadHelper.h:20
Definition DynamicContainerTracker.h:20
Definition IVanillaRenderBlockActorComponent.h:19
Definition ItemStack.h:26
Definition SaveContext.h:5