Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
HopperBlockActor.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/shared_types/legacy/ContainerType.h"
7#include "mc/world/Container.h"
8#include "mc/world/actor/Hopper.h"
9#include "mc/world/item/ItemStack.h"
10#include "mc/world/level/Tick.h"
11#include "mc/world/level/block/actor/VanillaBlockActor.h"
12
13// auto generated forward declare list
14// clang-format off
15class Actor;
17class BlockPos;
18class BlockSource;
19class CompoundTag;
20class DataLoadHelper;
22class ILevel;
23class SaveContext;
24// clang-format on
25
26class HopperBlockActor : public ::VanillaBlockActor, public ::Container, public ::Hopper {
27public:
28 // member variables
29 // NOLINTBEGIN
30 ::ll::TypedStorage<8, 760, ::ItemStack[5]> mItems;
31 ::ll::TypedStorage<8, 8, ::Tick> mLastTick;
32 // NOLINTEND
33
34public:
35 // prevent constructor by default
36 HopperBlockActor();
37
38public:
39 // virtual functions
40 // NOLINTBEGIN
41 virtual void tick(::BlockSource& region) /*override*/;
42
43 virtual void load(::ILevel& level, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper) /*override*/;
44
45 virtual bool save(::CompoundTag& tag, ::SaveContext const& saveContext) const /*override*/;
46
47 virtual ::ItemStack const& getItem(int slot) const /*override*/;
48
49 virtual void setItem(int slot, ::ItemStack const& item) /*override*/;
50
51 virtual ::std::string getName() const /*override*/;
52
53 virtual int getContainerSize() const /*override*/;
54
55 virtual int getMaxStackSize() const /*override*/;
56
57 virtual void startOpen(::Actor&) /*override*/;
58
59 virtual void stopOpen(::Actor& actor) /*override*/;
60
61 virtual ::Container* getContainer() /*override*/;
62
63 virtual ::Container const* getContainer() const /*override*/;
64
65 virtual void setContainerChanged(int slot) /*override*/;
66
67 virtual void onRemoved(::BlockSource&) /*override*/;
68
69 virtual void onNeighborChanged(::BlockSource& region, ::BlockPos const&) /*override*/;
70
71 virtual void onMove() /*override*/;
72
73 virtual void serverInitItemStackIds(
74 int containerSlot,
75 int count,
76 ::std::function<void(int, ::ItemStack const&)> onNetIdChanged
77 ) /*override*/;
78
79 virtual ::std::unique_ptr<::BlockActorDataPacket> _getUpdatePacket(::BlockSource&) /*override*/;
80
81 virtual void _onUpdatePacket(::CompoundTag const& data, ::BlockSource&) /*override*/;
82 // NOLINTEND
83
84public:
85 // member functions
86 // NOLINTBEGIN
87 MCNAPI explicit HopperBlockActor(::BlockPos const& pos);
88
89 MCNAPI int _countItems() const;
90
91 MCAPI void _tick(::BlockSource& region, int maxRecursion);
92
93 MCNAPI ::FurnaceBlockActor* getAttachedFurnace(::BlockSource& region);
94
96
97 MCNAPI bool isAttachedToContainerType(::BlockSource& region, ::SharedTypes::Legacy::ContainerType containerType);
98
99 MCNAPI bool isSourceOfContainerType(::BlockSource& region, ::SharedTypes::Legacy::ContainerType containerType);
100 // NOLINTEND
101
102public:
103 // constructor thunks
104 // NOLINTBEGIN
105 MCNAPI void* $ctor(::BlockPos const& pos);
106 // NOLINTEND
107
108public:
109 // virtual function thunks
110 // NOLINTBEGIN
111 MCNAPI void $tick(::BlockSource& region);
112
113 MCNAPI void $load(::ILevel& level, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper);
114
115 MCNAPI bool $save(::CompoundTag& tag, ::SaveContext const& saveContext) const;
116
117 MCAPI ::ItemStack const& $getItem(int slot) const;
118
119 MCAPI void $setItem(int slot, ::ItemStack const& item);
120
121 MCNAPI ::std::string $getName() const;
122
123 MCNAPI int $getContainerSize() const;
124
125 MCNAPI int $getMaxStackSize() const;
126
127 MCNAPI void $startOpen(::Actor&);
128
129 MCNAPI void $stopOpen(::Actor& actor);
130
131 MCNAPI ::Container* $getContainer();
132
133 MCNAPI ::Container const* $getContainer() const;
134
135 MCNAPI void $setContainerChanged(int slot);
136
138
139 MCNAPI void $onNeighborChanged(::BlockSource& region, ::BlockPos const&);
140
141 MCNAPI void $onMove();
142
144 int containerSlot,
145 int count,
146 ::std::function<void(int, ::ItemStack const&)> onNetIdChanged
147 );
148
149 MCNAPI ::std::unique_ptr<::BlockActorDataPacket> $_getUpdatePacket(::BlockSource&);
150
151 MCNAPI void $_onUpdatePacket(::CompoundTag const& data, ::BlockSource&);
152
153
154 // NOLINTEND
155};
Definition Actor.h:116
Definition BlockActorDataPacket.h:19
Definition BlockPos.h:14
Definition BlockSource.h:72
Definition CompoundTag.h:18
Definition DataLoadHelper.h:20
Definition FurnaceBlockActor.h:33
MCAPI void $setContainerChanged(int slot)
MCAPI::std::string $getName() const
MCAPI bool isAttachedToChestAndFurnace(::BlockSource &region)
MCAPI ::std::unique_ptr<::BlockActorDataPacket > $_getUpdatePacket(::BlockSource &)
MCAPI void $load(::ILevel &level, ::CompoundTag const &tag, ::DataLoadHelper &dataLoadHelper)
MCAPI void $onRemoved(::BlockSource &)
MCAPI void $startOpen(::Actor &)
MCAPI void * $ctor(::BlockPos const &pos)
MCAPI void $onMove()
MCAPI int $getContainerSize() const
MCAPI void $stopOpen(::Actor &actor)
MCAPI::FurnaceBlockActor * getAttachedFurnace(::BlockSource &region)
MCAPI void $onNeighborChanged(::BlockSource &region, ::BlockPos const &)
MCAPI::Container * $getContainer()
MCAPI int _countItems() const
MCAPI bool isAttachedToContainerType(::BlockSource &region, ::SharedTypes::Legacy::ContainerType containerType)
MCAPI HopperBlockActor(::BlockPos const &pos)
MCAPI bool $save(::CompoundTag &tag, ::SaveContext const &saveContext) const
MCAPI void $_onUpdatePacket(::CompoundTag const &data, ::BlockSource &)
MCAPI int $getMaxStackSize() const
MCAPI void $tick(::BlockSource &region)
MCAPI void $serverInitItemStackIds(int containerSlot, int count, ::std::function< void(int, ::ItemStack const &)> onNetIdChanged)
MCAPI bool isSourceOfContainerType(::BlockSource &region, ::SharedTypes::Legacy::ContainerType containerType)
MCAPI::Container const * $getContainer() const
Definition Hopper.h:17
Definition ILevel.h:223
Definition ItemStack.h:26
Definition SaveContext.h:5