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: 2
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: 0
57 virtual ::std::shared_ptr<::StorageItemContainerModel> getModel(::FullContainerName const& name) /*override*/;
58
59 // vIndex: 1
60 virtual ::std::shared_ptr<::FillingContainer> getBackingContainer(::FullContainerName const& name) /*override*/;
61
62 // vIndex: 2
63 virtual void tryCreateEntry(
64 ::StorageItemComponent* storageItemComponent,
65 ::StorageWeightLimitItemComponent* storageWeightLimitItemComponent,
66 ::FullContainerName const& name
67 ) /*override*/;
68
69 // vIndex: 0
70 virtual ::std::unique_ptr<::DynamicContainerManager> createContainerManager(
71 ::FullContainerName const& id,
72 ::ItemStack const& storageItem,
73 ::StorageItemComponent* storageItemComponent,
74 ::StorageWeightLimitItemComponent* storageWeightLimitItemComponent
75 ) /*override*/;
76
77 // vIndex: 1
78 virtual uint generateNewID() /*override*/;
79
80 // vIndex: 2
81 virtual void tryLoadSavedStorageItem(::ListTag const& contentData, ::FullContainerName const& name) /*override*/;
82
83 // vIndex: 3
84 virtual void setExpired(::std::vector<::FullContainerName> const& removedContainers) /*override*/;
85
86 // vIndex: 4
87 virtual uint64 getSize() /*override*/;
88 // NOLINTEND
89
90public:
91 // member functions
92 // NOLINTBEGIN
93 MCNAPI explicit ContainerRegistry(bool isClientSide);
94
95 MCNAPI ::DynamicTrackedContainer& _getOrCreate(
96 ::FullContainerName const& id,
97 ::StorageItemComponent* storageItemComponent,
98 ::StorageWeightLimitItemComponent* storageWeightLimitItemComponent
99 );
100
101 MCNAPI void _serverCleanUp(::std::function<void(::Packet&)> broadcastPacketFunction);
102
103 MCNAPI void tick(::std::function<void(::Packet&)> broadcastPacketFunction);
104 // NOLINTEND
105
106public:
107 // static functions
108 // NOLINTBEGIN
109 MCNAPI static void sendCleanupPackets(
110 ::std::function<void(::Packet&)> const& broadcastPacketFunction,
111 ::std::vector<::FullContainerName> const& removedContainers
112 );
113 // NOLINTEND
114
115public:
116 // constructor thunks
117 // NOLINTBEGIN
118 MCNAPI void* $ctor(bool isClientSide);
119 // NOLINTEND
120
121public:
122 // virtual function thunks
123 // NOLINTBEGIN
124 MCNAPI ::std::unique_ptr<::ListTag>
126
127 MCNAPI ::std::optional<int> $getDynamicContainerWeight(::FullContainerName const& name);
128
129 MCNAPI ::std::shared_ptr<::StorageItemContainerModel> $getModel(::FullContainerName const& name);
130
131 MCNAPI ::std::shared_ptr<::FillingContainer> $getBackingContainer(::FullContainerName const& name);
132
133 MCNAPI void $tryCreateEntry(
134 ::StorageItemComponent* storageItemComponent,
135 ::StorageWeightLimitItemComponent* storageWeightLimitItemComponent,
136 ::FullContainerName const& name
137 );
138
139 MCNAPI ::std::unique_ptr<::DynamicContainerManager> $createContainerManager(
140 ::FullContainerName const& id,
141 ::ItemStack const& storageItem,
142 ::StorageItemComponent* storageItemComponent,
143 ::StorageWeightLimitItemComponent* storageWeightLimitItemComponent
144 );
145
146 MCNAPI uint $generateNewID();
147
148 MCNAPI void $tryLoadSavedStorageItem(::ListTag const& contentData, ::FullContainerName const& name);
149
150 MCNAPI void $setExpired(::std::vector<::FullContainerName> const& removedContainers);
151
152 MCNAPI uint64 $getSize();
153 // NOLINTEND
154
155public:
156 // vftables
157 // NOLINTBEGIN
159
161
163 // NOLINTEND
164};
Definition ContainerRegistry.h:28
MCAPI void tick(::std::function< void(::Packet &)> broadcastPacketFunction)
MCAPI ContainerRegistry(bool isClientSide)
static MCAPI void ** $vftableForIContainerRegistryTracker()
MCAPI void _serverCleanUp(::std::function< void(::Packet &)> broadcastPacketFunction)
MCAPI ::std::unique_ptr<::DynamicContainerManager > $createContainerManager(::FullContainerName const &id, ::ItemStack const &storageItem, ::StorageItemComponent *storageItemComponent, ::StorageWeightLimitItemComponent *storageWeightLimitItemComponent)
MCAPI void $tryLoadSavedStorageItem(::ListTag const &contentData, ::FullContainerName const &name)
static MCAPI void ** $vftableForIContainerRegistryAccess()
MCAPI uint64 $getSize()
MCAPI::DynamicTrackedContainer & _getOrCreate(::FullContainerName const &id, ::StorageItemComponent *storageItemComponent, ::StorageWeightLimitItemComponent *storageWeightLimitItemComponent)
MCAPI ::std::shared_ptr<::StorageItemContainerModel > $getModel(::FullContainerName const &name)
static MCAPI void ** $vftableForIDynamicContainerSerialization()
MCAPI void * $ctor(bool isClientSide)
static MCAPI void sendCleanupPackets(::std::function< void(::Packet &)> const &broadcastPacketFunction, ::std::vector<::FullContainerName > const &removedContainers)
MCAPI ::std::unique_ptr<::ListTag > $serializeContainerContent(::FullContainerName const &name, ::SaveContext const &saveContext)
MCAPI uint $generateNewID()
MCAPI void $tryCreateEntry(::StorageItemComponent *storageItemComponent, ::StorageWeightLimitItemComponent *storageWeightLimitItemComponent, ::FullContainerName const &name)
MCAPI ::std::optional< int > $getDynamicContainerWeight(::FullContainerName const &name)
MCAPI void $setExpired(::std::vector<::FullContainerName > const &removedContainers)
MCAPI ::std::shared_ptr<::FillingContainer > $getBackingContainer(::FullContainerName const &name)
Definition DynamicContainerManager.h:17
Definition FillingContainer.h:16
Definition IContainerRegistryAccess.h:14
Definition IContainerRegistryTracker.h:15
Definition IDynamicContainerSerialization.h:12
Definition ItemStack.h:25
Definition ListTag.h:12
Definition Packet.h:26
Definition SaveContext.h:5
Definition StorageItemComponent.h:25
Definition StorageItemContainerModel.h:18
Definition StorageWeightLimitItemComponent.h:16
Definition DynamicTrackedContainer.h:11
Definition FullContainerName.h:8