summaryrefslogtreecommitdiffstats
path: root/src/Plugin.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2023-07-08 21:41:27 +0200
committerGitHub <noreply@github.com>2023-07-08 21:41:27 +0200
commita68f48ad526d0843eb451af0be7f119db5ff794e (patch)
tree3c539c9e7de841c6616f532dadb7c8c1ef552d95 /src/Plugin.cpp
parentMerge pull request #80 from LaG1924/ftr/better-water (diff)
parentFixed some errors detected by static analysis (diff)
downloadAltCraft-master.tar
AltCraft-master.tar.gz
AltCraft-master.tar.bz2
AltCraft-master.tar.lz
AltCraft-master.tar.xz
AltCraft-master.tar.zst
AltCraft-master.zip
Diffstat (limited to 'src/Plugin.cpp')
-rw-r--r--src/Plugin.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/Plugin.cpp b/src/Plugin.cpp
index 7a3b716..22afb90 100644
--- a/src/Plugin.cpp
+++ b/src/Plugin.cpp
@@ -54,15 +54,15 @@ namespace PluginApi {
LOG(INFO) << "Loaded plugin " << (!nativePlugin.displayName.empty() ? nativePlugin.displayName : nativePlugin.name);
}
- void LogWarning(std::string text) {
+ void LogWarning(const std::string& text) {
LOG(WARNING) << text;
}
- void LogInfo(std::string text) {
+ void LogInfo(const std::string& text) {
LOG(INFO) << text;
}
- void LogError(std::string text) {
+ void LogError(const std::string& text) {
LOG(ERROR) << text;
}
@@ -70,7 +70,7 @@ namespace PluginApi {
return ::GetGameState();
}
- void RegisterBlock(BlockId blockId, bool collides, std::string blockstate, std::string variant) {
+ void RegisterBlock(BlockId blockId, bool collides, const std::string& blockstate, const std::string& variant) {
RegisterStaticBlockInfo(blockId, BlockInfo{
collides,
blockstate,
@@ -78,18 +78,18 @@ namespace PluginApi {
});
}
- void RegisterLiquid(BlockId blockId, std::string flowTexture, std::string stillTexture) {
+ void RegisterLiquid(BlockId blockId, const std::string& flowTexture, const std::string& stillTexture) {
RegisterStaticLiquidInfo(blockId, LiquidInfo{
flowTexture,
stillTexture
});
}
- void RegisterDimension(int dimId, Dimension dim) {
+ void RegisterDimension(int dimId, const Dimension& dim) {
RegisterNewDimension(dimId, dim);
}
- void ConnectToServer(std::string host, std::string username) {
+ void ConnectToServer(const std::string& host, const std::string& username) {
size_t index = host.find_last_of(':');
unsigned short port;
if (index == std::string::npos)
@@ -231,8 +231,8 @@ void PluginSystem::Init() {
"GetEntitiesList", &World::GetEntitiesList,
"GetEntity",&World::GetEntityPtr,
"Raycast", &World::Raycast,
- "GetBlockLight", sol::resolve<unsigned char(Vector)const>(&World::GetBlockLight),
- "GetBlockSkyLight", sol::resolve<unsigned char(Vector)const>(&World::GetBlockSkyLight),
+ "GetBlockLight", sol::resolve<unsigned char(const Vector&)const>(&World::GetBlockLight),
+ "GetBlockSkyLight", sol::resolve<unsigned char(const Vector&)const>(&World::GetBlockSkyLight),
"GetBlockId", &World::GetBlockId,
"SetBlockId", &World::SetBlockId);