adapt 1.19.72

This commit is contained in:
Tsubasa6848
2023-03-26 00:30:03 +08:00
Unverified
parent 8878a9db3e
commit 5999a9208f
6 changed files with 151 additions and 49 deletions
+99
View File
@@ -0,0 +1,99 @@
{
"files.associations": {
"*.inc": "cpp",
"string": "cpp",
"array": "cpp",
"bitset": "cpp",
"deque": "cpp",
"initializer_list": "cpp",
"list": "cpp",
"queue": "cpp",
"random": "cpp",
"ranges": "cpp",
"regex": "cpp",
"span": "cpp",
"stack": "cpp",
"type_traits": "cpp",
"valarray": "cpp",
"vector": "cpp",
"xhash": "cpp",
"xstring": "cpp",
"xtree": "cpp",
"xutility": "cpp",
"multi_span": "cpp",
"string_span": "cpp",
"algorithm": "cpp",
"atomic": "cpp",
"bit": "cpp",
"cctype": "cpp",
"charconv": "cpp",
"chrono": "cpp",
"cinttypes": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"codecvt": "cpp",
"compare": "cpp",
"concepts": "cpp",
"condition_variable": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cuchar": "cpp",
"cwchar": "cpp",
"exception": "cpp",
"filesystem": "cpp",
"format": "cpp",
"forward_list": "cpp",
"fstream": "cpp",
"functional": "cpp",
"future": "cpp",
"iomanip": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"iterator": "cpp",
"limits": "cpp",
"locale": "cpp",
"map": "cpp",
"memory": "cpp",
"mutex": "cpp",
"new": "cpp",
"numeric": "cpp",
"optional": "cpp",
"ostream": "cpp",
"ratio": "cpp",
"set": "cpp",
"shared_mutex": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"stop_token": "cpp",
"streambuf": "cpp",
"system_error": "cpp",
"thread": "cpp",
"tuple": "cpp",
"typeinfo": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"utility": "cpp",
"variant": "cpp",
"xfacet": "cpp",
"xiosbase": "cpp",
"xlocale": "cpp",
"xlocbuf": "cpp",
"xlocinfo": "cpp",
"xlocmes": "cpp",
"xlocmon": "cpp",
"xlocnum": "cpp",
"xloctime": "cpp",
"xmemory": "cpp",
"xstddef": "cpp",
"xtr1common": "cpp",
"pointers": "cpp"
}
}
Submodule SDK deleted from e69dbb19df
+36 -29
View File
@@ -146,71 +146,76 @@ void CleanerMain(){
} }
} }
ifautoclean = true; ifautoclean = true;
LoadLanguageFromJson(LanguageFile); auto opt = output4;
if(Settings::sendbroadcast == true){ ReplaceStr(opt, "{0}", std::to_string(k));
Level::broadcastText(before + ReplaceStr(output4,"{0}",std::to_string(k)),TextType::RAW); if (Settings::sendbroadcast == true) {
Level::broadcastText(before + opt, TextType::RAW);
} }
if(Settings::sendtoast == true){ if (Settings::sendtoast == true) {
auto players = Level::getAllPlayers(); auto players = Level::getAllPlayers();
if(players.size() >= 1){ if(players.size() >= 1){
for(int tg = 0; tg <= players.size()-1; tg++){ for(int tg = 0; tg <= players.size()-1; tg++){
players[tg]->sendToastPacket(notice,before + ReplaceStr(output4,"{0}",std::to_string(k))); players[tg]->sendToastPacket(notice,before + opt);
} }
} }
} }
if(Settings::logtoconsole == true){ if (Settings::logtoconsole == true) {
logger.info(ReplaceStr(output4,"{0}",std::to_string(k))); logger.info(opt);
} }
} }
else{ else{
LoadLanguageFromJson(LanguageFile); auto opt = output4;
ReplaceStr(opt, "{0}", "0");
if(Settings::sendbroadcast == true){ if(Settings::sendbroadcast == true){
Level::broadcastText(before + ReplaceStr(output4,"{0}","0"),TextType::RAW); Level::broadcastText(before + opt, TextType::RAW);
} }
if(Settings::sendtoast == true){ if(Settings::sendtoast == true){
auto players = Level::getAllPlayers(); auto players = Level::getAllPlayers();
if(players.size() >= 1){ if(players.size() >= 1){
for(int tg = 0; tg <= players.size()-1; tg++){ for(int tg = 0; tg <= players.size()-1; tg++){
players[tg]->sendToastPacket(notice,before + ReplaceStr(output4,"{0}","0")); players[tg]->sendToastPacket(notice,before + opt);
} }
} }
} }
if(Settings::logtoconsole == true){ if(Settings::logtoconsole == true){
logger.info(ReplaceStr(output4,"{0}","0")); logger.info(opt);
} }
} }
} }
void Count1(){ void Count1(){
auto opt = output02;
ReplaceStr(opt,"{0}",std::to_string(pre2));
if(Settings::sendbroadcast == true){ if(Settings::sendbroadcast == true){
Level::broadcastText(before + ReplaceStr(output02,"{0}",std::to_string(pre2)),TextType::RAW); Level::broadcastText(before + opt, TextType::RAW);
} }
if(Settings::logtoconsole == true){ if(Settings::logtoconsole == true){
logger.info(ReplaceStr(output02,"{0}",std::to_string(pre2))); logger.info(opt);
} }
if(Settings::sendtoast == true){ if(Settings::sendtoast == true){
auto players = Level::getAllPlayers(); auto players = Level::getAllPlayers();
if(players.size() >= 1){ if(players.size() >= 1){
for(int tga = 0; tga <= players.size()-1; tga++){ for(int tga = 0; tga <= players.size()-1; tga++){
players[tga]->sendToastPacket(notice,before + ReplaceStr(output02,"{0}",std::to_string(pre2))); players[tga]->sendToastPacket(notice,before + opt);
} }
} }
} }
} }
void _CleanerMain(){ void _CleanerMain(){
LoadLanguageFromJson(LanguageFile); auto opt = output01;
if(Settings::sendbroadcast == true){ ReplaceStr(opt,"{0}", std::to_string(pre1));
Level::broadcastText(before + ReplaceStr(output01,"{0}",std::to_string(pre1)),TextType::RAW); if (Settings::sendbroadcast == true) {
Level::broadcastText(before + opt, TextType::RAW);
} }
if(Settings::logtoconsole == true){ if (Settings::logtoconsole == true) {
logger.info(ReplaceStr(output01,"{0}",std::to_string(pre1))); logger.info(opt);
} }
if(Settings::sendtoast == true){ if (Settings::sendtoast == true) {
auto players = Level::getAllPlayers(); auto players = Level::getAllPlayers();
if(players.size() >= 1){ if(players.size() >= 1){
for(int tg = 0; tg <= players.size()-1; tg++){ for(int tg = 0; tg <= players.size()-1; tg++){
players[tg]->sendToastPacket(notice,before + ReplaceStr(output01,"{0}",std::to_string(pre1))); players[tg]->sendToastPacket(notice,before + opt);
} }
} }
} }
@@ -349,18 +354,19 @@ void _AutoClean() {
} }
if (j >= Settings::triggercount) { if (j >= Settings::triggercount) {
ifautoclean = false; ifautoclean = false;
LoadLanguageFromJson(LanguageFile); auto opt = trigger1;
ReplaceStr(opt,"{0}", std::to_string(j));
if(Settings::logtoconsole == true){ if(Settings::logtoconsole == true){
logger.warn(ReplaceStr(trigger1,"{0}",std::to_string(j))); logger.warn(opt);
} }
if(Settings::sendtoast == true){ if(Settings::sendtoast == true){
auto players = Level::getAllPlayers(); auto players = Level::getAllPlayers();
for(int tg = 0; tg <= players.size()-1; tg++){ for(int tg = 0; tg <= players.size()-1; tg++){
players[tg]->sendToastPacket(notice,before + ReplaceStr(trigger1,"{0}",std::to_string(j))); players[tg]->sendToastPacket(notice,before + opt);
} }
} }
if(Settings::sendbroadcast == true){ if(Settings::sendbroadcast == true){
Level::broadcastText(before + ReplaceStr(trigger1,"{0}",std::to_string(j)),TextType::RAW); Level::broadcastText(before + opt, TextType::RAW);
} }
_CleanerMain(); _CleanerMain();
} }
@@ -379,18 +385,19 @@ void AutoClean(){
void TPSClean(){ void TPSClean(){
Schedule::repeat([]{ Schedule::repeat([]{
if(enabletpsclean == true && Tick_per_minute <= triggertps){ if(enabletpsclean == true && Tick_per_minute <= triggertps){
LoadLanguageFromJson(LanguageFile); auto opt = triggertpsclean;
ReplaceStr(opt,"{0}", std::to_string(Tick_per_minute));
if(Settings::logtoconsole == true){ if(Settings::logtoconsole == true){
logger.warn(ReplaceStr(triggertpsclean,"{0}",std::to_string(Tick_per_minute))); logger.warn(opt);
} }
if(Settings::sendtoast == true){ if(Settings::sendtoast == true){
auto players = Level::getAllPlayers(); auto players = Level::getAllPlayers();
for(int tg = 0; tg <= players.size()-1; tg++){ for(int tg = 0; tg <= players.size()-1; tg++){
players[tg]->sendToastPacket(notice,before + ReplaceStr(triggertpsclean,"{0}",std::to_string(Tick_per_minute))); players[tg]->sendToastPacket(notice,before + opt);
} }
} }
if(Settings::sendbroadcast == true){ if(Settings::sendbroadcast == true){
Level::broadcastText(before + ReplaceStr(triggertpsclean,"{0}",std::to_string(Tick_per_minute)),TextType::RAW); Level::broadcastText(before + opt, TextType::RAW);
} }
_CleanerMain(); _CleanerMain();
} }
+8 -10
View File
@@ -3,7 +3,6 @@
#include "setting.h" #include "setting.h"
#include <llapi/mc/Player.hpp> #include <llapi/mc/Player.hpp>
#include <llapi/mc/Level.hpp> #include <llapi/mc/Level.hpp>
using namespace LanguageSettings; using namespace LanguageSettings;
using namespace Form; using namespace Form;
@@ -12,7 +11,6 @@ string finished;
extern bool checkcanvote; extern bool checkcanvote;
extern bool checktimeout; extern bool checktimeout;
extern int ac_count; extern int ac_count;
extern string before; extern string before;
extern void _CleanerMain(); extern void _CleanerMain();
@@ -30,7 +28,7 @@ void ConfirmForm(Player* player){
} }
} }
else{ else{
if(checktimeout = true){ if (checktimeout = true) {
player->sendText(rede); player->sendText(rede);
} }
else{ else{
@@ -54,22 +52,22 @@ void VoteForm(Player* player){
checkcanvote = false; checkcanvote = false;
Schedule::delay([]{ Schedule::delay([]{
checkcanvote = true; checkcanvote = true;
},20*Settings::cd); }, 20*Settings::cd);
Schedule::delay([]{ Schedule::delay([]{
auto all = Global<Level>->getAllPlayers().size(); auto all = Global<Level>->getAllPlayers().size();
int caculate = 100*ac_count/all; int caculate = 100*ac_count/all;
checktimeout = false; checktimeout = false;
if(caculate >= Settings::percentage){ if (caculate >= Settings::percentage) {
Global<Level>->broadcastText(before + votesuccess,TextType::RAW); Level::broadcastText(before + votesuccess, TextType::RAW);
_CleanerMain(); _CleanerMain();
} }
else{ else {
Global<Level>->broadcastText(before + votefail,TextType::RAW); Level::broadcastText(before + votefail, TextType::RAW);
} }
},20*Settings::votedelay); }, 20*Settings::votedelay);
} }
else{ else{
player->sendText(sendcancel); player->sendText(sendcancel, TextType::RAW);
} }
}); });
} }
+4 -5
View File
@@ -47,14 +47,14 @@ void RegCleanCommand(){
auto command = DynamicCommand::createCommand(Settings::cleancommand, cmdclean + endstr, CommandPermissionLevel::GameMasters, { (CommandFlagValue)0x80 }, { (CommandFlagValue)1 }); auto command = DynamicCommand::createCommand(Settings::cleancommand, cmdclean + endstr, CommandPermissionLevel::GameMasters, { (CommandFlagValue)0x80 }, { (CommandFlagValue)1 });
command->addOverload(); command->addOverload();
command->setCallback([](DynamicCommand const& command, CommandOrigin const& origin, CommandOutput& output, std::unordered_map<std::string, DynamicCommand::Result>& results) { command->setCallback([](DynamicCommand const& command, CommandOrigin const& origin, CommandOutput& output, std::unordered_map<std::string, DynamicCommand::Result>& results) {
if(Settings::sendbroadcast == true){ if (Settings::sendbroadcast == true) {
Global<Level>->broadcastText(before + opclean,TextType::RAW); Level::broadcastText(before + opclean, TextType::RAW);
} }
if(Settings::sendtoast == true){ if (Settings::sendtoast == true) {
auto players = Global<Level>->getAllPlayers(); auto players = Global<Level>->getAllPlayers();
if(players.size() >= 1){ if(players.size() >= 1){
for(int tg = 0; tg <= players.size()-1; tg++){ for(int tg = 0; tg <= players.size()-1; tg++){
players[tg]->sendToastPacket(notice,before + opclean); players[tg]->sendToastPacket(notice, before + opclean);
} }
} }
} }
@@ -91,7 +91,6 @@ void RegDespawnCommand(){
ens[i]->despawn(); ens[i]->despawn();
} }
LoadLanguageFromJson(LanguageFile); LoadLanguageFromJson(LanguageFile);
return output.success(ReplaceStr(despawnsuccess,"{0}",std::to_string(ens.size()))); return output.success(ReplaceStr(despawnsuccess,"{0}",std::to_string(ens.size())));
} }
else return output.error(notarget); else return output.error(notarget);
+2 -2
View File
@@ -9,9 +9,9 @@
#define PLUGIN_AUTHOR "Tsubasa6848" #define PLUGIN_AUTHOR "Tsubasa6848"
#define PLUGIN_VERSION_MAJOR 1 #define PLUGIN_VERSION_MAJOR 1
#define PLUGIN_VERSION_MINOR 6 #define PLUGIN_VERSION_MINOR 6
#define PLUGIN_VERSION_REVISION 10 #define PLUGIN_VERSION_REVISION 21
#define PLUGIN_VERSION_BUILD 0 #define PLUGIN_VERSION_BUILD 0
#define TARGET_BDS_PROTOCOL_VERSION 568 #define TARGET_BDS_PROTOCOL_VERSION 575
#define __TO_VERSION_STRING(ver) #ver #define __TO_VERSION_STRING(ver) #ver
#define TO_VERSION_STRING(ver) __TO_VERSION_STRING(ver) #define TO_VERSION_STRING(ver) __TO_VERSION_STRING(ver)
#define PLUGIN_LLVERSION_STATUS ll::Version::Release #define PLUGIN_LLVERSION_STATUS ll::Version::Release