Skip to content
This repository was archived by the owner on Jun 9, 2023. It is now read-only.

Commit 4ae8b00

Browse files
authored
Fix Door and Trapdoor issue and added support for flower pot protection (#41)
* Fix Door and Trapdoor * Add flower pot option * Update flower pot zh_CN * Update flower pot en_US * Update flower pot zh_TW * Fix IsLandOperator API
1 parent 87c5155 commit 4ae8b00

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

iland-core.lua

+12-7
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ Map = {
357357
'minecraft:dark_oak_fence_gate','minecraft:crimson_fence_gate','minecraft:warped_fence_gate',
358358
'minecraft:wooden_door','minecraft:spruce_door','minecraft:birch_door','minecraft:jungle_door',
359359
'minecraft:acacia_door','minecraft:dark_oak_door','minecraft:crimson_door','minecraft:warped_door',
360-
'minecraft:dragon_egg'
360+
'minecraft:dragon_egg','minecraft:flower_pot'
361361
}),
362362
-- # onBlockInteracted
363363
[1] = Array.ToKeyMap({
@@ -1035,7 +1035,8 @@ DataStorage = {
10351035
eat = false,
10361036
allow_throw_potion = false,
10371037
allow_ride_entity = false,
1038-
allow_ride_trans = false
1038+
allow_ride_trans = false,
1039+
edit_flower_pot = false
10391040
}
10401041
},
10411042
Create = function()
@@ -1799,9 +1800,10 @@ Land = {
17991800
assert(Land.IDManager.IsVaild(landId),Land.API.Helper.ErrMsg[2])
18001801
return Land.RelationShip.Owner.check(landId,xuid)
18011802
end,
1802-
['IsLandOperator'] = function(xuid)
1803-
assert(Land.API.Helper.CheckNilArgument(xuid),Land.API.Helper.ErrMsg[1])
1804-
return Land.RelationShip.Operator.check(xuid)
1803+
['IsLandOperator'] = function(landId,xuid)
1804+
assert(Land.API.Helper.CheckNilArgument(landId,xuid),Land.API.Helper.ErrMsg[1])
1805+
assert(Land.IDManager.IsVaild(landId,landId),Land.API.Helper.ErrMsg[2])
1806+
return Land.RelationShip.Operator.check(landId,xuid)
18051807
end,
18061808
['GetAllTrustedLand'] = function(xuid)
18071809
assert(Land.API.Helper.CheckNilArgument(xuid),Land.API.Helper.ErrMsg[1])
@@ -2429,6 +2431,7 @@ OpenGUI = {
24292431
Form:addSwitch(_Tr('gui.landmgr.landperm.other_options.respawn_anchor'),perm.use_respawn_anchor)
24302432
Form:addSwitch(_Tr('gui.landmgr.landperm.other_options.fishing'),perm.use_fishing_hook)
24312433
Form:addSwitch(_Tr('gui.landmgr.landperm.other_options.bucket'),perm.use_bucket)
2434+
Form:addSwitch(_Tr('gui.landmgr.landperm.other_options.flower_pot'),perm.edit_flower_pot)
24322435
Form:addLabel(_Tr('gui.landmgr.landperm.editevent'))
24332436
player:sendForm(
24342437
Form,
@@ -2498,6 +2501,7 @@ OpenGUI = {
24982501
perm.use_respawn_anchor = get()
24992502
perm.use_fishing_hook = get()
25002503
perm.use_bucket = get()
2504+
perm.edit_flower_pot = get()
25012505

25022506
DataStorage.Save({0,1,0})
25032507
player:sendModalForm(
@@ -4653,9 +4657,10 @@ mc.listen('onUseItemOn',function(player,item,block)
46534657
if bn == 'minecraft:cauldron' and perm.use_cauldron then return end -- 炼药锅
46544658
if bn == 'minecraft:lever' and perm.use_lever then return end -- 拉杆
46554659
if bn == 'minecraft:respawn_anchor' and perm.use_respawn_anchor then return end -- 重生锚(充能)
4656-
if string.sub(bn,-4,-1) == 'door' and perm.use_door then return end -- 各种门
4660+
if string.sub(bn,-5,-1) == '_door' and perm.use_door then return end -- 各种门
46574661
if string.sub(bn,-10,-1) == 'fence_gate' and perm.use_fence_gate then return end -- 各种栏栅门
46584662
if string.sub(bn,-8,-1) == 'trapdoor' and perm.use_trapdoor then return end -- 各种活板门
4663+
if bn == 'minecraft:flower_pot' and perm.edit_flower_pot then return end -- 花盆
46594664
end
46604665
SendText(player,_Tr('title.landlimit.noperm'))
46614666
return false
@@ -5170,4 +5175,4 @@ Land.API.RunExport()
51705175
-- Signs.
51715176

51725177
INFO('Powerful land plugin is loaded! Ver-'..Plugin.Version.toString()..',')
5173-
INFO('By: RedbeanW, License: GPLv3 with additional conditions.')
5178+
INFO('By: RedbeanW, License: GPLv3 with additional conditions.')

iland/lang/en_US.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
"gui.landmgr.landperm.other_options.respawn_anchor": "Allows the use of respawn anchors",
9898
"gui.landmgr.landperm.other_options.fishing": "Allow fishing rods",
9999
"gui.landmgr.landperm.other_options.bucket": "Allow buckets",
100+
"gui.landmgr.landperm.other_options.flower_pot": "Allow editing flower pot",
100101
"gui.landmgr.landperm.editevent": "To control events that can occur in (nearby) land, please go to the land settings tab.",
101102

102103
"gui.fastlmgr.title": "Main Land Menu",
@@ -429,4 +430,4 @@
429430
"console.error.money.protocol": "Unknown economy component '<a>' is being used.",
430431
"console.error.money.scorenull": "The scoreboard object cannot be accessed, possibly the corresponding economic scoreboard does not exist. Please use /land mgr to change to the correct scoreboard or try restarting the server."
431432

432-
}
433+
}

iland/lang/zh_CN.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
"gui.landmgr.landperm.other_options.respawn_anchor": "允许使用重生锚",
9898
"gui.landmgr.landperm.other_options.fishing": "允许使用钓竿",
9999
"gui.landmgr.landperm.other_options.bucket": "允许使用桶",
100+
"gui.landmgr.landperm.other_options.flower_pot": "允许操作花盆",
100101
"gui.landmgr.landperm.editevent": "控制领地内(附近)可发生的事件, 请移步领地设定选项卡。",
101102

102103
"gui.fastlmgr.title": "Fast LMgr",
@@ -429,4 +430,4 @@
429430
"console.error.money.protocol": "正在使用未知的经济组件 '<a>'。",
430431
"console.error.money.scorenull": "无法访问计分板对象,可能对应的经济计分板不存在。请使用/land mgr更改为正确计分板或尝试重启服务器。"
431432

432-
}
433+
}

iland/lang/zh_TW.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
"gui.landmgr.landperm.other_options.respawn_anchor": "允許使用重生錨",
9898
"gui.landmgr.landperm.other_options.fishing": "允許使用釣竿",
9999
"gui.landmgr.landperm.other_options.bucket": "允許使用桶",
100+
"gui.landmgr.landperm.other_options.flower_pot": "允許操作花盆",
100101
"gui.landmgr.landperm.editevent": "控制領地內(附近)可發生的事件, 請移步領地設定選項卡。",
101102

102103
"gui.fastlmgr.title": "Fast LMgr",
@@ -429,4 +430,4 @@
429430
"console.error.money.protocol": "正在使用未知的經濟組件 '<a>'。",
430431
"console.error.money.scorenull": "無法訪問計分闆對象,可能對應的經濟計分板不存在。請使用/land mgr更改為正確計分板或嘗試重啟服務器。"
431432

432-
}
433+
}

0 commit comments

Comments
 (0)