Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsubasa6848 committed Mar 27, 2024
2 parents 02be891 + 9500d4f commit d5d1881
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion SDK-GMLIB
Submodule SDK-GMLIB updated 56 files
+1 −1 GMLIB/Event/Entity/ActorChangeDImensionEvent.h
+1 −1 GMLIB/Event/Entity/DeathMessageEvent.h
+1 −1 GMLIB/Event/Entity/DragonRespawnEvent.h
+1 −1 GMLIB/Event/Entity/ItemActorEvent.h
+1 −1 GMLIB/Event/Entity/ItemActorSpawnEvent.h
+1 −1 GMLIB/Event/Entity/MobHurtEvent.h
+1 −1 GMLIB/Event/Entity/MobPickupItemEvent.h
+1 −1 GMLIB/Event/Entity/ProjectileCreateEvent.h
+1 −1 GMLIB/Event/Level/ExplodeEvent.h
+1 −1 GMLIB/Event/Level/WeatherUpdateEvent.h
+1 −1 GMLIB/Event/Packet/ClientLoginEvent.h
+1 −1 GMLIB/Event/Packet/TextPacketEvent.h
+1 −1 GMLIB/Event/Player/PlayerChangeDimensionEvent.h
+1 −1 GMLIB/Event/Player/PlayerSleepEvent.h
+18 −0 GMLIB/Event/Registries/CreativeItemsInitEvent.h
+1 −1 GMLIB/Event/Registries/JsonItemInitEvent.h
+1 −1 GMLIB/Event/Registries/ResourcePackInitEvent.h
+1 −1 GMLIB/Files/Config/JsonConfig.h
+1 −1 GMLIB/Files/FileUtils.h
+1 −1 GMLIB/Files/JsonFile.h
+1 −1 GMLIB/Files/Language/I18n/JsonI18n.h
+1 −1 GMLIB/Files/Language/JsonLanguage.h
+1 −1 GMLIB/Files/Language/LangLanguage.h
+1 −1 GMLIB/Files/Language/McLang.h
+2 −1 GMLIB/Files/Language/ResourceLanguage.h
+40 −18 GMLIB/GMLIB.h
+7 −0 GMLIB/Macros.h
+1 −1 GMLIB/Mod/Addons/CustomDamageCause.h
+1 −1 GMLIB/Mod/Addons/CustomPacks.h
+1 −1 GMLIB/Mod/Addons/VanillaFix.h
+1 −1 GMLIB/Mod/CustomGenerator/CustomBiome.h
+1 −1 GMLIB/Mod/CustomItem/CustomItem.h
+1 −1 GMLIB/Mod/CustomItem/JsonItem.h
+1 −1 GMLIB/Mod/CustomRecipe/CustomRecipe.h
+1 −1 GMLIB/Mod/CustomRecipe/JsonRecipe.h
+2 −1 GMLIB/Mod/CustomRecipe/Recipe/CustomFurnaceRecipe.h
+2 −1 GMLIB/Mod/CustomRecipe/Recipe/CustomShapedRecipe.h
+4 −3 GMLIB/Mod/CustomRecipe/Recipe/CustomShapelessRecipe.h
+4 −4 GMLIB/Mod/CustomRecipe/Recipe/CustomShulkerBoxRecipe.h
+1 −1 GMLIB/Server/ActorAPI.h
+1 −1 GMLIB/Server/BinaryStreamAPI.h
+13 −3 GMLIB/Server/CompoundTagAPI.h
+1 −1 GMLIB/Server/FakeListAPI.h
+1 −1 GMLIB/Server/FloatingTextAPI.h
+1 −1 GMLIB/Server/FormAPI/NpcDialogueForm.h
+1 −1 GMLIB/Server/FormAPI/ServerSettingForm.h
+43 −8 GMLIB/Server/ItemStackAPI.h
+1 −1 GMLIB/Server/LevelAPI.h
+1 −1 GMLIB/Server/PlaceholderAPI.h
+3 −6 GMLIB/Server/PlayerAPI.h
+1 −1 GMLIB/Server/ScoreboardAPI.h
+1 −1 GMLIB/Server/SpawnerAPI.h
+1 −1 GMLIB/Server/UserCache.h
+2 −0 GMLIB/include_lib.h
+211 −71 GMLIB/include_mc.h
+ Lib/GMLIB.lib
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "native",
"author": "GroupMountain",
"description": "Free Camera",
"version": "0.9.0",
"version": "0.10.0",
"dependencies": [
{
"name": "GMLIB"
Expand Down
8 changes: 8 additions & 0 deletions src/Entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ std::unique_ptr<Entry>& Entry::getInstance() {

bool Entry::load() {
initLanguage();
if (Version::getProtocolVersion() != TARGET_PROTOCOL) {
logger.error(tr("error.protocolMismatch.info"));
logger.error(
tr("error.protocolMismatch.version",
{std::to_string(TARGET_PROTOCOL), std::to_string(Version::getProtocolVersion())})
);
return false;
}
return true;
}

Expand Down
4 changes: 3 additions & 1 deletion src/Global.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#pragma once
#include <include_all.h>

#define PLUGIN_NAME "FreeCamera"
#define TARGET_PROTOCOL 662

using namespace GMLIB;

Expand All @@ -9,7 +11,7 @@ extern std::unordered_set<uint64> FreeCamList;
extern void RegisterCommand();
extern void initLanguage();

extern std::string tr(std::string key);
extern std::string tr(std::string key, std::vector<std::string> data = {});

namespace FreeCamera {
extern void DisableFreeCamera(Player* pl);
Expand Down
2 changes: 1 addition & 1 deletion src/Initialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ void initLanguage() {
Language->chooseLanguage(languageCode);
}

std::string tr(std::string key) { return Language->translate(key); }
std::string tr(std::string key, std::vector<std::string> data) { return Language->translate(key, data); }
8 changes: 6 additions & 2 deletions src/Language.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ std::string defaultLanguage_en_US = R"({
"freecamera.command.desc": "Enable or disable freecamera mode.",
"freecamera.command.enabled": "Freecamera mode enabled",
"freecamera.command.disabled": "Freecamera mode disabled",
"freecamera.command.console": "This command can only execute by players or console."
"freecamera.command.console": "This command can only execute by players or console.",
"error.protocolMismatch.info":"You are running on an unsupport protocol version! This may result in crash!",
"error.protocolMismatch.version":"Support protocol %1$s, current protocol %2$s."
})";

std::string defaultLanguage_zh_CN = R"({
"freecamera.command.desc": "开启或关闭自由视角模式",
"freecamera.command.enabled": "自由视角模式已启用",
"freecamera.command.disabled": "自由视角模式已禁用",
"freecamera.command.console": "该命令只能由玩家执行"
"freecamera.command.console": "该命令只能由玩家执行",
"error.protocolMismatch.info":"此插件正在不兼容的版本协议上运行!这可能造成服务器崩溃。",
"error.protocolMismatch.version":"此插件支持版本协议 %1$s,服务器版本协议 %2$s。"
})";
6 changes: 3 additions & 3 deletions tooth.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"format_version": 2,
"tooth": "github.com/GroupMountain/FreeCamera",
"version": "0.9.0",
"version": "0.10.0",
"info": {
"name": "FreeCamera",
"description": "Free Camera Plugin on Bedrock Dedicated Server",
Expand All @@ -11,9 +11,9 @@
"FreeCamera"
]
},
"asset_url": "https://github.com/GroupMountain/FreeCamera/releases/download/v0.9.0/FreeCamera-windows-x64.zip",
"asset_url": "https://github.com/GroupMountain/FreeCamera/releases/download/v0.10.0/FreeCamera-windows-x64.zip",
"dependencies": {
"github.com/GroupMountain/GMLIB": ">=0.9.8"
"github.com/GroupMountain/GMLIB": ">=0.10.0"
},
"files": {
"place": [
Expand Down

0 comments on commit d5d1881

Please sign in to comment.