LeviLamina
Loading...
Searching...
No Matches
DispenserBlock.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/level/block/ActorBlockBase.h"
7#include "mc/world/level/block/BlockType.h"
8
9// auto generated forward declare list
10// clang-format off
11class Actor;
12class Block;
13class BlockPos;
14class BlockSource;
15class Container;
16class ItemStack;
17class Player;
18class Vec3;
19namespace BlockEvents { class BlockPlayerInteractEvent; }
20namespace BlockEvents { class BlockQueuedTickEvent; }
21namespace BlockEvents { class BlockRedstoneUpdateEvent; }
22// clang-format on
23
24class DispenserBlock : public ::ActorBlock {
25public:
26 // virtual functions
27 // NOLINTBEGIN
28 virtual int getVariant(::Block const& block) const /*override*/;
29
30 virtual uchar getMappedFace(uchar face, ::Block const& block) const /*override*/;
31
32 virtual ::Block const&
33 getPlacementBlock(::Actor const& by, ::BlockPos const& pos, uchar face, ::Vec3 const& clickPos, int itemValue) const
34 /*override*/;
35
36 virtual void onRemove(::BlockSource& region, ::BlockPos const& pos) const /*override*/;
37
38 virtual bool isInteractiveBlock() const /*override*/;
39
40 virtual bool isContainerBlock() const /*override*/;
41
42 virtual bool hasComparatorSignal() const /*override*/;
43
44 virtual int getComparatorSignal(::BlockSource& region, ::BlockPos const& pos, ::Block const& block, uchar dir) const
45 /*override*/;
46
47 virtual int getTickDelay() const;
48
49 virtual bool allowStateMismatchOnPlacement(::Block const& clientTarget, ::Block const& serverTarget) const
50 /*override*/;
51
52 virtual void dispenseFrom(::BlockSource& region, ::BlockPos const& pos) const;
53
54 virtual ~DispenserBlock() /*override*/ = default;
55 // NOLINTEND
56
57public:
58 // member functions
59 // NOLINTBEGIN
60 MCAPI void _onRedstoneUpdate(::BlockEvents::BlockRedstoneUpdateEvent& blockEvent) const;
61
62 MCAPI void ejectItem(
63 ::BlockSource& region,
64 ::Vec3 const& pos,
65 uchar face,
66 ::ItemStack const& item,
67 ::Container& container,
68 int slot,
69 int countLimit
70 ) const;
71
72 MCAPI ::Vec3 getDispensePosition(::BlockSource& region, ::Vec3 const& pos) const;
73
74 MCAPI void tick(::BlockEvents::BlockQueuedTickEvent& eventData) const;
75
76 MCFOLD void use(::BlockEvents::BlockPlayerInteractEvent& eventData) const;
77 // NOLINTEND
78
79public:
80 // static functions
81 // NOLINTBEGIN
82 MCAPI static void dropAllItemsFromContainer(::BlockSource& region, ::BlockPos const& pos);
83
84 MCAPI static void
85 ejectItem(::BlockSource& region, ::Vec3 const& pos, uchar face, ::ItemStack const& item, int countLimit);
86
87 MCAPI static void openInventoryContainer(::Player& player, ::BlockPos const& pos);
88 // NOLINTEND
89
90public:
91 // virtual function thunks
92 // NOLINTBEGIN
93 MCAPI int $getVariant(::Block const& block) const;
94
95 MCAPI uchar $getMappedFace(uchar face, ::Block const& block) const;
96
97 MCAPI ::Block const& $getPlacementBlock(
98 ::Actor const& by,
99 ::BlockPos const& pos,
100 uchar face,
101 ::Vec3 const& clickPos,
102 int itemValue
103 ) const;
104
105 MCFOLD void $onRemove(::BlockSource& region, ::BlockPos const& pos) const;
106
107 MCFOLD bool $isInteractiveBlock() const;
108
109 MCFOLD bool $isContainerBlock() const;
110
111 MCFOLD bool $hasComparatorSignal() const;
112
113 MCFOLD int
114 $getComparatorSignal(::BlockSource& region, ::BlockPos const& pos, ::Block const& block, uchar dir) const;
115
116 MCFOLD int $getTickDelay() const;
117
118 MCFOLD bool $allowStateMismatchOnPlacement(::Block const& clientTarget, ::Block const& serverTarget) const;
119
120 MCAPI void $dispenseFrom(::BlockSource& region, ::BlockPos const& pos) const;
121
122
123 // NOLINTEND
124
125public:
126 // vftables
127 // NOLINTBEGIN
128 MCAPI static void** $vftable();
129 // NOLINTEND
130};
Definition Actor.h:106
Definition BlockPlayerInteractEvent.h:17
Definition BlockQueuedTickEvent.h:16
Definition BlockRedstoneUpdateEvent.h:15
Definition BlockPos.h:19
Definition BlockSource.h:71
Definition Block.h:43
Definition Container.h:33
Definition DispenserBlock.h:24
Definition ItemStack.h:26
Definition Player.h:129
Definition Vec3.h:10