LeviLamina
Loading...
Searching...
No Matches
PlayerPlaceBlockEvent.h
1
#pragma once
2
3
#include "ll/api/event/Cancellable.h"
4
#include "ll/api/event/player/PlayerClickEvent.h"
5
6
#include "mc/world/actor/player/Player.h"
7
#include "mc/world/level/BlockPos.h"
8
#include "mc/world/level/block/Block.h"
9
10
namespace
ll::event::inline player {
11
12
class
PlayerPlaceBlockEvent :
public
PlayerRightClickEvent {
13
BlockPos
const
& mPos;
14
15
protected
:
16
constexpr
explicit
PlayerPlaceBlockEvent(
Player
& player,
BlockPos
const
& pos)
17
: PlayerRightClickEvent(player),
18
mPos(pos) {}
19
20
public
:
21
LLAPI
void
serialize(
CompoundTag
&)
const override
;
22
23
LLNDAPI
BlockPos
const
& pos()
const
;
24
};
25
26
class
PlayerPlacingBlockEvent final :
public
Cancellable<PlayerPlaceBlockEvent> {
27
uchar
const
& mFace;
28
29
public
:
30
constexpr
explicit
PlayerPlacingBlockEvent(
Player
& player,
BlockPos
const
& pos, uchar
const
& face)
31
: Cancellable(player, pos),
32
mFace(face) {}
33
34
LLAPI
void
serialize(
CompoundTag
&)
const override
;
35
36
LLNDAPI uchar
const
& face()
const
;
37
};
38
39
class
PlayerPlacedBlockEvent final :
public
PlayerPlaceBlockEvent {
40
Block
const
& mPlacedBlock;
41
42
public
:
43
constexpr
explicit
PlayerPlacedBlockEvent(
Player
& player,
BlockPos
const
& pos,
Block
const
& placedBlock)
44
: PlayerPlaceBlockEvent(player, pos),
45
mPlacedBlock(placedBlock) {}
46
47
LLAPI
void
serialize(
CompoundTag
&)
const override
;
48
49
LLNDAPI
Block
const
& placedBlock()
const
;
50
};
51
}
// namespace ll::event::inline player
BlockPos
Definition
BlockPos.h:19
Block
Definition
Block.h:43
CompoundTag
Definition
CompoundTag.h:23
Player
Definition
Player.h:125
src
ll
api
event
player
PlayerPlaceBlockEvent.h
Generated on
for LeviLamina by
1.16.1