LeviLamina
Loading...
Searching...
No Matches
BlockEventListenerService.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/scripting/runtime/Result_deprecated.h"
7#include "mc/editor/services/IEditorService.h"
8#include "mc/world/events/BlockEventListener.h"
9#include "mc/world/events/EventListenerDispatcher.h"
10#include "mc/world/events/EventResult.h"
11
12// auto generated forward declare list
13// clang-format off
14class Block;
15class BlockPos;
16class BlockSource;
17class Player;
18namespace Editor::Transactions { struct BlockChangedOperationData; }
19// clang-format on
20
21namespace Editor::Services {
22
24 public ::EventListenerDispatcher<::BlockEventListener> {
25public:
26 // virtual functions
27 // NOLINTBEGIN
28 virtual ~BlockEventListenerService() /*override*/ = default;
29
30 virtual ::Scripting::Result_deprecated<void> init() /*override*/;
31
32 virtual ::Scripting::Result_deprecated<void> quit() /*override*/;
33
34 virtual ::std::string_view getServiceName() const /*override*/;
35
36 virtual ::EventResult onBlockPlacedByPlayer(
37 ::Player& player,
38 ::Block const& placedBlock,
39 ::BlockPos const& pos,
40 bool isUnderwater
41 ) /*override*/;
42
43 virtual ::EventResult onBlockInPosWillBeDestroyedByPlayer(::Player& player, ::BlockPos const& pos) /*override*/;
44 // NOLINTEND
45
46public:
47 // member functions
48 // NOLINTBEGIN
49 MCNAPI ::std::vector<::Editor::Transactions::BlockChangedOperationData>
50 _fillDestroyAction(::BlockSource const& region, ::BlockPos const& pos) const;
51
52 MCNAPI ::std::vector<::Editor::Transactions::BlockChangedOperationData>
53 _fillPlacedAction(::BlockSource const& region, ::BlockPos const& pos) const;
54
55 MCNAPI bool _shouldProcessPlayerEvent(::Player const& player);
56 // NOLINTEND
57
58public:
59 // virtual function thunks
60 // NOLINTBEGIN
61 MCNAPI ::Scripting::Result_deprecated<void> $init();
62
63 MCNAPI ::Scripting::Result_deprecated<void> $quit();
64
65 MCNAPI ::std::string_view $getServiceName() const;
66
67 MCNAPI ::EventResult
68 $onBlockPlacedByPlayer(::Player& player, ::Block const& placedBlock, ::BlockPos const& pos, bool isUnderwater);
69
70 MCNAPI ::EventResult $onBlockInPosWillBeDestroyedByPlayer(::Player& player, ::BlockPos const& pos);
71
72
73 // NOLINTEND
74
75public:
76 // vftables
77 // NOLINTBEGIN
78 MCNAPI static void** $vftableForIEditorService();
79
80 MCNAPI static void** $vftableForEventListenerDispatcher();
81 // NOLINTEND
82};
83
84} // namespace Editor::Services
Definition BlockPos.h:19
Definition BlockSource.h:68
Definition Block.h:43
Definition BlockEventListenerService.h:24
MCAPI ::Scripting::Result_deprecated< void > $init()
MCAPI bool _shouldProcessPlayerEvent(::Player const &player)
static MCAPI void ** $vftableForEventListenerDispatcher()
MCAPI::EventResult $onBlockInPosWillBeDestroyedByPlayer(::Player &player, ::BlockPos const &pos)
MCAPI ::Scripting::Result_deprecated< void > $quit()
MCAPI::std::string_view $getServiceName() const
MCAPI ::std::vector<::Editor::Transactions::BlockChangedOperationData > _fillDestroyAction(::BlockSource const &region, ::BlockPos const &pos) const
MCAPI ::std::vector<::Editor::Transactions::BlockChangedOperationData > _fillPlacedAction(::BlockSource const &region, ::BlockPos const &pos) const
static MCAPI void ** $vftableForIEditorService()
MCAPI::EventResult $onBlockPlacedByPlayer(::Player &player, ::Block const &placedBlock, ::BlockPos const &pos, bool isUnderwater)
Definition IEditorService.h:11
Definition EventListenerDispatcher.h:6
Definition Player.h:125
Definition BlockChangedOperationData.h:7