Skip to content

Commit

Permalink
style: format all code
Browse files Browse the repository at this point in the history
  • Loading branch information
futrime committed Jan 22, 2024
1 parent a6f3e22 commit 4e6d044
Show file tree
Hide file tree
Showing 97 changed files with 171 additions and 69 deletions.
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ PointerAlignment: Left
TabWidth: 4
UseTab: Never
SortIncludes: CaseSensitive
IncludeBlocks: Regroup
12 changes: 4 additions & 8 deletions src/api/APIHelp.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#include "api/APIHelp.h"

#include <cmath>
#include <iostream>
#include <memory>
#include <string>
#include <vector>

#include "api/BaseAPI.h"
#include "api/BlockAPI.h"
#include "api/ContainerAPI.h"
Expand All @@ -15,13 +9,15 @@
#include "api/EntityAPI.h"
#include "api/GuiAPI.h"
#include "api/ItemAPI.h"
#include "api/NativeAPI.h"
#include "api/NbtAPI.h"
#include "api/NetworkAPI.h"
#include "api/PlayerAPI.h"
#include "engine/EngineOwnData.h"
#include "main/Global.h"

#include "api/NativeAPI.h"
#include <cmath>
#include <string>
#include <vector>

//////////////////// APIs ////////////////////
template <typename T>
Expand Down
13 changes: 5 additions & 8 deletions src/api/APIHelp.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
#pragma once

#include <exception>
#include <string>

#include <magic_enum.hpp>

#include "mc/world/level/Level.h"

#include "engine/EngineOwnData.h"
#include "ll/api/utils/ErrorUtils.h"
#include "main/Global.h"
#include "mc/world/level/Level.h"
#include "utils/JsonHelper.h"
#include "utils/UsingScriptX.inc"

#include "ll/api/utils/ErrorUtils.h"
#include <exception>
#include <magic_enum.hpp>
#include <string>

