From 0f8614beb629d03031ff1b50ca2c72235804cd62 Mon Sep 17 00:00:00 2001 From: RedbeanW Date: Sat, 26 Feb 2022 11:38:25 +0800 Subject: [PATCH] fix bugs, try to release 2.82 --- TODO.md | 7 ++----- iland-core.lua | 42 ++++++++++++++++++++++++++++++++++++++---- iland/lang/en_US.json | 28 ++++++++++++++++------------ iland/lang/zh_CN.json | 9 ++++++--- iland/lang/zh_TW.json | 14 +++++++++----- 5 files changed, 71 insertions(+), 29 deletions(-) diff --git a/TODO.md b/TODO.md index 1e69ead..f2882cc 100644 --- a/TODO.md +++ b/TODO.md @@ -1,10 +1,7 @@ > **2.82** - - [ ] 在含水方块放水 - [x] 管理员领地管理器搜索后打开的领地错误 - - [ ] 冲突领地检测没有提示冲突坐标,领地名称未显示 - - [ ] LandInfo 领地名称未显示 - - [ ] Event:Before - onCreate 回传无mRange - - [ ] schedule随机性失效? + - [x] 冲突领地检测没有提示冲突坐标,领地名称未显示 + - [x] Event:Before - onCreate 回传无mRange > ILAPI 示例插件计划 - [ ] Land Edge Shower diff --git a/iland-core.lua b/iland-core.lua index e3e9632..736d234 100644 --- a/iland-core.lua +++ b/iland-core.lua @@ -16,7 +16,7 @@ Plugin = { Version = { major = 2, minor = 8, - revision = 1, + revision = 2, toString = function() local ver = Plugin.Version return tostring(ver.major)..'.'..tostring(ver.minor*10 + ver.revision) @@ -1463,10 +1463,30 @@ Land = { IsCollision = function(AABB,ignoreList) ignoreList = ignoreList or {} local ignores = Array.ToKeyMap(ignoreList) + + --- Check 1/2. + local edge = Cube.GetEdge(AABB) + for n,pos in pairs(edge) do + Pos.SetDimId(pos,AABB.dimid) + local Id = Land.Query.Pos(pos) + if Id and not ignores[Id] then + return { + status = false, + id = Id, + info = _Tr('gui.rangecheck.pos','',Pos.ToString(pos)) + } + end + end + + --- Check 2/2. local lands = Land.Query.Area(AABB) for i,landId in pairs(lands) do if not ignores[landId] then - return { status = false, id = landId } + return { + status = false, + id = landId, + info = _Tr('gui.rangecheck.included') + } end end return { status = true } @@ -2981,12 +3001,22 @@ RangeSelector = { local sp = cfg.land.min_space local chkNearby = Land.Util.IsCollision(Cube.Create(Pos.Add(mem.posA,sp),Pos.Reduce(mem.posB,sp),dimid),chkIgnores) if not chkNearby.status then - SendText(player,_Tr('title.rangeselector.fail.space','',chkNearby.id)) + player:sendModalForm( + _Tr('gui.rangecheck.title'), + _Tr('gui.rangecheck.msg','',Land.Options.Nickname.get(chkNearby.id,3),'',chkNearby.info), + _Tr('gui.general.iknow'),_Tr('gui.general.close'), + Callback.Form.NULL + ) else passed = true end else - SendText(player,_Tr('title.rangeselector.fail.collision','',chkColl.id)) + player:sendModalForm( + _Tr('gui.rangecheck.title'), + _Tr('gui.rangecheck.msg','',Land.Options.Nickname.get(chkColl.id,3),'',chkColl.info), + _Tr('gui.general.iknow'),_Tr('gui.general.close'), + Callback.Form.NULL + ) end end @@ -3280,6 +3310,10 @@ Pos = { if A.y>B.y then A.y,B.y = B.y,A.y end if A.z>B.z then A.z,B.z = B.z,A.z end return A,B + end, + SetDimId = function(pos,dimid) + pos.dimid = dimid + return pos end } diff --git a/iland/lang/en_US.json b/iland/lang/en_US.json index 7d5102e..a69cc2d 100644 --- a/iland/lang/en_US.json +++ b/iland/lang/en_US.json @@ -1,5 +1,5 @@ { - "VERSION": 281, + "VERSION": 282, "gui.land.title": "Land v", "gui.oplandmgr.trsland.title": "Forced transfer of land", @@ -173,7 +173,7 @@ "gui.buyland.button.confirm": "Confirm Purchase", "gui.buyland.button.close": "Staging", "gui.buyland.button.cancel": "Cancel order", - "gui.delland.content": "Are you sure you want to delete your realm?\nIf so, you will receive a refund. Your realm will then lose its protection and the data will be deleted immediately. ", + "gui.delland.content": "Are you sure you want to delete your realm?\\nIf so, you will receive a refund. Your realm will then lose its protection and the data will be deleted immediately. ", "gui.landdescribe.tip": "Land notes are sent to other visitors when they come to your land.\n\nSupported variables:\n$visitor = visitor name\n$n = newline", "gui.landtrust.tip": "Select operation mode", "gui.landtrust.addtrust": "Add trusted player", @@ -184,9 +184,9 @@ "gui.landtrust.rmsuccess": "Removed from trust list", "gui.landtrust.trusted": "§lCurrently trusted:§r ", "gui.landtag.tip": "Land Nickname helps you to distinguish between multiple lands without changing the original lands configuration", - "gui.landtransfer.tip": "After the land transfer is completed, all permissions will be transferred, you are no longer the owner of the land, but all the configuration of the original land will not be changed.", + "gui.landtransfer.tip": "After the land transfer is completed, all permissions will be transferred, you are no longer the owner of the land, but all configurations of the original land will not be changed.", "gui.reselectland.title": "Reselect Land Range", - "gui.reselectland.tip": "Re-enclosure is to completely reselect the range of the land, not directly expanding/reducing the range of the existing land.\\nThe price of reselectland is calculated as\\\"New range price — old range Value \\\", continue?","gui.reselectland.content": "Original territory range () value: ,\\nCurrent territory range () value: ,\\nwill you.", + "gui.reselectland.tip": "Re-enclosure is to completely reselect the scope of the territory, not directly expanding/reducing the scope of the existing territory.\\nThe price calculation method of reselectland is\\\"New scope price — old scope Value \\\", continue?","gui.reselectland.content": "Original territory range () value: ,\\nCurrent territory range () value: ,\\nwill you.", "gui.reselectland.refund": "Refund to", "gui.reselectland.pay": "Charge", @@ -251,14 +251,17 @@ "title.rangeselector.fail.toobig": "The enclosed territory is too big, please re-enclose it.\n", "title.rangeselector.fail.toosmall": "The enclosed territory is too small, please re-enclosure.\n", "title.rangeselector.fail.toolow": "The enclosed territory is too low, please re-enclosure\n", - "title.rangeselector.fail.collision": "The enclosure range conflicts with , please re-enclave.\n", - "title.rangeselector.fail.space": "The enclosure range is too close to , please re-enclosure.\n", "title.rangeselector.fail.height": "Not a valid height, please re-enclosure", "title.rangeselector.largeparticle": "The territory is large, particle effects have been turned off to avoid lag", "title.rangeselector.pointed": "Point selected: (, , )", "title.selectland.complete1": "Enclosure completed", "title.selectland.complete2": "Please hold \nUse / or click any square again to create an order.", + "gui.rangecheck.included": "included", + "gui.rangecheck.pos": "Conflict at ", + "gui.rangecheck.title": "There was a problem", + "gui.rangecheck.msg": "The selected range conflicts with or is too close to §l§r.\n\nDetails: ", + "title.land.nolicense": "Please use /land new request to create a new territory first", "title.getlicense.alreadyexists": "Do not repeat the request\n", "title.getlicense.succeed": "Requested to create a new territory\n", @@ -286,8 +289,8 @@ "title.landsign.visitorbuttom": "This is 's territory", "title.landtp.fail.noland": "You need to stand on the ground first", "title.landtp.fail.notowner": "You are not the owner of this land", - "title.landtp.removed": "Removed teleportation point for this land", - "title.landtp.success":"Successful delivery", + "title.landtp.removed": "Removed teleportation point for this territory", + "title.landtp.success": "Successful transfer", "sign.listener.ownertitle": "", "sign.listener.ownersubtitle": "Welcome back", @@ -355,7 +358,7 @@ "console.loading.land.broken": "The land data file is broken.", "console.loading.relationship.notfound": "The relationship data (relationship.json) does not exist, creating...", "console.loading.relationship.xuidinvalid": "Invalid XUID (), skip loading...", - "console.loading.relationship.xuidinvalidtip": "Some players were not loaded because their XUIDs were not in the database. Reloading these players could fix this.", + "console.loading.relationship.xuidinvalidtip": "Some players were not loaded because their XUIDs were not in the database. Reloading these players could fix the problem.", "console.loading.relationship.broken": "The territory relationship data file is broken.", "console.loading.map.load": "Building the tables needed to run...", "console.loading.map.complete": "Complete, using memory: M.", @@ -398,7 +401,8 @@ "console.getonline.failbyver": "Unparseable version of cloud info file (), your iLand may be out of date.", "console.getonline.failbybroken": "Unable to parse cloud information, JSON parsing failed.", - "console.languages.sign": "This server is using language , version: .","console.languages.list.count": "Installed languages: ", + "console.languages.sign": "This server is using language , version: . ", + "console.languages.list.count": "Installed languages: ", "console.languages.list-online.wait": "Please wait, getting language warehouse data...", "console.languages.official": "Official languages:", "console.languages.3rd": "Languages ​​provided by third parties:", @@ -409,9 +413,9 @@ "console.languages.install.fail.verify": "Error verifying language , MD5 mismatch, installation process interrupted.", "console.languages.install.fail.version": "The language being installed does not match the version of iLand currently running and the installation process has been interrupted.", "console.languages.install.fail.broken": "The language pack being installed is broken and the installation process was interrupted.", - "console.languages.install.succeed": "Language pack installed successfully! Please use \"land language set \" to set the language to use.", + "console.languages.install.succeed": "Language pack installed successfully! Please use \"land language set \" to set the language used.", "console.languages.update.alreadylatest": "This language version is up to date and does not require an upgrade.", - "console.languages.update.notfound": "Language pack not found, try installing this language with \"land language install \".", + "console.languages.update.notfound": "Language pack not found, please try installing this language with \"land language install \".", "console.languages.update.notfoundonline": "Language was not found on the server, maybe it is not yet included, the update is aborted.", "console.languages.update.succeed": "Language pack updated successfully!", "console.languages.update.completed": "Updated language packs.", diff --git a/iland/lang/zh_CN.json b/iland/lang/zh_CN.json index e535199..94ab663 100644 --- a/iland/lang/zh_CN.json +++ b/iland/lang/zh_CN.json @@ -1,5 +1,5 @@ { - "VERSION": 281, + "VERSION": 282, "#1": "zh_CN 标准汉语翻译贡献者:RedbeanW", "gui.land.title": "Land v", @@ -253,14 +253,17 @@ "title.rangeselector.fail.toobig": "所圈领地太大,请重新圈地。\n", "title.rangeselector.fail.toosmall": "所圈领地太小,请重新圈地。\n", "title.rangeselector.fail.toolow": "所圈领地太低,请重新圈地\n", - "title.rangeselector.fail.collision": "圈地范围与 存在冲突,请重新圈地。\n", - "title.rangeselector.fail.space": "圈地范围与 距离太近,请重新圈地。\n", "title.rangeselector.fail.height": "不是有效的高度,请重新圈地", "title.rangeselector.largeparticle": "领地范围较大,为避免卡顿已关闭粒子特效", "title.rangeselector.pointed": "点 已选定: (, , )", "title.selectland.complete1": "圈地完成", "title.selectland.complete2": "请手持 \n使用 / 或再次点击任意方块以创建订单。", + "gui.rangecheck.included": "包含", + "gui.rangecheck.pos": "在 冲突", + "gui.rangecheck.title": "出现问题", + "gui.rangecheck.msg": "所选范围与 §l§r 存在冲突或距离太近。\n\n详细信息: ", + "title.land.nolicense": "请先使用 /land new 请求创建新领地", "title.getlicense.alreadyexists": "请勿重复请求\n", "title.getlicense.succeed": "已请求新建领地\n", diff --git a/iland/lang/zh_TW.json b/iland/lang/zh_TW.json index bb4e650..f5d69be 100644 --- a/iland/lang/zh_TW.json +++ b/iland/lang/zh_TW.json @@ -1,5 +1,5 @@ { - "VERSION": 281, + "VERSION": 282, "gui.land.title": "Land v", "gui.oplandmgr.trsland.title": "強製過戶領地", @@ -251,14 +251,17 @@ "title.rangeselector.fail.toobig": "所圈領地太大,請重新圈地。\n", "title.rangeselector.fail.toosmall": "所圈領地太小,請重新圈地。\n", "title.rangeselector.fail.toolow": "所圈領地太低,請重新圈地\n", - "title.rangeselector.fail.collision": "圈地範圍與 存在衝突,請重新圈地。\n", - "title.rangeselector.fail.space": "圈地範圍與 距離太近,請重新圈地。\n", "title.rangeselector.fail.height": "不是有效的高度,請重新圈地", "title.rangeselector.largeparticle": "領地範圍較大,為避免卡頓已關閉粒子特效", "title.rangeselector.pointed": "點 已選定: (, , )", "title.selectland.complete1": "圈地完成", "title.selectland.complete2": "請手持 \n使用 / 或再次點擊任意方塊以創建訂單。", + "gui.rangecheck.included": "包含", + "gui.rangecheck.pos": "在 衝突", + "gui.rangecheck.title": "出現問題", + "gui.rangecheck.msg": "所選範圍與 §l§r 存在衝突或距離太近。\n\n詳細信息: ", + "title.land.nolicense": "請先使用 /land new 請求創建新領地", "title.getlicense.alreadyexists": "請勿重複請求\n", "title.getlicense.succeed": "已請求新建領地\n", @@ -287,7 +290,7 @@ "title.landtp.fail.noland": "你需要先站在領地上一點", "title.landtp.fail.notowner": "你不是這塊領地的主人", "title.landtp.removed": "已移除這塊領地的傳送點", - "title.landtp.success":"傳送成功", + "title.landtp.success": "傳送成功", "sign.listener.ownertitle": "", "sign.listener.ownersubtitle": "歡迎回來", @@ -398,7 +401,8 @@ "console.getonline.failbyver": "無法解析的雲端信息文件版本(),您的iLand可能已過時。", "console.getonline.failbybroken": "無法解析雲端信息,JSON解析失敗。", - "console.languages.sign": "此服務器正在使用 語言,版本為:。","console.languages.list.count": "已安裝語言: 個", + "console.languages.sign": "此服務器正在使用 語言,版本為:。 ", + "console.languages.list.count": "已安裝語言: 個", "console.languages.list-online.wait": "請稍等,正在獲取語言倉庫數據...", "console.languages.official": "官方提供的語言:", "console.languages.3rd": "第三方提供的語言:",