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 // vIndex: 0
29 virtual ~BlockEventListenerService() /*override*/ = default;
30
31 // vIndex: 1
32 virtual ::Scripting::Result_deprecated<void> init() /*override*/;
33
34 // vIndex: 3
35 virtual ::Scripting::Result_deprecated<void> quit() /*override*/;
36
37 // vIndex: 4
38 virtual ::std::string_view getServiceName() const /*override*/;
39
40 // vIndex: 1
41 virtual ::EventResult onBlockPlacedByPlayer(
42 ::Player& player,
43 ::Block const& placedBlock,
44 ::BlockPos const& pos,
45 bool isUnderwater
46 ) /*override*/;
47
48 // vIndex: 3
49 virtual ::EventResult onBlockInPosWillBeDestroyedByPlayer(::Player& player, ::BlockPos const& pos) /*override*/;
50 // NOLINTEND
51
52public:
53 // member functions
54 // NOLINTBEGIN
55 MCNAPI ::std::vector<::Editor::Transactions::BlockChangedOperationData>
56 _fillDestroyAction(::BlockSource const& region, ::BlockPos const& pos) const;
57
58 MCNAPI ::std::vector<::Editor::Transactions::BlockChangedOperationData>
59 _fillPlacedAction(::BlockSource const& region, ::BlockPos const& pos) const;
60
61 MCNAPI bool _shouldProcessPlayerEvent(::Player const& player);
62 // NOLINTEND
63
64public:
65 // virtual function thunks
66 // NOLINTBEGIN
67 MCNAPI ::Scripting::Result_deprecated<void> $init();
68
69 MCNAPI ::Scripting::Result_deprecated<void> $quit();
70
71 MCNAPI ::std::string_view $getServiceName() const;
72
73 MCNAPI ::EventResult
74 $onBlockPlacedByPlayer(::Player& player, ::Block const& placedBlock, ::BlockPos const& pos, bool isUnderwater);
75
76 MCNAPI ::EventResult $onBlockInPosWillBeDestroyedByPlayer(::Player& player, ::BlockPos const& pos);
77 // NOLINTEND
78
79public:
80 // vftables
81 // NOLINTBEGIN
82 MCNAPI static void** $vftableForIEditorService();
83
84 MCNAPI static void** $vftableForEventListenerDispatcher();
85 // NOLINTEND
86};
87
88} // namespace Editor::Services
Definition BlockPos.h:17
Definition BlockSource.h:66
Definition Block.h:37
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:123