LeviLamina
Loading...
Searching...
No Matches
ContainerRegistry.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/containers/IContainerRegistryAccess.h"
7#include "mc/world/containers/IContainerRegistryTracker.h"
8#include "mc/world/containers/IDynamicContainerSerialization.h"
9
10// auto generated forward declare list
11// clang-format off
14class ItemStack;
15class ListTag;
16class Packet;
17class SaveContext;
23namespace Bedrock::Threading { class SharedRecursiveMutex; }
24// clang-format on
25
29public:
30 // member variables
31 // NOLINTBEGIN
32 ::ll::TypedStorage<4, 4, uint> mNextDynamicId;
33 ::ll::TypedStorage<8, 64, ::std::unordered_map<::FullContainerName, ::DynamicTrackedContainer>> mContainers;
34 ::ll::TypedStorage<1, 1, bool const> mIsClientSide;
35 ::ll::TypedStorage<4, 4, int> mTicksSinceLastCleanup;
36 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Bedrock::Threading::SharedRecursiveMutex>> mContainerContextMutex;
37 // NOLINTEND
38
39public:
40 // prevent constructor by default
42
43public:
44 // virtual functions
45 // NOLINTBEGIN
46 // vIndex: 3
47 virtual ~ContainerRegistry() /*override*/ = default;
48
49 // vIndex: 0
50 virtual ::std::unique_ptr<::ListTag>
51 serializeContainerContent(::FullContainerName const& name, ::SaveContext const& saveContext) /*override*/;
52
53 // vIndex: 1
54 virtual ::std::optional<int> getDynamicContainerWeight(::FullContainerName const& name) /*override*/;
55
56 // vIndex: 2
57 virtual bool hasContainer(::FullContainerName const& name) const /*override*/;
58
59 // vIndex: 0
60 virtual ::std::shared_ptr<::StorageItemContainerModel> getModel(::FullContainerName const& name) /*override*/;
61
62 // vIndex: 1
63 virtual ::std::shared_ptr<::FillingContainer> getBackingContainer(::FullContainerName const& name) /*override*/;
64
65 // vIndex: 2
66 virtual void tryCreateEntry(
67 ::StorageItemComponent* storageItemComponent,
68 ::StorageWeightLimitItemComponent* storageWeightLimitItemComponent,
69 ::FullContainerName const& name
70 ) /*override*/;
71
72 // vIndex: 0
73 virtual ::std::unique_ptr<::DynamicContainerManager> createContainerManager(
74 ::FullContainerName const& id,
75 ::ItemStack const& storageItem,
76 ::StorageItemComponent* storageItemComponent,
77 ::StorageWeightLimitItemComponent* storageWeightLimitItemComponent
78 ) /*override*/;
79
80 // vIndex: 1
81 virtual uint generateNewID() /*override*/;
82
83 // vIndex: 2
84 virtual void tryLoadSavedStorageItem(::ListTag const& contentData, ::FullContainerName const& name) /*override*/;
85
86 // vIndex: 3
87 virtual void setExpired(::std::vector<::FullContainerName> const& removedContainers) /*override*/;
88
89 // vIndex: 4
90 virtual uint64 getSize() /*override*/;
91 // NOLINTEND
92
93public:
94 // member functions
95 // NOLINTBEGIN
96 MCAPI explicit ContainerRegistry(bool isClientSide);
97
98 MCAPI ::DynamicTrackedContainer& _getOrCreate(
99 ::FullContainerName const& id,
100 ::StorageItemComponent* storageItemComponent,
101 ::StorageWeightLimitItemComponent* storageWeightLimitItemComponent
102 );
103
104 MCAPI void _serverCleanUp(::std::function<void(::Packet&)> broadcastPacketFunction);
105
106 MCAPI void tick(::std::function<void(::Packet&)> broadcastPacketFunction);
107 // NOLINTEND
108
109public:
110 // static functions
111 // NOLINTBEGIN
112 MCAPI static void sendCleanupPackets(
113 ::std::function<void(::Packet&)> const& broadcastPacketFunction,
114 ::std::vector<::FullContainerName> const& removedContainers
115 );
116 // NOLINTEND
117
118public:
119 // constructor thunks
120 // NOLINTBEGIN
121 MCAPI void* $ctor(bool isClientSide);
122 // NOLINTEND
123
124public:
125 // virtual function thunks
126 // NOLINTBEGIN
127 MCAPI ::std::unique_ptr<::ListTag>
128 $serializeContainerContent(::FullContainerName const& name, ::SaveContext const& saveContext);
129
130 MCAPI ::std::optional<int> $getDynamicContainerWeight(::FullContainerName const& name);
131
132 MCAPI bool $hasContainer(::FullContainerName const& name) const;
133
134 MCAPI ::std::shared_ptr<::StorageItemContainerModel> $getModel(::FullContainerName const& name);
135
136 MCAPI ::std::shared_ptr<::FillingContainer> $getBackingContainer(::FullContainerName const& name);
137
138 MCAPI void $tryCreateEntry(
139 ::StorageItemComponent* storageItemComponent,
140 ::StorageWeightLimitItemComponent* storageWeightLimitItemComponent,
141 ::FullContainerName const& name
142 );
143
144 MCAPI ::std::unique_ptr<::DynamicContainerManager> $createContainerManager(
145 ::FullContainerName const& id,
146 ::ItemStack const& storageItem,
147 ::StorageItemComponent* storageItemComponent,
148 ::StorageWeightLimitItemComponent* storageWeightLimitItemComponent
149 );
150
151 MCAPI uint $generateNewID();
152
153 MCAPI void $tryLoadSavedStorageItem(::ListTag const& contentData, ::FullContainerName const& name);
154
155 MCAPI void $setExpired(::std::vector<::FullContainerName> const& removedContainers);
156
157 MCFOLD uint64 $getSize();
158 // NOLINTEND
159
160public:
161 // vftables
162 // NOLINTBEGIN
163 MCAPI static void** $vftableForIDynamicContainerSerialization();
164
165 MCAPI static void** $vftableForIContainerRegistryTracker();
166
167 MCAPI static void** $vftableForIContainerRegistryAccess();
168 // NOLINTEND
169};
Definition ContainerRegistry.h:28
Definition DynamicContainerManager.h:17
Definition FillingContainer.h:17
Definition IContainerRegistryAccess.h:14
Definition IContainerRegistryTracker.h:15
Definition IDynamicContainerSerialization.h:12
Definition ItemStack.h:23
Definition ListTag.h:12
Definition Packet.h:43
Definition SaveContext.h:5
Definition StorageItemComponent.h:29
Definition StorageItemContainerModel.h:18
Definition StorageWeightLimitItemComponent.h:16
Definition DynamicTrackedContainer.h:11
Definition FullContainerName.h:8