Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
BrushableBlockActor.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/string/HashedString.h"
7#include "mc/deps/ecs/WeakEntityRef.h"
8#include "mc/world/actor/ai/util/ExpiringTick.h"
9#include "mc/world/level/block/actor/RandomizableBlockActorContainer.h"
10
11// auto generated forward declare list
12// clang-format off
13class Actor;
15class BlockPos;
16class BlockSource;
17class CompoundTag;
18class DataLoadHelper;
19class ILevel;
20class ItemStack;
21class SaveContext;
22// clang-format on
23
24class BrushableBlockActor : public ::RandomizableBlockActorContainer {
25public:
26 // BrushableBlockActor inner types define
27 enum class BrushingState : int {
28 Ongoing = 0,
29 Completed = 1,
30 };
31
32 enum class Placement : int {
33 DesertWell = 0,
34 DesertPyramid = 1,
35 ColdOceanRuin = 2,
36 WarmOceanRuin = 3,
37 TrailRuinsCommon = 4,
38 TrailRuinsRare = 5,
39 Empty = 6,
40 };
41
42public:
43 // member variables
44 // NOLINTBEGIN
45 ::ll::TypedStorage<8, 24, ::std::optional<::ExpiringTick>> mBrushReset;
46 ::ll::TypedStorage<8, 24, ::std::optional<::ExpiringTick>> mBrushCooldown;
47 ::ll::TypedStorage<8, 24, ::WeakEntityRef> mDisplayEntity;
48 ::ll::TypedStorage<8, 24, ::std::vector<::ItemStack>> mItems;
49 ::ll::TypedStorage<8, 48, ::HashedString> mBlockId;
50 ::ll::TypedStorage<4, 4, uint> mBrushCount;
51 ::ll::TypedStorage<1, 1, uchar> mBrushDirection;
52 ::ll::TypedStorage<1, 1, bool> mLootTableUnpacked;
53 // NOLINTEND
54
55public:
56 // prevent constructor by default
57 BrushableBlockActor();
58
59public:
60 // virtual functions
61 // NOLINTBEGIN
62 virtual ~BrushableBlockActor() /*override*/ = default;
63
64 virtual void serverInitItemStackIds(
65 int containerSlot,
66 int count,
67 ::std::function<void(int, ::ItemStack const&)> onNetIdChanged
68 ) /*override*/;
69
70 virtual int getContainerSize() const /*override*/;
71
72 virtual int getMaxStackSize() const /*override*/;
73
74 virtual ::ItemStack const& getItem(int slot) const /*override*/;
75
76 virtual void setItem(int slot, ::ItemStack const& item) /*override*/;
77
78 virtual void stopOpen(::Actor& actor) /*override*/;
79
80 virtual void onChanged(::BlockSource& region) /*override*/;
81
82 virtual void onRemoved(::BlockSource& region) /*override*/;
83
84 virtual void load(::ILevel& level, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper) /*override*/;
85
86 virtual bool save(::CompoundTag& tag, ::SaveContext const& saveContext) const /*override*/;
87
88 virtual ::std::unique_ptr<::BlockActorDataPacket> _getUpdatePacket(::BlockSource&) /*override*/;
89
90 virtual void _onUpdatePacket(::CompoundTag const& data, ::BlockSource& region) /*override*/;
91 // NOLINTEND
92
93public:
94 // member functions
95 // NOLINTBEGIN
96 MCNAPI
97 BrushableBlockActor(::HashedString const& name, ::BlockPos const& pos, ::BrushableBlockActor::Placement placement);
98
99 MCNAPI void _brushingCompleted(::BlockSource& region);
100
102
103 MCNAPI ::BrushableBlockActor::BrushingState brush(::BlockSource& region, ::BlockPos const& pos, uchar face);
104
105#ifdef LL_PLAT_C
106 MCNAPI ::Actor* tryGetOrCreateDisplayEntity(::BlockSource& region);
107#endif
108
109 MCNAPI void update(::BlockSource& region, ::BlockPos const& pos);
110 // NOLINTEND
111
112public:
113 // static functions
114 // NOLINTBEGIN
115 MCNAPI static ::std::string getLootTableFromVariant(::BrushableBlockActor::Placement state);
116 // NOLINTEND
117
118public:
119 // constructor thunks
120 // NOLINTBEGIN
121 MCNAPI void* $ctor(::HashedString const& name, ::BlockPos const& pos, ::BrushableBlockActor::Placement placement);
122 // NOLINTEND
123
124public:
125 // virtual function thunks
126 // NOLINTBEGIN
128 int containerSlot,
129 int count,
130 ::std::function<void(int, ::ItemStack const&)> onNetIdChanged
131 );
132
133 MCNAPI int $getContainerSize() const;
134
135 MCNAPI int $getMaxStackSize() const;
136
137 MCNAPI ::ItemStack const& $getItem(int slot) const;
138
139 MCNAPI void $setItem(int slot, ::ItemStack const& item);
140
141 MCNAPI void $stopOpen(::Actor& actor);
142
143 MCNAPI void $onChanged(::BlockSource& region);
144
145 MCNAPI void $onRemoved(::BlockSource& region);
146
147 MCNAPI void $load(::ILevel& level, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper);
148
149 MCNAPI bool $save(::CompoundTag& tag, ::SaveContext const& saveContext) const;
150
151 MCNAPI ::std::unique_ptr<::BlockActorDataPacket> $_getUpdatePacket(::BlockSource&);
152
153 MCNAPI void $_onUpdatePacket(::CompoundTag const& data, ::BlockSource& region);
154
155
156 // NOLINTEND
157};
Definition Actor.h:116
Definition BlockActorDataPacket.h:19
Definition BlockPos.h:14
Definition BlockSource.h:72
MCAPI void $serverInitItemStackIds(int containerSlot, int count, ::std::function< void(int, ::ItemStack const &)> onNetIdChanged)
MCAPI::BrushableBlockActor::BrushingState brush(::BlockSource &region, ::BlockPos const &pos, uchar face)
MCAPI int $getMaxStackSize() const
MCAPI void $_onUpdatePacket(::CompoundTag const &data, ::BlockSource &region)
MCAPI void update(::BlockSource &region, ::BlockPos const &pos)
MCAPI ::std::unique_ptr<::BlockActorDataPacket > $_getUpdatePacket(::BlockSource &)
MCAPI void _removeDisplayEntity(::BlockSource &region)
MCAPI BrushableBlockActor(::HashedString const &name, ::BlockPos const &pos, ::BrushableBlockActor::Placement placement)
MCAPI void $setItem(int slot, ::ItemStack const &item)
MCAPI void * $ctor(::HashedString const &name, ::BlockPos const &pos, ::BrushableBlockActor::Placement placement)
MCAPI void $stopOpen(::Actor &actor)
MCAPI void $load(::ILevel &level, ::CompoundTag const &tag, ::DataLoadHelper &dataLoadHelper)
MCAPI bool $save(::CompoundTag &tag, ::SaveContext const &saveContext) const
MCAPI::ItemStack const & $getItem(int slot) const
static MCAPI ::std::string getLootTableFromVariant(::BrushableBlockActor::Placement state)
MCAPI void $onChanged(::BlockSource &region)
MCAPI void _brushingCompleted(::BlockSource &region)
MCAPI int $getContainerSize() const
MCAPI void $onRemoved(::BlockSource &region)
Definition CompoundTag.h:18
Definition DataLoadHelper.h:20
Definition HashedString.h:5
Definition ILevel.h:223
Definition ItemStack.h:26
Definition SaveContext.h:5