Skip to content

Commit

Permalink
v7.1.1
Browse files Browse the repository at this point in the history
new_thread at add_player_to_uuid_list
  • Loading branch information
Fallen-Breath committed Aug 15, 2021
1 parent 6e2a6c0 commit 0d8abdf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mcdreforged.plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "stats_helper",
"version": "7.1.0",
"version": "7.1.1",
"name": "Stats Helper",
"description": {
"en_us": "A Minecraft statistic helper",
Expand Down
7 changes: 6 additions & 1 deletion stats_helper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def get_player_list(list_bot: bool) -> List[UUID_LIST_ITEM]:


def trigger_save_all(server: ServerInterface):
assert not server.is_on_executor_thread()
global flag_save_all
flag_save_all = False
server.execute('save-all')
Expand Down Expand Up @@ -286,6 +287,10 @@ def _build_scoreboard(ctx: CommandContext, title: Optional[str], args: Arguments
else:
build_scoreboard(ctx.source, ref[0], ref[1], title, list_bot=args.is_bot)

@new_thread(PLUGIN_ID + ' add player')
def _add_player_to_uuid_list(source: CommandSource, player: str):
add_player_to_uuid_list(source, player)

server.register_command(
Literal(constants.Prefix).
runs(show_help).
Expand Down Expand Up @@ -344,7 +349,7 @@ def _build_scoreboard(ctx: CommandContext, title: Optional[str], args: Arguments
).
then(Literal('add_player').then(
Text('player').runs(
lambda src, ctx: add_player_to_uuid_list(src, ctx['player'])
lambda src, ctx: _add_player_to_uuid_list(src, ctx['player'])
)
))
)
Expand Down

0 comments on commit 0d8abdf

Please sign in to comment.