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

Commit

Permalink
Fix Door and Trapdoor issue and added support for flower pot protecti…
Browse files Browse the repository at this point in the history
…on (#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
  • Loading branch information
HongyiMC authored Sep 16, 2022
1 parent 87c5155 commit 4ae8b00
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
19 changes: 12 additions & 7 deletions iland-core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ Map = {
'minecraft:dark_oak_fence_gate','minecraft:crimson_fence_gate','minecraft:warped_fence_gate',
'minecraft:wooden_door','minecraft:spruce_door','minecraft:birch_door','minecraft:jungle_door',
'minecraft:acacia_door','minecraft:dark_oak_door','minecraft:crimson_door','minecraft:warped_door',
'minecraft:dragon_egg'
'minecraft:dragon_egg','minecraft:flower_pot'
}),
-- # onBlockInteracted
[1] = Array.ToKeyMap({
Expand Down Expand Up @@ -1035,7 +1035,8 @@ DataStorage = {
eat = false,
allow_throw_potion = false,
allow_ride_entity = false,
allow_ride_trans = false
allow_ride_trans = false,
edit_flower_pot = false
}
},
Create = function()
Expand Down Expand Up @@ -1799,9 +1800,10 @@ Land = {
assert(Land.IDManager.IsVaild(landId),Land.API.Helper.ErrMsg[2])
return Land.RelationShip.Owner.check(landId,xuid)
end,
['IsLandOperator'] = function(xuid)
assert(Land.API.Helper.CheckNilArgument(xuid),Land.API.Helper.ErrMsg[1])
return Land.RelationShip.Operator.check(xuid)
['IsLandOperator'] = function(landId,xuid)
assert(Land.API.Helper.CheckNilArgument(landId,xuid),Land.API.Helper.ErrMsg[1])
assert(Land.IDManager.IsVaild(landId,landId),Land.API.Helper.ErrMsg[2])
return Land.RelationShip.Operator.check(landId,xuid)
end,
['GetAllTrustedLand'] = function(xuid)
assert(Land.API.Helper.CheckNilArgument(xuid),Land.API.Helper.ErrMsg[1])
Expand Down Expand Up @@ -2429,6 +2431,7 @@ OpenGUI = {
Form:addSwitch(_Tr('gui.landmgr.landperm.other_options.respawn_anchor'),perm.use_respawn_anchor)
Form:addSwitch(_Tr('gui.landmgr.landperm.other_options.fishing'),perm.use_fishing_hook)
Form:addSwitch(_Tr('gui.landmgr.landperm.other_options.bucket'),perm.use_bucket)
Form:addSwitch(_Tr('gui.landmgr.landperm.other_options.flower_pot'),perm.edit_flower_pot)
Form:addLabel(_Tr('gui.landmgr.landperm.editevent'))
player:sendForm(
Form,
Expand Down Expand Up @@ -2498,6 +2501,7 @@ OpenGUI = {
perm.use_respawn_anchor = get()
perm.use_fishing_hook = get()
perm.use_bucket = get()
perm.edit_flower_pot = get()

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

INFO('Powerful land plugin is loaded! Ver-'..Plugin.Version.toString()..',')
INFO('By: RedbeanW, License: GPLv3 with additional conditions.')
INFO('By: RedbeanW, License: GPLv3 with additional conditions.')
3 changes: 2 additions & 1 deletion iland/lang/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
"gui.landmgr.landperm.other_options.respawn_anchor": "Allows the use of respawn anchors",
"gui.landmgr.landperm.other_options.fishing": "Allow fishing rods",
"gui.landmgr.landperm.other_options.bucket": "Allow buckets",
"gui.landmgr.landperm.other_options.flower_pot": "Allow editing flower pot",
"gui.landmgr.landperm.editevent": "To control events that can occur in (nearby) land, please go to the land settings tab.",

"gui.fastlmgr.title": "Main Land Menu",
Expand Down Expand Up @@ -429,4 +430,4 @@
"console.error.money.protocol": "Unknown economy component '<a>' is being used.",
"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."

}
}
3 changes: 2 additions & 1 deletion iland/lang/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
"gui.landmgr.landperm.other_options.respawn_anchor": "允许使用重生锚",
"gui.landmgr.landperm.other_options.fishing": "允许使用钓竿",
"gui.landmgr.landperm.other_options.bucket": "允许使用桶",
"gui.landmgr.landperm.other_options.flower_pot": "允许操作花盆",
"gui.landmgr.landperm.editevent": "控制领地内(附近)可发生的事件, 请移步领地设定选项卡。",

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

}
}
3 changes: 2 additions & 1 deletion iland/lang/zh_TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
"gui.landmgr.landperm.other_options.respawn_anchor": "允許使用重生錨",
"gui.landmgr.landperm.other_options.fishing": "允許使用釣竿",
"gui.landmgr.landperm.other_options.bucket": "允許使用桶",
"gui.landmgr.landperm.other_options.flower_pot": "允許操作花盆",
"gui.landmgr.landperm.editevent": "控制領地內(附近)可發生的事件, 請移步領地設定選項卡。",

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

}
}

0 comments on commit 4ae8b00

Please sign in to comment.