LeviLamina
Loading...
Searching...
No Matches
PlayerInteractBlockEvent.h
1
#pragma once
2
3
#include "ll/api/event/Cancellable.h"
4
#include "ll/api/event/player/PlayerClickEvent.h"
5
6
#include "mc/common/FacingID.h"
7
#include "mc/deps/core/math/Vec3.h"
8
#include "mc/world/item/ItemStack.h"
9
#include "mc/world/level/BlockPos.h"
10
#include "mc/world/level/block/Block.h"
11
12
namespace
ll::event::inline player {
13
14
class
PlayerInteractBlockEvent final :
public
Cancellable<PlayerRightClickEvent> {
15
ItemStack
& mItem;
16
BlockPos
const
& mBlockPos;
17
FacingID
const
& mFace;
18
Vec3
const
& mClickPos;
19
optional_ref<Block const>
mBlock;
20
21
public
:
22
constexpr
PlayerInteractBlockEvent(
23
Player
& player,
24
ItemStack
& item,
25
BlockPos
const
& blockPos,
26
FacingID
const
& face,
27
Vec3
const
& clickPos,
28
optional_ref<Block const>
block
29
)
30
: Cancellable(player),
31
mItem(item),
32
mBlockPos(blockPos),
33
mFace(face),
34
mClickPos(clickPos),
35
mBlock(block) {}
36
37
LLAPI
void
serialize(
CompoundTag
&)
const override
;
38
39
LLNDAPI
ItemStack
& item()
const
;
40
LLNDAPI
BlockPos
const
& blockPos()
const
;
41
LLNDAPI FacingID
const
& face()
const
;
42
LLNDAPI
Vec3
const
& clickPos()
const
;
43
LLNDAPI
optional_ref<Block const>
block()
const
;
44
};
45
}
// namespace ll::event::inline player
BlockPos
Definition
BlockPos.h:19
CompoundTag
Definition
CompoundTag.h:23
ItemStack
Definition
ItemStack.h:26
Player
Definition
Player.h:125
Vec3
Definition
Vec3.h:10
optional_ref
Definition
optional_ref.h:10
src
ll
api
event
player
PlayerInteractBlockEvent.h
Generated on
for LeviLamina by
1.16.1