mirror of
https://github.com/quizhizhe/LiteLoaderBDS-1.16.40.git
synced 2025-06-05 03:43:40 +00:00
Add Level::getCurrentLevelPath and Level::getCurrentLevelName
This commit is contained in:
parent
59f02218d8
commit
f5888eb4da
@ -93,8 +93,8 @@ public:
|
|||||||
|
|
||||||
LIAPI static void sendPacketForAllPlayers(Packet& pkt);
|
LIAPI static void sendPacketForAllPlayers(Packet& pkt);
|
||||||
|
|
||||||
//LIAPI static std::string getCurrentLevelName();
|
LIAPI static std::string getCurrentLevelName();
|
||||||
//LIAPI static std::string getCurrentLevelPath();
|
LIAPI static std::string getCurrentLevelPath();
|
||||||
LIAPI static int64_t createBossEvent();
|
LIAPI static int64_t createBossEvent();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -365,26 +365,26 @@ void Level::sendPacketForAllPlayer(Packet& pkt) {
|
|||||||
sendPacketForAllPlayers(pkt);
|
sendPacketForAllPlayers(pkt);
|
||||||
}
|
}
|
||||||
|
|
||||||
// std::string Level::getCurrentLevelName() {
|
std::string Level::getCurrentLevelName() {
|
||||||
// if (Global<PropertiesSettings>)
|
if (Global<PropertiesSettings>)
|
||||||
// return Global<PropertiesSettings>->getLevelName();
|
return Global<PropertiesSettings>->getLevelName();
|
||||||
// std::ifstream fin("server.properties");
|
std::ifstream fin("server.properties");
|
||||||
// string buf;
|
string buf;
|
||||||
// while (getline(fin, buf)) {
|
while (getline(fin, buf)) {
|
||||||
// if (buf.find("level-name=") != string::npos) {
|
if (buf.find("level-name=") != string::npos) {
|
||||||
// if (buf.back() == '\n')
|
if (buf.back() == '\n')
|
||||||
// buf.pop_back();
|
buf.pop_back();
|
||||||
// if (buf.back() == '\r')
|
if (buf.back() == '\r')
|
||||||
// buf.pop_back();
|
buf.pop_back();
|
||||||
// return buf.substr(11);
|
return buf.substr(11);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// return "";
|
return "";
|
||||||
// }
|
}
|
||||||
|
|
||||||
// std::string Level::getCurrentLevelPath() {
|
std::string Level::getCurrentLevelPath() {
|
||||||
// return "./worlds/" + getCurrentLevelName();
|
return "./worlds/" + getCurrentLevelName();
|
||||||
// }
|
}
|
||||||
|
|
||||||
int64_t BossID = 7492341231332ull;
|
int64_t BossID = 7492341231332ull;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user