Skip to content

Commit

Permalink
feat !!l command
Browse files Browse the repository at this point in the history
  • Loading branch information
a3510377 committed Feb 28, 2024
1 parent c8c288a commit 3960fe6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions location_marker/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,27 @@
class Config(Serializable):
teleport_hint_on_coordinate: bool = True
item_per_page: int = 10
# 顯示 VoxelMap 的路標
display_voxel_waypoint: bool = True
# 顯示 Xaero's Minimap 的路標
display_xaero_waypoint: bool = True
# for survival server
for_smp: bool = False

# 使用 !!loc 的權限
cmd_use_permission: int = 0
# 使用 !!loc list 的權限
cmd_list_permission: int = 1
# 使用 !!loc search <keyword> 的權限
# (!!loc <keyword>)
cmd_search_permission: int = 1
# 使用!!loc add <路標名> <x> <y> <z> <緯度ID> 的權限
# (!!loc add <路標名>)
# (!!loc add <路標名> here)
cmd_add_permission: int = 1
# 使用!!loc del <路標名> 的權限
cmd_del_permission: int = 2
# 使用!!loc info <路標名> 的權限
cmd_info_permission: int = 1


Expand Down Expand Up @@ -307,6 +318,13 @@ def on_load(server: PluginServerInterface, old_inst):
)
)

server.register_command(
Literal("!!l")
.requires(lambda src: src.has_permission(config.cmd_list_permission), get_permission_denied_text)
.runs(lambda src: list_locations(src))
.then(Integer("page").runs(lambda src, ctx: list_locations(src, page=ctx["page"])))
)

server.register_command(
Literal(constants.PREFIX)
.requires(lambda src: src.has_permission(config.cmd_list_permission), get_permission_denied_text)
Expand Down

0 comments on commit 3960fe6

Please sign in to comment.