LeviLamina
Loading...
Searching...
No Matches
JukeboxBlockActor.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/shared_types/legacy/LevelSoundEvent.h"
7#include "mc/world/item/ItemStack.h"
8#include "mc/world/level/block/actor/RandomizableBlockActorContainer.h"
9
10// auto generated forward declare list
11// clang-format off
12class Actor;
14class BlockPos;
15class BlockSource;
16class CompoundTag;
17class Container;
18class DataLoadHelper;
19class ILevel;
20class Level;
21class SaveContext;
22// clang-format on
23
24class JukeboxBlockActor : public ::RandomizableBlockActorContainer {
25public:
26 // member variables
27 // NOLINTBEGIN
28 ::ll::TypedStorage<8, 152, ::ItemStack> mRecord;
29 ::ll::TypedStorage<4, 4, int> mCount;
30 ::ll::TypedStorage<1, 1, bool> mRecordingFinished;
31 ::ll::TypedStorage<4, 4, int> mTicksPlaying;
32 ::ll::TypedStorage<1, 1, bool> mPostBlockChangeGameEvent;
33 // NOLINTEND
34
35public:
36 // prevent constructor by default
37 JukeboxBlockActor();
38
39public:
40 // virtual functions
41 // NOLINTBEGIN
42 virtual bool save(::CompoundTag& tag, ::SaveContext const& saveContext) const /*override*/;
43
44 virtual void load(::ILevel& level, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper) /*override*/;
45
46 virtual void tick(::BlockSource& region) /*override*/;
47
48 virtual int getContainerSize() const /*override*/;
49
50 virtual int getMaxStackSize() const /*override*/;
51
52 virtual bool canPushInItem(int item, int, ::ItemStack const&) const /*override*/;
53
54 virtual bool canPullOutItem(int, int, ::ItemStack const&) const /*override*/;
55
56 virtual ::ItemStack const& getItem(int) const /*override*/;
57
58 virtual void setItem(int slot, ::ItemStack const& item) /*override*/;
59
60 virtual void startOpen(::Actor& actor) /*override*/;
61
62 virtual void stopOpen(::Actor& actor) /*override*/;
63
64 virtual ::Container* getContainer() /*override*/;
65
66 virtual ::Container const* getContainer() const /*override*/;
67
68 virtual void onChanged(::BlockSource& region) /*override*/;
69
70 virtual void serverInitItemStackIds(
71 int containerSlot,
72 int onNetIdChanged,
73 ::std::function<void(int, ::ItemStack const&)>
74 ) /*override*/;
75
76 virtual ::std::unique_ptr<::BlockActorDataPacket> _getUpdatePacket(::BlockSource&) /*override*/;
77
78 virtual void _onUpdatePacket(::CompoundTag const& data, ::BlockSource& region) /*override*/;
79 // NOLINTEND
80
81public:
82 // member functions
83 // NOLINTBEGIN
84 MCAPI explicit JukeboxBlockActor(::BlockPos const& pos);
85
86 MCAPI void _onChanged(::BlockSource& region, ::SharedTypes::Legacy::LevelSoundEvent sound);
87
88 MCAPI void _spawnMusicParticles(::Level& level, float recordDuration);
89
90 MCAPI void ejectRecord(::BlockSource& region);
91
92 MCFOLD ::ItemStack const& getRecord() const;
93
94#ifdef LL_PLAT_C
95 MCAPI bool hasRecord() const;
96#endif
97
98 MCAPI bool isRecordPlaying() const;
99
100 MCAPI void setRecord(::ItemStack const& record, bool startPlaying);
101
102 MCAPI void startPlayingRecord(::BlockSource& region);
103
104 MCAPI void stopPlayingRecord(::BlockSource& region);
105 // NOLINTEND
106
107public:
108 // constructor thunks
109 // NOLINTBEGIN
110 MCAPI void* $ctor(::BlockPos const& pos);
111 // NOLINTEND
112
113public:
114 // virtual function thunks
115 // NOLINTBEGIN
116 MCAPI bool $save(::CompoundTag& tag, ::SaveContext const& saveContext) const;
117
118 MCAPI void $load(::ILevel& level, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper);
119
120 MCAPI void $tick(::BlockSource& region);
121
122 MCFOLD int $getContainerSize() const;
123
124 MCFOLD int $getMaxStackSize() const;
125
126 MCAPI bool $canPushInItem(int item, int, ::ItemStack const&) const;
127
128 MCAPI bool $canPullOutItem(int, int, ::ItemStack const&) const;
129
130 MCFOLD ::ItemStack const& $getItem(int) const;
131
132 MCAPI void $setItem(int slot, ::ItemStack const& item);
133
134 MCFOLD void $startOpen(::Actor& actor);
135
136 MCFOLD void $stopOpen(::Actor& actor);
137
138 MCFOLD ::Container* $getContainer();
139
140 MCFOLD ::Container const* $getContainer() const;
141
142 MCAPI void $onChanged(::BlockSource& region);
143
144 MCAPI void
145 $serverInitItemStackIds(int containerSlot, int onNetIdChanged, ::std::function<void(int, ::ItemStack const&)>);
146
147 MCAPI ::std::unique_ptr<::BlockActorDataPacket> $_getUpdatePacket(::BlockSource&);
148
149 MCAPI void $_onUpdatePacket(::CompoundTag const& data, ::BlockSource& region);
150
151
152 // NOLINTEND
153
154public:
155 // vftables
156 // NOLINTBEGIN
157 MCAPI static void** $vftableForContainer();
158
159 MCAPI static void** $vftableForRandomizableBlockActorContainerBase();
160 // NOLINTEND
161};
Definition Actor.h:125
Definition BlockActorDataPacket.h:19
Definition BlockPos.h:21
Definition BlockSource.h:73
Definition CompoundTag.h:23
Definition Container.h:34
Definition DataLoadHelper.h:20
Definition ILevel.h:219
Definition ItemStack.h:35
Definition Level.h:255
Definition SaveContext.h:5