Skip to content

Commit 5c27a3c

Browse files
committed
feat: update version
1 parent 2c1ad3f commit 5c27a3c

File tree

11 files changed

+150
-70
lines changed

11 files changed

+150
-70
lines changed

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.3.1] - 2025-11-28
11+
12+
## Changed
13+
14+
- Adapted LeviLamina 1.7.6 and BDS 1.21.124 @zimuya4153
15+
- Correct the name of the macro definition @zimuya4153
16+
17+
### Fixed
18+
19+
- Fixed the HumanoidArmorItem link issue temporarily @zimuya4153
20+
1021
## [0.3.0] - 2025-11-07
1122

1223
### Changed
@@ -43,7 +54,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4354

4455
[#1]: http://github.com/GroupMountain/ModAPI-Release/issues/1
4556

46-
[Unreleased]: http://github.com/GroupMountain/ModAPI-Release/compare/v0.3.0...HEAD
57+
[Unreleased]: http://github.com/GroupMountain/ModAPI-Release/compare/v0.3.1...HEAD
58+
[0.3.1]: http://github.com/GroupMountain/ModAPI-Release/compare/v0.3.0...v0.3.1
4759
[0.3.0]: http://github.com/GroupMountain/ModAPI-Release/compare/v0.2.1...v0.3.0
4860
[0.2.1]: http://github.com/GroupMountain/ModAPI-Release/compare/v0.2.0...v0.2.1
4961
[0.2.0]: http://github.com/GroupMountain/ModAPI-Release/compare/v0.1.1...v0.2.0

bin/dll/ModAPI/ModAPI.dll

1 KB
Binary file not shown.

bin/dll/ModAPI/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"name": "ModAPI",
66
"passive": true,
77
"type": "native",
8-
"version": "0.3.0+ee405bd"
8+
"version": "0.3.1+e1126e8"
99
}

bin/sdk/include/modapi/Version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
// clang-format off
44
#define MODAPI_VERSION_MAJOR 0
55
#define MODAPI_VERSION_MINOR 3
6-
#define MODAPI_VERSION_PATCH 0
6+
#define MODAPI_VERSION_PATCH 1
77
/* #undef MODAPI_VERSION_PRERELEASE */
8-
#define MODAPI_VERSION_COMMIT_SHA ee405bd
8+
#define MODAPI_VERSION_COMMIT_SHA e1126e8
99
// clang-format on
1010

1111
#define MODAPI_VERSION_TO_STRING_INNER(ver) #ver

bin/sdk/include/modapi/gamerule/CustomGameRuleRegistry.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ class CustomGameRuleRegistry {
5050
);
5151

5252
template <typename T, class... Args>
53-
requires(std::is_base_of_v<ICustomGameRule<bool>, T> || std::is_base_of_v<ICustomGameRule<int>, T> || std::is_base_of_v<ICustomGameRule<float>, T>)
53+
requires(
54+
std::is_base_of_v<ICustomGameRule<bool>, T> || std::is_base_of_v<ICustomGameRule<int>, T>
55+
|| std::is_base_of_v<ICustomGameRule<float>, T>
56+
)
5457
CustomGameRuleRegistry& registerGameRule(Args&&... args) {
5558
return _registerGameRule([... args = std::forward<Args>(args)]() -> std::unique_ptr<T> {
5659
return std::make_unique<T>(args...);
@@ -65,14 +68,14 @@ class CustomGameRuleRegistry {
6568

6669
} // namespace modapi::inline gamerule
6770

68-
#define GMLIB_REGISTER_GAME_RULE(RULE_CLASS, ...) \
69-
inline static auto GMLIB_CUSTOM_GAME_RULE_##RULE_CLASS = [] { \
71+
#define MODAPI_REGISTER_GAME_RULE(RULE_CLASS, ...) \
72+
inline static auto MODAPI_CUSTOM_GAME_RULE_##RULE_CLASS = [] { \
7073
::modapi::CustomGameRuleRegistry::getInstance().registerGameRule<RULE_CLASS>(__VA_ARGS__); \
7174
return 0; \
7275
}();
7376

74-
#define GMLIB_REGISTER_GAME_RULES(IDENTIFIER, RULE_CLASS, ...) \
75-
inline static auto GMLIB_CUSTOM_GAME_RULE_##IDENTIFIER = [] { \
77+
#define MODAPI_REGISTER_GAME_RULES(IDENTIFIER, RULE_CLASS, ...) \
78+
inline static auto MODAPI_CUSTOM_GAME_RULE_##IDENTIFIER = [] { \
7679
::modapi::CustomGameRuleRegistry::getInstance().registerGameRule<RULE_CLASS>(__VA_ARGS__); \
7780
return 0; \
7881
}();

bin/sdk/include/modapi/item/CustomItemRegistry.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ class CustomItemRegistry {
5252

5353
} // namespace modapi::inline item
5454

55-
#define GMLIB_REGISTER_ITEM(ITEM_CLASS, ...) \
56-
inline static auto GMLIB_CUSTOM_ITEM_##ITEM_CLASS = [] { \
55+
#define MODAPI_REGISTER_ITEM(ITEM_CLASS, ...) \
56+
inline static auto MODAPI_CUSTOM_ITEM_##ITEM_CLASS = [] { \
5757
::modapi::CustomItemRegistry::getInstance().registerItem<ITEM_CLASS>(__VA_ARGS__); \
5858
return 0; \
5959
}();
6060

