Skip to content

Commit

Permalink
adapt: adapt LeviLamina 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
KobeBryant114514 committed Jan 18, 2024
1 parent 1395af6 commit a16bae4
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 13 deletions.
4 changes: 4 additions & 0 deletions include/GMLIB/Server/FloatingTextAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class FloatingText {
public:
static FloatingText* getFloatingText(int64 runtimeId);

static bool deleteFloatingText(int64 runtimeId);

public:
virtual ~FloatingText();

Expand All @@ -29,4 +31,6 @@ class FloatingText {
virtual void removeFromAllClients();

virtual void updateText(std::string newText);

//virtual bool removeFromServer();
};
11 changes: 6 additions & 5 deletions include/GMLIB/Server/PlayerAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,12 @@ class GMLIB_Player : public Player {

GMLIB_API bool resetScore();

GMLIB_API void setClientSidebar(
const std::string title,
const std::vector<std::pair<std::string, int>>& data,
ObjectiveSortOrder sortOrder = ObjectiveSortOrder::Ascending
);
// Broken
// GMLIB_API void setClientSidebar(
// const std::string title,
// const std::vector<std::pair<std::string, int>>& data,
// ObjectiveSortOrder sortOrder = ObjectiveSortOrder::Ascending
// );

GMLIB_API void removeClientSidebar();

Expand Down
2 changes: 2 additions & 0 deletions src/Server/FormAPI/NpcDialogueForm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ LL_AUTO_INSTANCE_HOOK(
ll::service::getLevel()->forEachPlayer([](Player& pl) -> bool {
logger.warn("{}", pl.getRealName());
sendFakeNpc(&pl);
//auto gpl = (GMLIB_Player*)&pl;
//gpl->setClientSidebar("114514", {{"114", 1}, {"514", 2},{ "1919810", 3}});
return true;
});
origin(a1, a2, a3);
Expand Down
2 changes: 2 additions & 0 deletions src/Server/PlayerAPI.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ type, int value, std::string& fakeName) : mScoreboardId(*scoreboardId) , mObject
}
*/

/*
void GMLIB_Player::setClientSidebar(
const std::string title,
const std::vector<std::pair<std::string, int>>& data,
Expand All @@ -184,6 +185,7 @@ void GMLIB_Player::setClientSidebar(
SetDisplayObjectivePacket("sidebar", "GMLIB_SIDEBAR_API", title, "dummy", ObjectiveSortOrder(sortOrder))
.sendTo(*this);
}
*/

void GMLIB_Player::removeClientSidebar() {
SetDisplayObjectivePacket("sidebar", "", "", "dummy", ObjectiveSortOrder::Ascending).sendTo(*this);
Expand Down
14 changes: 7 additions & 7 deletions src/include_all.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,12 @@
#include <ll/api/event/player/PlayerSwingEvent.h>
#include <ll/api/event/player/PlayerUseItemEvent.h>
#include <ll/api/event/player/PlayerUseItemOnEvent.h>
#include <ll/api/event/server/ServerStartedEvent.h>
#include <ll/api/event/server/ServerStoppingEvent.h>
#include <ll/api/event/server/ServiceEvents.h>
#include <ll/api/event/world/BlockChangedEvent.h>
#include <ll/api/event/world/FireSpreadEvent.h>
#include <ll/api/event/world/LevelEvent.h>
#include <ll/api/event/world/ServerStartedEvent.h>
#include <ll/api/event/world/ServerStoppingEvent.h>
#include <ll/api/event/world/SpawnMobEvent.h>
#include <ll/api/event/world/WorldEvent.h>
#include <ll/api/form/CustomForm.h>
Expand Down Expand Up @@ -98,6 +99,9 @@
#include <ll/api/schedule/Task.h>
#include <ll/api/service/Bedrock.h>
#include <ll/api/service/PlayerInfo.h>
#include <ll/api/service/Service.h>
#include <ll/api/service/ServiceId.h>
#include <ll/api/service/ServiceManager.h>
#include <ll/api/thread/GlobalThreadPauser.h>
#include <ll/api/thread/InterruptableSleep.h>
#include <ll/api/thread/SharedRecursiveMutex.h>
Expand Down Expand Up @@ -2385,6 +2389,7 @@
#include <mc/external/concurrentqueue/ConcurrentQueue.h>
#include <mc/external/concurrentqueue/ConcurrentQueueDefaultTraits.h>
#include <mc/external/concurrentqueue/moodycamel.h>
#include <mc/external/expected_lite/expected.h>
#include <mc/external/glm/glm.h>
#include <mc/external/glm/mat.h>
#include <mc/external/glm/qua.h>
Expand All @@ -2397,11 +2402,6 @@
#include <mc/external/lib_http_client/ThreadPoolImpl.h>
#include <mc/external/lib_http_client/WaitTimer.h>
#include <mc/external/lib_http_client/WaitTimerImpl.h>
#include <mc/external/nonstd/detail.h>
#include <mc/external/nonstd/expected.h>
#include <mc/external/nonstd/expected_lite.h>
#include <mc/external/nonstd/nonstd.h>
#include <mc/external/nonstd/storage_t.h>
#include <mc/external/openssl/evp_md_st.h>
#include <mc/external/openssl/ssl_ctx_st.h>
#include <mc/external/openssl/ssl_session_st.h>
Expand Down
7 changes: 6 additions & 1 deletion xmake.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
add_rules("mode.debug", "mode.release", "mode.releasedbg")

add_repositories("liteldev-repo https://github.com/LiteLDev/xmake-repo.git")
add_requires("levilamina 0.4.1") -- or add_requires("levilamina x.x.x") to specify target LeviLamina version

if not has_config("vs_runtime") then
set_runtimes("MD")
end

add_requires("levilamina") -- or add_requires("levilamina x.x.x") to specify target LeviLamina version

target("GMLIB") -- Change this to your plugin name.
add_cxflags(
Expand Down

0 comments on commit a16bae4

Please sign in to comment.