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 // prevent constructor by default
27 DispenserBlock();
28
29public:
30 // virtual functions
31 // NOLINTBEGIN
32 virtual int getVariant(::Block const& block) const /*override*/;
33
34 virtual uchar getMappedFace(uchar face, ::Block const& block) const /*override*/;
35
36 virtual ::Block const&
37 getPlacementBlock(::Actor const& by, ::BlockPos const& pos, uchar face, ::Vec3 const& clickPos, int itemValue) const
38 /*override*/;
39
40 virtual void onRemove(::BlockSource& region, ::BlockPos const& pos) const /*override*/;
41
42 virtual bool isInteractiveBlock() const /*override*/;
43
44 virtual bool isContainerBlock() const /*override*/;
45
46 virtual bool hasComparatorSignal() const /*override*/;
47
48 virtual int getComparatorSignal(::BlockSource& region, ::BlockPos const& pos, ::Block const& block, uchar dir) const
49 /*override*/;
50
51 virtual int getTickDelay() const;
52
53 virtual bool allowStateMismatchOnPlacement(::Block const& clientTarget, ::Block const& serverTarget) const
54 /*override*/;
55
56 virtual void dispenseFrom(::BlockSource& region, ::BlockPos const& pos) const;
57 // NOLINTEND
58
59public:
60 // member functions
61 // NOLINTBEGIN
62 MCAPI DispenserBlock(::std::string const& nameId, int id);
63
64 MCAPI void _onRedstoneUpdate(::BlockEvents::BlockRedstoneUpdateEvent& blockEvent) const;
65
66 MCAPI ::Vec3 getDispensePosition(::BlockSource& region, ::Vec3 const& pos) const;
67
68 MCAPI void tick(::BlockEvents::BlockQueuedTickEvent& eventData) const;
69
70 MCAPI void use(::BlockEvents::BlockPlayerInteractEvent& eventData) const;
71 // NOLINTEND
72
73public:
74 // static functions
75 // NOLINTBEGIN
76 MCAPI static void dropAllItemsFromContainer(::BlockSource& region, ::BlockPos const& pos);
77
78 MCAPI static void
79 ejectItem(::BlockSource& region, ::Vec3 const& pos, uchar face, ::ItemStack const& item, int countLimit);
80
81 MCAPI static void ejectItem(
82 ::BlockSource& region,
83 ::Vec3 const& pos,
84 uchar face,
85 ::ItemStack const& item,
86 ::Container& container,
87 int slot,
88 int countLimit
89 );
90
91 MCAPI static void openInventoryContainer(::Player& player, ::BlockPos const& pos);
92 // NOLINTEND
93
94public:
95 // constructor thunks
96 // NOLINTBEGIN
97 MCAPI void* $ctor(::std::string const& nameId, int id);
98 // NOLINTEND
99
100public:
101 // virtual function thunks
102 // NOLINTBEGIN
103 MCAPI int $getVariant(::Block const& block) const;
104
105 MCAPI uchar $getMappedFace(uchar face, ::Block const& block) const;
106
107 MCFOLD ::Block const& $getPlacementBlock(
108 ::Actor const& by,
109 ::BlockPos const& pos,
110 uchar face,
111 ::Vec3 const& clickPos,
112 int itemValue
113 ) const;
114
115 MCFOLD void $onRemove(::BlockSource& region, ::BlockPos const& pos) const;
116
117 MCFOLD bool $isInteractiveBlock() const;
118
119 MCFOLD bool $isContainerBlock() const;
120
121 MCFOLD bool $hasComparatorSignal() const;
122
123 MCAPI int $getComparatorSignal(::BlockSource& region, ::BlockPos const& pos, ::Block const& block, uchar dir) const;
124
125 MCFOLD int $getTickDelay() const;
126
127 MCFOLD bool $allowStateMismatchOnPlacement(::Block const& clientTarget, ::Block const& serverTarget) const;
128
129 MCAPI void $dispenseFrom(::BlockSource& region, ::BlockPos const& pos) const;
130
131
132 // NOLINTEND
133
134public:
135 // vftables
136 // NOLINTBEGIN
137 MCAPI static void** $vftable();
138 // NOLINTEND
139};
Definition Actor.h:113
Definition BlockPlayerInteractEvent.h:18
Definition BlockQueuedTickEvent.h:16
Definition BlockRedstoneUpdateEvent.h:15
Definition BlockPos.h:17
Definition BlockSource.h:71
Definition Block.h:41
Definition Container.h:35
Definition ItemStack.h:26
Definition Player.h:129
Definition Vec3.h:10