LeviLamina
Loading...
Searching...
No Matches
DataItem.h
1#pragma once
2
3#include "ll/api/base/Meta.h"
4#include "mc/_HeaderOutputPredefine.h"
5#include "mc/deps/core/math/Vec2.h"
6#include "mc/deps/core/math/Vec3.h"
7#include "mc/nbt/CompoundTag.h"
8#include "mc/world/actor/ActorDataIDs.h"
9#include "mc/world/level/BlockPos.h"
10
11// auto generated inclusion list
12#include "mc/world/actor/DataItemType.h"
13
14class DataItem {
15public:
16 // DataItem inner types define
17 using ID = ushort;
18
19public:
21
22public:
23 template <typename T>
24 requires(DataItem::TypeList::contains<T>)
25 [[nodiscard]] constexpr optional_ref<T const> getData() const;
26 template <typename T>
27 requires(DataItem::TypeList::contains<T>)
28 [[nodiscard]] constexpr optional_ref<T> getData();
29 template <typename T>
30 requires(DataItem::TypeList::contains<std::remove_cvref_t<T>>)
31 constexpr bool setData(T&& value);
32
33 template <typename T>
34 requires(DataItem::TypeList::contains<std::remove_cvref_t<T>>)
35 [[nodiscard]] static LL_CONSTEXPR23 std::unique_ptr<DataItem> create(ushort key, T&& value);
36 [[nodiscard]] static LL_CONSTEXPR23 std::unique_ptr<DataItem> create(ushort key, bool value) {
37 return create(key, (schar)value);
38 }
39 template <typename T>
40 requires(DataItem::TypeList::contains<std::remove_cvref_t<T>>)
41 [[nodiscard]] static LL_CONSTEXPR23 std::unique_ptr<DataItem> create(::ActorDataIDs key, T&& value) {
42 return create(static_cast<std::underlying_type_t<::ActorDataIDs>>(key), std::forward<T>(value));
43 }
44 [[nodiscard]] static LL_CONSTEXPR23 std::unique_ptr<DataItem> create(::ActorDataIDs key, bool value) {
45 return create(key, (schar)value);
46 }
47
48protected:
49 DataItem() = default;
50
51public:
52 // virtual functions
53 // NOLINTBEGIN
54 // vIndex: 0
55 virtual ~DataItem() = default;
56
57 // vIndex: 1
58 virtual ushort getId() const = 0;
59
60 // vIndex: 2
61 virtual ::DataItemType getType() const = 0;
62
63 // vIndex: 3
64 virtual bool isDataEqual(::DataItem const&) const = 0;
65
66 // vIndex: 4
67 virtual ::std::unique_ptr<::DataItem> clone() const = 0;
68 // NOLINTEND
69
70public:
71 // virtual function thunks
72 // NOLINTBEGIN
73
74 // NOLINTEND
75};
76
77#include "mc/world/actor/DataItem2.h"
Definition DataItem.h:14
Definition Meta.h:197
Definition optional_ref.h:10