Skip to content

Commit

Permalink
v1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxkad committed Oct 23, 2022
1 parent da529df commit 229773d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions delayexe/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .utils import *

__all__ = [
'ServerNotStartError',
'ServerNotRunningError',
'add_playerlist_handler', 'add_delay_task', 'clear_delay_task', 'get_playerlist_data'
]

Expand All @@ -22,7 +22,7 @@
'forge_handler': (re.compile(r'There are (\d+)/(\d+) players online.*'), 1, 2)
}

class ServerNotStartError(RuntimeError):
class ServerNotRunningError(RuntimeError):
def __init__(self):
super().__init__('Server is not start')

Expand Down Expand Up @@ -54,7 +54,7 @@ def _trigger_delay_list(server: MCDR.ServerInterface):
def get_playerlist_data(server: MCDR.ServerInterface):
with playerlist_data:
if not server.is_server_startup():
raise ServerNotStartError()
raise ServerNotRunningError()
if playerlist_data.d[1]:
playerlist_data.d[1] = False
server.execute('list')
Expand Down Expand Up @@ -91,4 +91,4 @@ def on_player_left(server: MCDR.PluginServerInterface, player: str):
with player_empty:
player_empty.d = True
_trigger_delay_list(server)
server.dispatch_event(ON_PLAYER_EMPTY, [])
server.dispatch_event(ON_LAST_PLAYER_LEAVE, [])
4 changes: 2 additions & 2 deletions delayexe/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import mcdreforged.api.all as MCDR

__all__ = [
'ON_PLAYER_EMPTY', 'ON_FIRST_PLAYER_JOIN'
'ON_LAST_PLAYER_LEAVE', 'ON_FIRST_PLAYER_JOIN'
]

ON_PLAYER_EMPTY = MCDR.LiteralEvent('delayexe.player.empty')
ON_LAST_PLAYER_LEAVE = MCDR.LiteralEvent('delayexe.player.leave.last')
ON_FIRST_PLAYER_JOIN = MCDR.LiteralEvent('delayexe.player.join.first')
2 changes: 1 addition & 1 deletion mcdreforged.plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "delayexe",
"version": "1.2.1",
"version": "1.2.2",
"name": "Delay Exe",
"description": {
"en_us": "Delay execute command until all player have left",
Expand Down

0 comments on commit 229773d

Please sign in to comment.