Skip to content
LeviMC
English
AutoLightDark
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 // NOLINTEND
54
55public:
56 // member functions
57 // NOLINTBEGIN
59
60 MCNAPI ::Vec3 getDispensePosition(::BlockSource& region, ::Vec3 const& pos) const;
61
62 MCNAPI void tick(::BlockEvents::BlockQueuedTickEvent& eventData) const;
63
64 MCNAPI void use(::BlockEvents::BlockPlayerInteractEvent& eventData) const;
65 // NOLINTEND
66
67public:
68 // static functions
69 // NOLINTBEGIN
70 MCNAPI static void dropAllItemsFromContainer(::BlockSource& region, ::BlockPos const& pos);
71
72 MCAPI static void
73 ejectItem(::BlockSource& region, ::Vec3 const& pos, uchar face, ::ItemStack const& item, int countLimit);
74
75 MCAPI static void ejectItem(
76 ::BlockSource& region,
77 ::Vec3 const& pos,
78 uchar face,
79 ::ItemStack const& item,
80 ::Container& container,
81 int slot,
82 int countLimit
83 );
84
85 MCNAPI static void openInventoryContainer(::Player& player, ::BlockPos const& pos);
86 // NOLINTEND
87
88public:
89 // virtual function thunks
90 // NOLINTBEGIN
91 MCNAPI int $getVariant(::Block const& block) const;
92
93 MCNAPI uchar $getMappedFace(uchar face, ::Block const& block) const;
94
95 MCNAPI ::Block const& $getPlacementBlock(
96 ::Actor const& by,
97 ::BlockPos const& pos,
98 uchar face,
99 ::Vec3 const& clickPos,
100 int itemValue
101 ) const;
102
103 MCNAPI void $onRemove(::BlockSource& region, ::BlockPos const& pos) const;
104
105 MCNAPI bool $isInteractiveBlock() const;
106
107 MCNAPI bool $isContainerBlock() const;
108
109 MCNAPI bool $hasComparatorSignal() const;
110
111 MCNAPI int
112 $getComparatorSignal(::BlockSource& region, ::BlockPos const& pos, ::Block const& block, uchar dir) const;
113
114 MCNAPI int $getTickDelay() const;
115
116 MCNAPI bool $allowStateMismatchOnPlacement(::Block const& clientTarget, ::Block const& serverTarget) const;
117
118 MCAPI void $dispenseFrom(::BlockSource& region, ::BlockPos const& pos) const;
119
120
121 // NOLINTEND
122
123public:
124 // vftables
125 // NOLINTBEGIN
126 MCNAPI static void** $vftable();
127 // NOLINTEND
128};
Definition Actor.h:116
Definition BlockPlayerInteractEvent.h:18
Definition BlockQueuedTickEvent.h:16
Definition BlockRedstoneUpdateEvent.h:15
Definition BlockPos.h:14
Definition BlockSource.h:72
Definition Block.h:42
Definition Container.h:36
Definition DispenserBlock.h:24
MCAPI::Block const & $getPlacementBlock(::Actor const &by, ::BlockPos const &pos, uchar face, ::Vec3 const &clickPos, int itemValue) const
MCAPI uchar $getMappedFace(uchar face, ::Block const &block) const
MCAPI bool $isInteractiveBlock() const
MCAPI bool $isContainerBlock() const
MCAPI void use(::BlockEvents::BlockPlayerInteractEvent &eventData) const
MCAPI bool $allowStateMismatchOnPlacement(::Block const &clientTarget, ::Block const &serverTarget) const
MCAPI int $getComparatorSignal(::BlockSource &region, ::BlockPos const &pos, ::Block const &block, uchar dir) const
MCAPI int $getVariant(::Block const &block) const
MCAPI void $onRemove(::BlockSource &region, ::BlockPos const &pos) const
MCAPI void _onRedstoneUpdate(::BlockEvents::BlockRedstoneUpdateEvent &blockEvent) const
MCAPI::Vec3 getDispensePosition(::BlockSource &region, ::Vec3 const &pos) const
MCAPI int $getTickDelay() const
static MCAPI void dropAllItemsFromContainer(::BlockSource &region, ::BlockPos const &pos)
static MCAPI void ** $vftable()
MCAPI void tick(::BlockEvents::BlockQueuedTickEvent &eventData) const
static MCAPI void openInventoryContainer(::Player &player, ::BlockPos const &pos)
MCAPI bool $hasComparatorSignal() const
Definition ItemStack.h:26
Definition Player.h:131
Definition Vec3.h:10