Skip to content

Commit 0d8abdf

Browse files
committed
v7.1.1
new_thread at add_player_to_uuid_list
1 parent 6e2a6c0 commit 0d8abdf

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

mcdreforged.plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "stats_helper",
3-
"version": "7.1.0",
3+
"version": "7.1.1",
44
"name": "Stats Helper",
55
"description": {
66
"en_us": "A Minecraft statistic helper",

stats_helper/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def get_player_list(list_bot: bool) -> List[UUID_LIST_ITEM]:
100100

101101

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

290+
@new_thread(PLUGIN_ID + ' add player')
291+
def _add_player_to_uuid_list(source: CommandSource, player: str):
292+
add_player_to_uuid_list(source, player)
293+
289294
server.register_command(
290295
Literal(constants.Prefix).
291296
runs(show_help).
@@ -344,7 +349,7 @@ def _build_scoreboard(ctx: CommandContext, title: Optional[str], args: Arguments
344349
).
345350
then(Literal('add_player').then(
346351
Text('player').runs(
347-
lambda src, ctx: add_player_to_uuid_list(src, ctx['player'])
352+
lambda src, ctx: _add_player_to_uuid_list(src, ctx['player'])
348353
)
349354
))
350355
)

0 commit comments

Comments
 (0)