3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/deps/core/container/EnumSet.h"
7#include "mc/deps/core/string/HashedString.h"
8#include "mc/deps/core/utility/NonOwnerPointer.h"
9#include "mc/deps/core/utility/pub_sub/Subscription.h"
10#include "mc/deps/script_core/lifetime_registry/scripting/StrongTypedObjectHandle.h"
11#include "mc/deps/script_core/runtime/scripting/Result.h"
12#include "mc/deps/script_core/scripting/Version.h"
13#include "mc/scripting/modules/minecraft/ScriptCustomComponentRegistry.h"
14#include "mc/scripting/modules/minecraft/block/IScriptBlockCustomComponentReader.h"
15#include "mc/scripting/modules/minecraft/events/ScriptBlockCustomComponentEventTypes.h"
16#include "mc/scripting/modules/minecraft/events/ScriptBlockCustomComponentInterface.h"
17#include "mc/scripting/modules/minecraft/events/metadata/ScriptCustomComponentAfterEventList.h"
18#include "mc/scripting/modules/minecraft/events/metadata/ScriptCustomComponentEventMetadata.h"
19#include "mc/world/events/ScriptDeferredEventListener.h"
45namespace Json {
class Value; }
60namespace ScriptModuleMinecraft {
76 ::ll::TypedStorage<2, 2, ::Bedrock::EnumSet<::ScriptModuleMinecraft::ScriptBlockCustomComponentEventTypes, 16>>
78 ::ll::TypedStorage<8, 320, ::std::optional<::ScriptModuleMinecraft::ScriptBlockCustomComponentInterface>>
80 ::ll::TypedStorage<8, 40, ::Scripting::Version> mVersionBoundWith;
81 ::ll::TypedStorage<1, 1, bool> mInitialized;
82 ::ll::TypedStorage<1, 1, bool> mUsedByBlock;
98 ::ll::TypedStorage<8, 8, ::ScriptDeferredEventCoordinator&> mDeferredEventCoordinator;
99 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::cereal::ReflectionCtx>> mCerealContext;
100 ::ll::TypedStorage<8, 24, ::std::vector<::Bedrock::PubSub::Subscription>> mBlockSubscriptions;
104 ::std::unordered_map<
108 ::ll::TypedStorage<8, 24, ::ScriptModuleMinecraft::ScriptCustomComponentAfterEventList> mAsyncEventQueues;
109 ::ll::TypedStorage<2, 2, ::Bedrock::EnumSet<::ScriptModuleMinecraft::ScriptBlockCustomComponentEventTypes, 16>>
110 mV1EventSubscriptionList;
111 ::ll::TypedStorage<8, 8, ::ScriptModuleMinecraft::ScriptCustomComponentParameterCache&>
112 mCustomComponentParameterCache;
117 ScriptBlockCustomComponentsRegistry& operator=(ScriptBlockCustomComponentsRegistry
const&);
118 ScriptBlockCustomComponentsRegistry(ScriptBlockCustomComponentsRegistry
const&);
119 ScriptBlockCustomComponentsRegistry();
124 virtual void onPreFlushAfterEvents() ;
128 virtual void onPostFlushAfterEvents() ;
130 virtual void _onScriptInitializationComplete() ;
132 virtual void _onReload() ;
134 virtual ~ScriptBlockCustomComponentsRegistry() =
default;
136 virtual ::std::vector<::std::string_view> getValidComponentsForBlock(
140 virtual ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptCustomComponentParameters>
const&
141 tryGetCustomComponentParametersForBlock(
143 ::std::string_view componentName,
157 MCNAPI ::Scripting::Result<
165 ::std::_List_iterator<::std::_List_val<::std::_List_simple_types<::std::pair<
172 MCNAPI ::Scripting::Result<
180 ::std::_List_iterator<::std::_List_val<::std::_List_simple_types<::std::pair<
190 ::std::vector<::gsl::not_null<::BlockCustomComponentsComponent*>>
const& comps
196 ::ScriptModuleMinecraft::ScriptBlockCustomComponentEventTypes type,
230 MCNAPI ::ScriptModuleMinecraft::ScriptBlockCustomComponentInterface
const*
233 MCNAPI ::Scripting::Result<
246 MCNAPI ::Scripting::Result<
263 MCNAPI static ::ScriptModuleMinecraft::ScriptCustomComponentEventMetadata<
302 MCNAPI ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptCustomComponentParameters>
const&
305 ::std::string_view componentName,
Definition BlockCustomComponentsComponent.h:21
Definition ActorEvent.h:17
Definition BlockBreakEvent.h:17
Definition BlockEntityFallOnEvent.h:17
Definition BlockNeighborChangedEvent.h:18
Definition BlockPlaceEvent.h:16
Definition BlockPlayerDestroyEvent.h:17
Definition BlockPlayerInteractEvent.h:18
Definition BlockPlayerPlacingEvent.h:18
Definition BlockQueuedTickEvent.h:16
Definition BlockRandomTickEvent.h:16
Definition BlockRandomTickLegacyEvent.h:16
Definition BlockRedstoneUpdateEvent.h:15
Definition BlockStateChangeEvent.h:17
Definition BlockStepOffEvent.h:16
Definition BlockStepOnEvent.h:16
Definition NamedTickEvent.h:18
Definition BlockType.h:79
Definition HashedString.h:5
Definition ScriptDeferredEventCoordinator.h:18
Definition ScriptDeferredEventListener.h:10
Definition ScriptDeferredFlushTracker.h:13
Definition IScriptBlockCustomComponentReader.h:18
Definition ScriptBlockCustomComponentInterface.h:10
MCAPI ::Scripting::Result< void, ::ScriptModuleMinecraft::ScriptCustomComponentInvalidRegistryError, ::ScriptModuleMinecraft::ScriptBlockCustomComponentAlreadyRegisteredError, ::ScriptModuleMinecraft::ScriptBlockCustomComponentReloadVersionError, ::ScriptModuleMinecraft::ScriptBlockCustomComponentReloadNewEventError, ::ScriptModuleMinecraft::ScriptBlockCustomComponentReloadNewComponentError > tryRegisterCustomComponent(::HashedString const &name, ::ScriptModuleMinecraft::ScriptBlockCustomComponentInterface &&closures, ::Scripting::WeakLifetimeScope const &scope)
MCAPI void onPlayerBreak(::BlockEvents::BlockPlayerDestroyEvent const &eventData) const
MCAPI void onStepOff(::BlockEvents::BlockStepOffEvent const &eventData) const
MCAPI void onPlace(::BlockEvents::BlockPlaceEvent const &eventData) const
MCAPI void onEntityFallOn(::BlockEvents::BlockEntityFallOnEvent &eventData) const
MCAPI void onPlayerInteract(::BlockEvents::BlockPlayerInteractEvent &eventData) const
MCAPI void onRandomTickLegacy(::BlockEvents::BlockRandomTickLegacyEvent const &eventData) const
MCAPI ::Scripting::Result< void, ::ScriptModuleMinecraft::ScriptCustomComponentInvalidRegistryError, ::ScriptModuleMinecraft::ScriptBlockCustomComponentAlreadyRegisteredError, ::ScriptModuleMinecraft::ScriptBlockCustomComponentReloadVersionError, ::ScriptModuleMinecraft::ScriptBlockCustomComponentReloadNewEventError, ::ScriptModuleMinecraft::ScriptBlockCustomComponentReloadNewComponentError > tryRegisterCustomComponentV1(::HashedString const &name, ::ScriptModuleMinecraft::ScriptBlockCustomComponentInterface &&closures, ::Scripting::WeakLifetimeScope const &scope)
MCAPI void $onPostFlushAfterEvents()
MCAPI ::Scripting::Result< void, ::ScriptModuleMinecraft::ScriptCustomComponentInvalidRegistryError, ::ScriptModuleMinecraft::ScriptBlockCustomComponentAlreadyRegisteredError, ::ScriptModuleMinecraft::ScriptBlockCustomComponentReloadVersionError, ::ScriptModuleMinecraft::ScriptBlockCustomComponentReloadNewEventError, ::ScriptModuleMinecraft::ScriptBlockCustomComponentReloadNewComponentError > _componentReloadRegistrationValidators(::std::_List_iterator<::std::_List_val<::std::_List_simple_types<::std::pair< ::HashedString const, ::ScriptModuleMinecraft::ScriptBlockCustomComponentsRegistry::ScriptBlockCustomComponentData > > > > const &compIt, ::HashedString const &name, ::ScriptModuleMinecraft::ScriptBlockCustomComponentInterface const &closures)
MCAPI void onQueuedTick(::BlockEvents::BlockQueuedTickEvent const &eventData) const
MCAPI void onActor(::BlockEvents::ActorEvent const &eventData) const
MCAPI void onBreak(::BlockEvents::BlockBreakEvent const &eventData) const
MCAPI bool hasSubscriptionFor(::ScriptModuleMinecraft::ScriptBlockCustomComponentEventTypes type, ::BlockCustomComponentsComponent const &customComponents) const
MCAPI void onRandomTick(::BlockEvents::BlockRandomTickEvent const &eventData) const
MCAPI void $onFlushBlockCustomComponentAfterEvents(::ScriptDeferredFlushTracker &deferredTracker)
MCAPI void _registerBlockForEventing(::BlockType &block, ::std::vector<::gsl::not_null<::BlockCustomComponentsComponent * > > const &comps)
static MCAPI void generateOrderDocumentationForVersion(::Scripting::ModuleDescriptor const &moduleToDocumentFor, ::Json::Value &eventOrderArray)
MCAPI ScriptBlockCustomComponentsRegistry(::ServerScriptManagerEvents &events, ::ScriptDeferredEventCoordinator &deferredEventCoordinator, ::ScriptModuleMinecraft::ScriptCustomComponentParameterCache ¶meterCache)
MCAPI void onBlockStateChange(::BlockEvents::BlockStateChangeEvent const &eventData) const
MCAPI void onRedstoneUpdate(::BlockEvents::BlockRedstoneUpdateEvent const &eventData) const
MCAPI ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptCustomComponentParameters > const & $tryGetCustomComponentParametersForBlock(::Block const &block, ::std::string_view componentName, ::Scripting::WeakLifetimeScope const &scope) const
static MCAPI void bind(::Scripting::ModuleBindingBuilder &moduleBuilder)
MCAPI void * $ctor(::ServerScriptManagerEvents &events, ::ScriptDeferredEventCoordinator &deferredEventCoordinator, ::ScriptModuleMinecraft::ScriptCustomComponentParameterCache ¶meterCache)
MCAPI void onStepOn(::BlockEvents::BlockStepOnEvent const &eventData) const
MCAPI void $_onScriptInitializationComplete()
MCAPI::ScriptModuleMinecraft::ScriptBlockCustomComponentInterface const * tryGetRegisteredComponent(::HashedString const &name) const
MCAPI void beforeOnPlayerPlace(::BlockEvents::BlockPlayerPlacingEvent &eventData) const
static MCAPI ::ScriptModuleMinecraft::ScriptCustomComponentEventMetadata< ::ScriptModuleMinecraft::ScriptBlockCustomComponentInterface > const _getEventMetadata()
MCAPI void onNeighborChanged(::BlockEvents::BlockNeighborChangedEvent const &eventData) const
MCAPI ::Scripting::Result< void, ::ScriptModuleMinecraft::ScriptCustomComponentInvalidRegistryError, ::ScriptModuleMinecraft::ScriptBlockCustomComponentAlreadyRegisteredError, ::ScriptModuleMinecraft::ScriptBlockCustomComponentReloadVersionError, ::ScriptModuleMinecraft::ScriptBlockCustomComponentReloadNewEventError, ::ScriptModuleMinecraft::ScriptBlockCustomComponentReloadNewComponentError > _componentRegistrationValidatorsCommon(::std::_List_iterator<::std::_List_val<::std::_List_simple_types<::std::pair< ::HashedString const, ::ScriptModuleMinecraft::ScriptBlockCustomComponentsRegistry::ScriptBlockCustomComponentData > > > > const &compIt, ::HashedString const &name)
MCAPI void onNamedTick(::BlockEvents::NamedTickEvent const &eventData) const
MCAPI void $onPreFlushAfterEvents()
MCAPI ::std::vector<::std::string_view > $getValidComponentsForBlock(::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptBlockPermutation > const &permutation) const
Definition ScriptBlockPermutation.h:22
Definition ScriptCustomComponentParameterCache.h:21
Definition ScriptCustomComponentRegistry.h:10
Definition ModuleBindingBuilder.h:22
Definition StrongTypedObjectHandle.h:8
Definition WeakLifetimeScope.h:12
Definition ScriptBlockCustomComponentAlreadyRegisteredError.h:15
Definition ScriptBlockCustomComponentReloadNewComponentError.h:15
Definition ScriptBlockCustomComponentReloadNewEventError.h:15
Definition ScriptBlockCustomComponentReloadVersionError.h:15
Definition ScriptBlockCustomComponentsRegistry.h:72
MCAPI void setClosureData(::ScriptModuleMinecraft::ScriptBlockCustomComponentInterface &&closures, ::Scripting::WeakLifetimeScope const &scope)
Definition ScriptCustomComponentInvalidRegistryError.h:17
Definition ScriptCustomComponentParameters.h:15
Definition ModuleDescriptor.h:7
Definition ServerScriptManagerEvents.h:13
Definition ReflectionCtx.h:11