Skip to content
LeviLamina

API Reference

On this page

Loading...
Searching...
No Matches
EntityStorageBlockActorComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/legacy/ActorUniqueID.h"
7#include "mc/world/level/block/actor/BlockActorVersion.h"
8#include "mc/world/level/block/actor/component/IBlockActorComponent.h"
9
10// auto generated forward declare list
11// clang-format off
12class Actor;
13class BlockActor;
14class BlockSource;
15class BlockType;
16class CompoundTag;
17class ILevel;
18class SaveContext;
19// clang-format on
20
22public:
23 // EntityStorageBlockActorComponent inner types declare
24 // clang-format off
25 struct Context;
26 struct EntityStorageInfo;
27 // clang-format on
28
29 // EntityStorageBlockActorComponent inner types define
30 enum class EntityStorageResult : uchar {
31 Success = 0,
32 ClientSide = 1,
33 StorageFull = 2,
34 InvalidEntityId = 3,
35 EntityAlreadyStored = 4,
36 ActorSaveFailed = 5,
37 EntityNotFound = 6,
38 ActorLoadFailed = 7,
39 ActorSpawnFailed = 8,
40 SameBucket = 9,
41 NoStorageFound = 10,
42 EntityNotAllowed = 11,
43 EntityMounted = 12,
44 };
45
46 struct Context {
47 public:
48 // member variables
49 // NOLINTBEGIN
50 ::ll::TypedStorage<8, 8, ::BlockActor&> mBlockActor;
51 ::ll::TypedStorage<8, 8, ::BlockSource&> mRegion;
52 // NOLINTEND
53
54 public:
55 // prevent constructor by default
56 Context& operator=(Context const&);
57 Context(Context const&);
58 Context();
59 };
60
62 public:
63 // member variables
64 // NOLINTBEGIN
65 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mUniqueId;
66 ::ll::TypedStorage<8, 32, ::std::string> mDefinitionId;
67 // NOLINTEND
68 };
69
70 using EntityBucket = ::std::vector<::CompoundTag>;
71
72 using EntityBuckets = ::std::unordered_map<::std::string, ::std::vector<::CompoundTag>>;
73
74public:
75 // member variables
76 // NOLINTBEGIN
77 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::std::vector<::CompoundTag>>> mEntities;
78 // NOLINTEND
79
80public:
81 // virtual functions
82 // NOLINTBEGIN
83 virtual void save(::CompoundTag& parentTag, ::SaveContext const&) const /*override*/;
84
85 virtual void load(::CompoundTag const& parentTag, ::ILevel& level, ::BlockActorVersion version) /*override*/;
86 // NOLINTEND
87
88public:
89 // member functions
90 // NOLINTBEGIN
91 MCNAPI ::std::vector<::EntityStorageBlockActorComponent::EntityStorageInfo>
92 getEntities(::std::string const& bucket) const;
93
94 MCNAPI ::EntityStorageBlockActorComponent::EntityStorageResult release(
95 ::std::string const& bucket,
96 ::ActorUniqueID entityId,
97 ::Actor*& outActor,
99 );
100
101 MCNAPI int size(::std::string const& bucket) const;
102
103 MCNAPI ::EntityStorageBlockActorComponent::EntityStorageResult store(
104 ::std::string const& bucket,
105 ::Actor& actor,
106 ::ActorUniqueID& outEntityId,
108 );
109
110 MCNAPI ::EntityStorageBlockActorComponent::EntityStorageResult transfer(
111 ::std::string const& bucket,
112 ::ActorUniqueID entityId,
113 ::BlockActor& targetBlockActor,
115 );
116 // NOLINTEND
117
118public:
119 // static functions
120 // NOLINTBEGIN
121#ifdef LL_PLAT_S
122 MCNAPI static ::std::unique_ptr<::EntityStorageBlockActorComponent> tryCreateFor(::BlockType const& blockType);
123#endif
124 // NOLINTEND
125
126public:
127 // virtual function thunks
128 // NOLINTBEGIN
129 MCNAPI void $save(::CompoundTag& parentTag, ::SaveContext const&) const;
130
131 MCNAPI void $load(::CompoundTag const& parentTag, ::ILevel& level, ::BlockActorVersion version);
132
133
134 // NOLINTEND
135
136public:
137 // vftables
138 // NOLINTBEGIN
139 MCNAPI static void** $vftable();
140 // NOLINTEND
141};
Definition Actor.h:116
Definition BlockActor.h:30
Definition BlockSource.h:72
Definition BlockType.h:79
Definition CompoundTag.h:18
Definition EntityStorageBlockActorComponent.h:21
MCAPI::EntityStorageBlockActorComponent::EntityStorageResult release(::std::string const &bucket, ::ActorUniqueID entityId, ::Actor *&outActor, ::EntityStorageBlockActorComponent::Context const &context)
MCAPI::EntityStorageBlockActorComponent::EntityStorageResult store(::std::string const &bucket, ::Actor &actor, ::ActorUniqueID &outEntityId, ::EntityStorageBlockActorComponent::Context const &context)
MCAPI void $save(::CompoundTag &parentTag, ::SaveContext const &) const
MCAPI ::std::vector<::EntityStorageBlockActorComponent::EntityStorageInfo > getEntities(::std::string const &bucket) const
static MCAPI void ** $vftable()
MCAPI::EntityStorageBlockActorComponent::EntityStorageResult transfer(::std::string const &bucket, ::ActorUniqueID entityId, ::BlockActor &targetBlockActor, ::EntityStorageBlockActorComponent::Context const &context)
MCAPI int size(::std::string const &bucket) const
MCAPI void $load(::CompoundTag const &parentTag, ::ILevel &level, ::BlockActorVersion version)
Definition ILevel.h:223
Definition SaveContext.h:5
Definition ActorUniqueID.h:5
Definition EntityStorageBlockActorComponent.h:46
Definition EntityStorageBlockActorComponent.h:61
Definition IBlockActorComponent.h:15
Definition context.h:5