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 { class ServiceProviderCollection; }
19namespace Editor::Transactions { struct BlockChangedOperationData; }
20// clang-format on
21
22namespace Editor::Services {
23
24class BlockEventListenerService : public ::Editor::Services::IEditorService,
25 public ::EventListenerDispatcher<::BlockEventListener> {
26public:
27 // prevent constructor by default
28 BlockEventListenerService();
29
30public:
31 // virtual functions
32 // NOLINTBEGIN
33 virtual ~BlockEventListenerService() /*override*/ = default;
34
35 virtual ::Scripting::Result_deprecated<void> init() /*override*/;
36
37 virtual ::Scripting::Result_deprecated<void> quit() /*override*/;
38
39 virtual ::std::string_view getServiceName() const /*override*/;
40
41#ifdef LL_PLAT_S
42 virtual ::EventResult
43 onBlockPlacedByPlayer(::Player& player, ::Block const& pos, ::BlockPos const&, bool) /*override*/;
44#else // LL_PLAT_C
45 virtual ::EventResult onBlockPlacedByPlayer(
46 ::Player& player,
47 ::Block const& placedBlock,
48 ::BlockPos const& pos,
49 bool isUnderwater
50 ) /*override*/;
51#endif
52
53 virtual ::EventResult onBlockInPosWillBeDestroyedByPlayer(::Player& player, ::BlockPos const& pos) /*override*/;
54 // NOLINTEND
55
56public:
57 // member functions
58 // NOLINTBEGIN
60
61 MCNAPI ::std::vector<::Editor::Transactions::BlockChangedOperationData>
62 _fillDestroyAction(::BlockSource const& region, ::BlockPos const& pos) const;
63
64 MCNAPI ::std::vector<::Editor::Transactions::BlockChangedOperationData>
65 _fillPlacedAction(::BlockSource const& region, ::BlockPos const& pos) const;
66 // NOLINTEND
67
68public:
69 // constructor thunks
70 // NOLINTBEGIN
72 // NOLINTEND
73
74public:
75 // virtual function thunks
76 // NOLINTBEGIN
77 MCNAPI ::Scripting::Result_deprecated<void> $init();
78
79 MCNAPI ::Scripting::Result_deprecated<void> $quit();
80
81 MCNAPI ::std::string_view $getServiceName() const;
82
83 MCNAPI ::EventResult $onBlockPlacedByPlayer(::Player& player, ::Block const& pos, ::BlockPos const&, bool);
84
85 MCNAPI ::EventResult $onBlockInPosWillBeDestroyedByPlayer(::Player& player, ::BlockPos const& pos);
86
87
88 // NOLINTEND
89
90public:
91 // vftables
92 // NOLINTBEGIN
93 MCNAPI static void** $vftableForIEditorService();
94
95 MCNAPI static void** $vftableForEventListenerDispatcher();
96 // NOLINTEND
97};
98
99} // namespace Editor::Services
Definition BlockPos.h:21
Definition BlockSource.h:73
Definition Block.h:69
Definition ServiceProviderCollection.h:7
MCAPI BlockEventListenerService(::Editor::ServiceProviderCollection &providers)
MCAPI ::Scripting::Result_deprecated< void > $init()
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::EventResult $onBlockPlacedByPlayer(::Player &player, ::Block const &pos, ::BlockPos const &, bool)
MCAPI ::std::vector<::Editor::Transactions::BlockChangedOperationData > _fillPlacedAction(::BlockSource const &region, ::BlockPos const &pos) const
MCAPI void * $ctor(::Editor::ServiceProviderCollection &providers)
static MCAPI void ** $vftableForIEditorService()
Definition IEditorService.h:11
Definition EventListenerDispatcher.h:6
Definition Player.h:137
Definition BlockChangedOperationData.h:13