// 输出异常信息
inline void PrintException(const script::Exception& e) {
Expand Down
11 changes: 5 additions & 6 deletions src/api/BaseAPI.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#include "api/BaseAPI.h"

#include <cmath>

#include "mc/world/Facing.h"
#include <mc/world/actor/ActorDamageSource.h>
#include <mc/world/level/BlockSource.h>

#include "api/APIHelp.h"
#include "api/McAPI.h"
#include "main/Global.h"
#include "mc/common/Common.h"
#include "mc/common/SharedConstants.h"
#include "mc/world/Facing.h"

#include <cmath>
#include <mc/world/actor/ActorDamageSource.h>
#include <mc/world/level/BlockSource.h>

///////////////////// Enum //////////////////////
ClassDefine<void> DamageCauseEnumBuilder = EnumDefineBuilder<ActorDamageCause>::build("DamageCause");
Expand Down
2 changes: 2 additions & 0 deletions src/api/BlockAPI.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "api/BlockAPI.h"

#include "ScriptX/ScriptX.h"
#include "api/APIHelp.h"
#include "api/BaseAPI.h"
Expand All @@ -17,6 +18,7 @@
#include "mc/world/level/block/Block.h"
#include "mc/world/level/block/actor/BlockActor.h"
#include "mc/world/level/dimension/Dimension.h"

#include <exception>

//////////////////// Class Definition ////////////////////
Expand Down
1 change: 1 addition & 0 deletions src/api/BlockAPI.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
#include "api/APIHelp.h"
#include "main/Global.h"

#include <string>

//////////////////// Classes ////////////////////
Expand Down
1 change: 1 addition & 0 deletions src/api/BlockEntityAPI.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "api/BlockEntityAPI.h"

#include "api/APIHelp.h"
#include "api/BaseAPI.h"
#include "api/BlockAPI.h"
Expand Down
2 changes: 2 additions & 0 deletions src/api/CommandAPI.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// #include "api/DynamicCommandAPI.h"
#include "api/CommandAPI.h"

#include "api/BaseAPI.h"
#include "api/BlockAPI.h"
#include "api/CommandOriginAPI.h"
Expand Down Expand Up @@ -32,6 +33,7 @@
#include "mc/world/item/registry/ItemStack.h"
#include "mc/world/level/dimension/Dimension.h"
#include "utils/Utils.h"

#include <filesystem>
#include <string>
#include <vector>
Expand Down
1 change: 1 addition & 0 deletions src/api/CommandCompatibleAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "main/Configs.h"
#include "main/Global.h"
#include "utils/Utils.h"

#include <filesystem>
#include <ll/api/command/CommandRegistrar.h>
#include <string>
Expand Down
1 change: 1 addition & 0 deletions src/api/CommandCompatibleAPI.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once
#include "api/APIHelp.h"

#include <string>
#include <vector>

Expand Down
1 change: 1 addition & 0 deletions src/api/CommandOriginAPI.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "api/CommandOriginAPI.h"

#include "api/APIHelp.h"
#include "api/BaseAPI.h"
#include "api/BlockAPI.h"
Expand Down
1 change: 1 addition & 0 deletions src/api/CommandOutputAPI.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "api/CommandOutputAPI.h"

#include "mc/server/commands/CommandOutputMessageType.h"

//////////////////// Class Definition ////////////////////
Expand Down
1 change: 1 addition & 0 deletions src/api/CommandOutputAPI.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once
#include "api/APIHelp.h"

#include <mc/server/commands/CommandOutput.h>

class CommandOutputClass;
Expand Down
1 change: 1 addition & 0 deletions src/api/ContainerAPI.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "api/ContainerAPI.h"

#include "api/APIHelp.h"
#include "api/ItemAPI.h"
#include "api/NativeAPI.h"
Expand Down
1 change: 1 addition & 0 deletions src/api/ContainerAPI.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
#include "api/APIHelp.h"
#include "mc/world/Container.h"

#include <string>

//////////////////// Classes ////////////////////
Expand Down
2 changes: 2 additions & 0 deletions src/api/DataAPI.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "api/DataAPI.h"

#include "api/APIHelp.h"
#include "api/DatabaseAPI.h"

#include <fstream>
#include <string>
#include <vector>
Expand Down
1 change: 1 addition & 0 deletions src/api/DataAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "api/APIHelp.h"
#include "utils/IniHelper.h"
#include "utils/JsonHelper.h"

#include <memory>
#include <string>

Expand Down
2 changes: 2 additions & 0 deletions src/api/DeviceAPI.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "api/DeviceAPI.h"

#include "api/APIHelp.h"
#include "ll/api/service/Bedrock.h"
#include "magic_enum.hpp"
Expand All @@ -7,6 +8,7 @@
#include "mc/network/ServerNetworkHandler.h"
#include "mc/world/actor/player/Player.h"
#include "mc/world/level/Level.h"

#include <string>

//////////////////// Class Definition ////////////////////
Expand Down
2 changes: 2 additions & 0 deletions src/api/EntityAPI.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "api/EntityAPI.h"

#include "api/APIHelp.h"
#include "api/BaseAPI.h"
#include "api/BlockAPI.h"
Expand All @@ -19,6 +20,7 @@
#include "mc/world/effect/MobEffectInstance.h"
#include "mc/world/level/Spawner.h"
#include "mc/world/level/block/Block.h"

#include <magic_enum.hpp>
#include <mc/entity/EntityContext.h>
#include <mc/entity/utilities/ActorMobilityUtils.h>
Expand Down
20 changes: 10 additions & 10 deletions src/api/EventAPI.cpp
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
#include "api/EventAPI.h"

#include "EntityAPI.h"
#include "api/APIHelp.h"
#include "api/McAPI.h"
#include "api/PlayerAPI.h"
#include "engine/EngineOwnData.h"
#include "engine/GlobalShareData.h"
#include "ll/api/chrono/GameChrono.h"
#include "ll/api/event/EventBus.h"
#include "ll/api/schedule/Scheduler.h"
#include "ll/api/schedule/Task.h"
#include "ll/api/service/Bedrock.h"
#include "main/Global.h"
#include <exception>
#include <list>
#include <shared_mutex>

#include "EntityAPI.h"
#include "ll/api/event/EventBus.h"
#include "ll/api/event/player/PlayerChatEvent.h"
#include "ll/api/event/player/PlayerConnectEvent.h"
#include "ll/api/event/player/PlayerDieEvent.h"
#include "ll/api/event/player/PlayerJoinEvent.h"
#include "ll/api/event/player/PlayerLeaveEvent.h"
#include "ll/api/event/player/PlayerRespawnEvent.h"
#include "ll/api/schedule/Scheduler.h"
#include "ll/api/schedule/Task.h"
#include "ll/api/service/Bedrock.h"
#include "main/Global.h"
#include "mc/world/actor/player/Player.h"
#include "mc/world/level/dimension/Dimension.h"

#include <exception>
#include <list>
#include <shared_mutex>

//////////////////// Listeners ////////////////////

enum class EVENT_TYPES : int {
Expand Down
1 change: 0 additions & 1 deletion src/api/EventAPI.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once
#include "api/APIHelp.h"

#include "main/EconomicSystem.h"

//////////////////// Funcs ////////////////////
Expand Down
2 changes: 2 additions & 0 deletions src/api/FileSystemAPI.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#include "api/FileSystemAPI.h"

#include "api/APIHelp.h"
#include "engine/EngineManager.h"
#include "engine/LocalShareData.h"
#include "engine/TimeTaskSystem.h"
#include "ll/api/service/ServerInfo.h"

#include <corecrt_io.h>
#include <filesystem>
#include <fstream>
Expand Down
1 change: 1 addition & 0 deletions src/api/GameUtilsAPI.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "api/GameUtilsAPI.h"

#include "api/APIHelp.h"


Expand Down
2 changes: 2 additions & 0 deletions src/api/GuiAPI.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "api/GuiAPI.h"

#include "api/APIHelp.h"
#include "api/McAPI.h"
#include "api/PlayerAPI.h"
Expand All @@ -9,6 +10,7 @@

// #include <llapi/SendPacketAPI.h> //todo
#include "ll/api/service/ServerInfo.h"

#include <iostream>
#include <mc/world/actor/player/Player.h>

Expand Down
1 change: 0 additions & 1 deletion src/api/GuiAPI.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once
#include "api/APIHelp.h"

#include "ll/api/form/CustomForm.h"
#include "ll/api/form/FormBase.h"
#include "ll/api/form/SimpleForm.h"
Expand Down
1 change: 1 addition & 0 deletions src/api/InternationalAPI.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#define NEW_DEFINES
#include "api/InternationalAPI.h"

#include <FMT/args.h>
#include <ll/api/i18n/I18nAPI.h>

Expand Down
2 changes: 2 additions & 0 deletions src/api/ItemAPI.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "api/ItemAPI.h"

#include "api/APIHelp.h"
#include "api/BaseAPI.h"
#include "api/EntityAPI.h"
Expand All @@ -9,6 +10,7 @@
#include "mc/world/actor/Actor.h"
#include "mc/world/level/Spawner.h"
#include "mc/world/level/dimension/Dimension.h"

#include <mc/nbt/CompoundTag.h>
#include <mc/world/item/Item.h>
#include <mc/world/item/registry/ItemStack.h>
Expand Down
1 change: 1 addition & 0 deletions src/api/ItemAPI.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once
#include "api/APIHelp.h"

#include <string>


Expand Down
2 changes: 2 additions & 0 deletions src/api/LlAPI.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#include "api/LlAPI.h"

#include "api/APIHelp.h"
#include "engine/EngineOwnData.h"
#include "engine/GlobalShareData.h"
#include "ll/api/utils/WinUtils.h"
#include "utils/Utils.h"

#include <filesystem>
#include <map>
#include <string>
Expand Down
2 changes: 2 additions & 0 deletions src/api/LoggerAPI.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#include "api/LoggerAPI.h"

#include "api/APIHelp.h"
#include "api/PlayerAPI.h"
#include "engine/EngineOwnData.h"
#include "mc/world/actor/player/Player.h"
#include "utils/Utils.h"

#include <fstream>
#include <iostream>
#include <sstream>
Expand Down
1 change: 1 addition & 0 deletions src/api/McAPI.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once
#include "api/APIHelp.h"

#include <string>


Expand Down
1 change: 1 addition & 0 deletions src/api/MoreGlobal.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "MoreGlobal.h"

#include "ll/api/memory/Hook.h"
#include "mc/world/level/storage/DBStorage.h"
#include "mc/world/level/storage/DBStorageConfig.h"
Expand Down
1 change: 1 addition & 0 deletions src/api/NativeAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "demangler/MicrosoftDemangle.h"
#include "ll/api/memory/Hook.h"

#include <magic_enum.hpp>


Expand Down
1 change: 1 addition & 0 deletions src/api/NativeAPI.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
#include "api/APIHelp.h"
#include "demangler/MicrosoftDemangleNodes.h"

#include <concurrent_unordered_map.h>
#include <dyncall/dyncall.h>
#include <dyncall/dyncall_callback.h>
Expand Down
2 changes: 2 additions & 0 deletions src/api/NativeStdString.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "api/NativeStdString.h"

#include "api/NativeAPI.h"

#include <string>

//////////////////// Class Definition ////////////////////
Expand Down
Loading

0 comments on commit 4e6d044

Please sign in to comment.