61-
#define GMLIB_REGISTER_ITEMS(IDENTIFIER, ITEM_CLASS, ...) \
62-
inline static auto GMLIB_CUSTOM_ITEM_##IDENTIFIER = [] { \
61+
#define MODAPI_REGISTER_ITEMS(IDENTIFIER, ITEM_CLASS, ...) \
62+
inline static auto MODAPI_CUSTOM_ITEM_##IDENTIFIER = [] { \
6363
::modapi::CustomItemRegistry::getInstance().registerItem<ITEM_CLASS>(__VA_ARGS__); \
6464
return 0; \
6565
}();

bin/sdk/include/modapi/item/base/ICustomItem.h

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,19 @@ class ICustomItem : public ::Item {
109109
MOD_API virtual void _init();
110110

111111
// tmpe fix
112-
MOD_API PuvLoadData::LoadResultWithTiming
113-
initServer(Json::Value const& json, SemVersion const& version, IPackLoadContext& context, JsonBetaState const state)
114-
override;
115-
116-
MOD_API PuvLoadData::LoadResultWithTiming
117-
initClient(Json::Value const& json, SemVersion const& version, JsonBetaState const state, IPackLoadContext& context)
118-
override;
112+
MOD_API PuvLoadData::LoadResultWithTiming initServer(
113+
Json::Value const& json,
114+
SemVersion const& version,
115+
IPackLoadContext& context,
116+
JsonBetaState const state
117+
) override;
118+
119+
MOD_API PuvLoadData::LoadResultWithTiming initClient(
120+
Json::Value const& json,
121+
SemVersion const& version,
122+
JsonBetaState const state,
123+
IPackLoadContext& context
124+
) override;
119125
};
120126

121127
} // namespace modapi::inline item

bin/sdk/include/modapi/item/types/mc/HumanoidArmorItem.h

Lines changed: 103 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
#pragma once
2+
23
#include "modapi/Macros.h"
4+
#include <mc/_HeaderOutputPredefine.h>
5+
6+
// auto generated inclusion list
37
#include <mc/deps/shared_types/legacy/LevelSoundEvent.h>
48
#include <mc/deps/shared_types/legacy/actor/ActorLocation.h>
59
#include <mc/deps/shared_types/legacy/actor/ArmorSlot.h>
610
#include <mc/world/item/Item.h>
711

12+
// auto generated forward declare list
13+
// clang-format off
814
class Actor;
915
class BaseGameVersion;
1016
class BlockSource;
@@ -19,15 +25,18 @@ class Mob;
1925
class Player;
2026
class Vec3;
2127
struct ResolvedItemIconInfo;
22-
namespace Bedrock::Safety {
23-
class RedactableString;
24-
}
25-
namespace mce {
26-
class Color;
27-
}
28+
namespace Bedrock::Safety { class RedactableString; }
29+
namespace mce { class Color; }
30+
// clang-format on
2831

