feat: adapt to Levilamina 26.10.0
This commit is contained in:
@@ -443,25 +443,16 @@ void Export_Compatibility_API() {
|
||||
});
|
||||
RemoteCall::exportAs("GMLIB_API", "getWorldSpawn", []() -> std::pair<BlockPos, int> {
|
||||
constexpr static HashedString SPAWN_POS{"spawnPos"};
|
||||
using mUnkfc867e = std::variant<
|
||||
int,
|
||||
bool,
|
||||
float,
|
||||
std::string,
|
||||
GeneratorType,
|
||||
GameType,
|
||||
BlockPos,
|
||||
LevelSeed64,
|
||||
LevelDataValue::Tag,
|
||||
DaylightCycle>;
|
||||
|
||||
auto& levelData = GMLevel::getInstance()->getLevelData();
|
||||
if (auto it = levelData.mValues->find(SPAWN_POS); it != levelData.mValues->end()) {
|
||||
if (auto value = std::get_if<BlockPos>(&it->second.mUnkfc867e.as<mUnkfc867e>()); value) {
|
||||
|
||||
if (auto value = std::get_if<BlockPos>(&it->second.mValue.get()); value) {
|
||||
return {*value, 0};
|
||||
}
|
||||
}
|
||||
if (auto it = levelData.mOverrides->find(SPAWN_POS); it != levelData.mOverrides->end()) {
|
||||
if (auto value = std::get_if<BlockPos>(&it->second.mUnkfc867e.as<mUnkfc867e>()); value) {
|
||||
if (auto value = std::get_if<BlockPos>(&it->second.mValue.get()); value) {
|
||||
return {*value, 0};
|
||||
}
|
||||
}
|
||||
@@ -471,7 +462,8 @@ void Export_Compatibility_API() {
|
||||
if (pos.second != 0) return false;
|
||||
GMLevel::getInstance()->getLevelData().setSpawnPos(pos.first);
|
||||
auto pkt = SetSpawnPositionPacket();
|
||||
pkt.mSpawnBlockPos = NetworkBlockPosition(pos.first);
|
||||
pkt.mSpawnBlockPos = pos.first;
|
||||
|
||||
pkt.mDimensionType = 0;
|
||||
pkt.mSpawnPosType = SpawnPositionType::WorldSpawn;
|
||||
pkt.sendToClients();
|
||||
@@ -752,7 +744,7 @@ void Export_Compatibility_API() {
|
||||
return entity->getNameTag();
|
||||
});
|
||||
RemoteCall::exportAs("GMLIB_API", "ItemisUnbreakable", [](ItemStack const* item) -> bool {
|
||||
return ((GMItemStack*)item)->isUnbreakable();
|
||||
return ((GMItemStack*)item)->getUnbreakable();
|
||||
});
|
||||
RemoteCall::exportAs("GMLIB_API", "setItemUnbreakable", [](ItemStack const* item, bool value) -> void {
|
||||
((GMItemStack*)item)->setUnbreakable(value);
|
||||
|
||||
+2
-2
@@ -22,8 +22,8 @@ using namespace modapi;
|
||||
#define PLUGIN_NAME fmt::format(fg(fmt::color::light_green), "GMLIB-LRCA")
|
||||
|
||||
#define LIB_VERSION_MAJOR 1
|
||||
#define LIB_VERSION_MINOR 7
|
||||
#define LIB_VERSION_PATCH 1
|
||||
#define LIB_VERSION_MINOR 8
|
||||
#define LIB_VERSION_PATCH 0
|
||||
#define LIB_VERSION_PRERELEASE std::nullopt
|
||||
|
||||
#ifdef LIB_VERSION_PRERELEASE
|
||||
|
||||
@@ -8,12 +8,12 @@ if not has_config("vs_runtime") then
|
||||
set_runtimes("MD")
|
||||
end
|
||||
|
||||
add_requires("levilamina 050b392575227db10340075328e833c1a0f41e27", {configs = {target_type = "server"}})
|
||||
add_requires("levilamina 26.10.5", {configs = {target_type = "server"}})
|
||||
add_requires("legacyremotecall")
|
||||
add_requires("levibuildscript 0.6.0")
|
||||
add_requires("ilistenattentively 0.11.0")
|
||||
add_requires("gmlib 1.9.0")
|
||||
add_requires("modapi 0.4.0")
|
||||
add_requires("ilistenattentively 0.12.0")
|
||||
add_requires("gmlib 26.10.0")
|
||||
add_requires("modapi 26.10.0")
|
||||
|
||||
target("GMLIB-LegacyRemoteCallApi")
|
||||
add_cxflags(
|
||||
|
||||
Reference in New Issue
Block a user