2932
class HumanoidArmorItem : public ::Item {
3033
public:
34+
// HumanoidArmorItem inner types declare
35+
// clang-format off
36+
class ArmorMaterial;
37+
// clang-format on
38+
39+
// HumanoidArmorItem inner types define
3140
enum class Tier : int {
3241
Leather = 0,
3342
Chain = 1,
@@ -37,62 +46,76 @@ class HumanoidArmorItem : public ::Item {
3746
Elytra = 5,
3847
Turtle = 6,
3948
Netherite = 7,
49+
Copper = 8,
4050
};
4151

4252
class ArmorMaterial {
4353
public:
54+
// member variables
55+
// NOLINTBEGIN
4456
int mDurabilityMultiplier;
4557
int mSlotProtections[4];
4658
int mToughnessValue;
4759
int mEnchantmentValue;
4860
float mKnockbackResistance;
61+
// NOLINTEND
4962
};
5063

5164
public:
52-
::SharedTypes::Legacy::ArmorSlot mSlot;
53-
int mDefense;
54-
int mModelIndex;
55-
ArmorMaterial const& mArmorType;
56-
bool mCurrentVersionAllowsTrim;
65+
// member variables
66+
// NOLINTBEGIN
67+
::SharedTypes::Legacy::ArmorSlot mSlot;
68+
int mDefense;
69+
int mModelIndex;
70+
::HumanoidArmorItem::ArmorMaterial const& mArmorType;
71+
bool mCurrentVersionAllowsTrim;
72+
// NOLINTEND
5773

5874
public:
59-
MOD_NDAPI HumanoidArmorItem(std::string const& name, HumanoidArmorItem::Tier armorTier);
75+
// prevent constructor by default
76+
MOD_NDAPI HumanoidArmorItem(std::string const& name, HumanoidArmorItem::Tier armorTier);
77+
HumanoidArmorItem& operator=(HumanoidArmorItem const&);
78+
HumanoidArmorItem(HumanoidArmorItem const&);
79+
HumanoidArmorItem();
6080

81+
public:
82+
// virtual functions
83+
// NOLINTBEGIN
6184
// vIndex: 10
6285
virtual bool isHumanoidArmor() const /*override*/;
6386

64-
// vIndex: 53
87+
// vIndex: 54
6588
virtual bool isValidRepairItem(
6689
::ItemStackBase const& source,
6790
::ItemStackBase const& repairItem,
6891
::BaseGameVersion const& baseGameVersion
6992
) const /*override*/;
7093

71-
// vIndex: 54
94+
// vIndex: 55
7295
virtual int getEnchantSlot() const /*override*/;
7396

74-
// vIndex: 55
97+
// vIndex: 56
7598
virtual int getEnchantValue() const /*override*/;
7699

77-
// vIndex: 56
100+
// vIndex: 57
78101
virtual int getArmorValue() const /*override*/;
79102

80-
// vIndex: 57
103+
// vIndex: 58
81104
virtual int getToughnessValue() const /*override*/;
82105

83-
// vIndex: 121
106+
// vIndex: 124
84107
virtual float getArmorKnockbackResistance() const;
85108

86-
// vIndex: 67
109+
// vIndex: 68
87110
virtual bool hasCustomColor(::CompoundTag const* userData) const /*override*/;
88111

89-
// vIndex: 66
112+
// vIndex: 67
90113
virtual ::mce::Color getColor(::CompoundTag const* userData, ::ItemDescriptor const&) const /*override*/;
91114

92-
// vIndex: 69
115+
// vIndex: 70
93116
virtual void clearColor(::ItemStackBase& instance) const /*override*/;
94117

95-
// vIndex: 70
118+
// vIndex: 71
96119
virtual void setColor(::ItemStackBase& item, ::mce::Color const& color) const /*override*/;
97120

98121
// vIndex: 15
@@ -101,59 +124,79 @@ class HumanoidArmorItem : public ::Item {
101124
// vIndex: 22
102125
virtual bool isTrimAllowed() const /*override*/;
103126

104-
// vIndex: 101
127+
// vIndex: 104
105128
virtual ::SharedTypes::Legacy::ActorLocation getEquipLocation() const /*override*/;
106129

107-
// vIndex: 102
130+
// vIndex: 105
108131
virtual ::SharedTypes::Legacy::LevelSoundEvent getEquipSound() const /*override*/;
109132

110-
// vIndex: 61
133+
// vIndex: 62
111134
virtual int getDamageChance(int unbreaking) const /*override*/;
112135

113-
// vIndex: 78
136+
// vIndex: 81
114137
virtual bool dispense(::BlockSource& region, ::Container& container, int slot, ::Vec3 const& pos, uchar) const
115138
/*override*/;
116139

117-
// vIndex: 52
140+
// vIndex: 53
118141
virtual void appendFormattedHovertext(
119142
::ItemStackBase const& stack,
120143
::Level& level,
121144
::Bedrock::Safety::RedactableString& hovertext,
122145
bool const showCategory
123146
) const /*override*/;
124147

125-
// vIndex: 82
148+
// vIndex: 85
126149
virtual void hurtActor(::ItemStack& item, ::Actor& actor, ::Mob& attacker) const /*override*/;
127150

128-
// vIndex: 108
151+
// vIndex: 111
129152
virtual ::ResolvedItemIconInfo
130153
getIconInfo(::ItemStackBase const& item, int newAnimationFrame, bool inInventoryPane) const /*override*/;
131154

132-
// vIndex: 76
155+
// vIndex: 77
133156
virtual ::ItemStack& use(::ItemStack& item, ::Player& player) const /*override*/;
134157

135-
// vIndex: 74
158+
// vIndex: 75
136159
virtual int buildIdAux(short auxValue, ::CompoundTag const* userData) const /*override*/;
137160

138161
// vIndex: 0
139162
virtual ~HumanoidArmorItem() /*override*/ = default;
163+
// NOLINTEND
140164

141165
public:
166+
// member functions
167+
// NOLINTBEGIN
168+
MCAPI ::std::string _buildAttributeText() const;
169+
142170
MCAPI ::ItemInstance getTierItem() const;
171+
// NOLINTEND
143172

144173
public:
145-
MCAPI static ArmorMaterial const& CHAIN();
146-
MCAPI static ArmorMaterial const& COPPER();
147-
MCAPI static ::mce::Color& DEFAULT_LEATHER_COLOR();
148-
MCAPI static ArmorMaterial const& DIAMOND();
149-
MCAPI static ArmorMaterial const& ELYTRA();
150-
MCAPI static ArmorMaterial const& GOLD();
151-
MCAPI static ArmorMaterial const& IRON();
152-
MCAPI static ArmorMaterial const& LEATHER();
153-
MCAPI static ArmorMaterial const& NETHERITE();
154-
MCAPI static ArmorMaterial const& TURTLE();
174+
// static variables
175+
// NOLINTBEGIN
176+
MCAPI static ::HumanoidArmorItem::ArmorMaterial const& CHAIN();
177+
178+
MCAPI static ::HumanoidArmorItem::ArmorMaterial const& COPPER();
179+
180+
MCAPI static ::mce::Color& DEFAULT_LEATHER_COLOR();
181+
182+
MCAPI static ::HumanoidArmorItem::ArmorMaterial const& DIAMOND();
183+
184+
MCAPI static ::HumanoidArmorItem::ArmorMaterial const& ELYTRA();
185+
186+
MCAPI static ::HumanoidArmorItem::ArmorMaterial const& GOLD();
187+
188+
MCAPI static ::HumanoidArmorItem::ArmorMaterial const& IRON();
189+
190+
MCAPI static ::HumanoidArmorItem::ArmorMaterial const& LEATHER();
191+
192+
MCAPI static ::HumanoidArmorItem::ArmorMaterial const& NETHERITE();
193+
194+
MCAPI static ::HumanoidArmorItem::ArmorMaterial const& TURTLE();
195+
// NOLINTEND
155196

156197
public:
198+
// virtual function thunks
199+
// NOLINTBEGIN
157200
MCFOLD bool $isHumanoidArmor() const;
158201

159202
MCAPI bool $isValidRepairItem(
@@ -184,8 +227,6 @@ class HumanoidArmorItem : public ::Item {
184227

185228
MCAPI bool $isTrimAllowed() const;
186229

187-
MCAPI ::SharedTypes::Legacy::ActorLocation $getEquipLocation() const;
188-
189230
MCAPI ::SharedTypes::Legacy::LevelSoundEvent $getEquipSound() const;
190231

191232
MCAPI int $getDamageChance(int unbreaking) const;
@@ -207,7 +248,25 @@ class HumanoidArmorItem : public ::Item {
207248
MCAPI ::ItemStack& $use(::ItemStack& item, ::Player& player) const;
208249

209250
MCAPI int $buildIdAux(short auxValue, ::CompoundTag const* userData) const;
251+
// NOLINTEND
210252

211253
public:
254+
// vftables
255+
// NOLINTBEGIN
212256
MCNAPI static void** $vftable();
213-
};
257+
// NOLINTEND
258+
259+
// tmpe fix
260+
MOD_API PuvLoadData::LoadResultWithTiming initServer(
261+
Json::Value const& json,
262+
SemVersion const& version,
263+
IPackLoadContext& context,
264+
JsonBetaState state
265+
) override;
266+
MOD_API PuvLoadData::LoadResultWithTiming initClient(
267+
Json::Value const& json,
268+
SemVersion const& version,
269+
JsonBetaState state,
270+
IPackLoadContext& context
271+
) override;
272+
};

0 commit comments

Comments
 (0)