Skip to content

Commit

Permalink
fix: event.is_cancelled property should be writable
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Dec 24, 2024
1 parent 0719ae5 commit 4fb4c9a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion python/src/endstone/_internal/endstone_python.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1073,8 +1073,11 @@ class Event:
@property
def is_cancelled(self) -> bool:
"""
Gets whether the event is currently cancelled.
Gets or sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.
"""
@is_cancelled.setter
def is_cancelled(self, arg1: bool) -> None:
...
class EventPriority:
"""
Listeners are called in following order: LOWEST -> LOW -> NORMAL -> HIGH -> HIGHEST -> MONITOR
Expand Down
4 changes: 3 additions & 1 deletion src/endstone_python/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ void init_event(py::module_ &m, py::class_<Event> &event, py::enum_<EventPriorit
},
"Gets or sets the cancellation state of this event. A cancelled event will not be executed in "
"the server, but will still pass to other plugins. [Warning] Deprecated: Use is_cancelled instead.")
.def_property_readonly("is_cancelled", &Event::isCancelled, "Gets whether the event is currently cancelled.")
.def_property("is_cancelled", &Event::isCancelled, &Event::setCancelled,
"Gets or sets the cancellation state of this event. A cancelled event will not be executed in "
"the server, but will still pass to other plugins.")
.def_property_readonly("is_asynchronous", &Event::isAsynchronous, "Whether the event fires asynchronously.");

event_priority
Expand Down

0 comments on commit 4fb4c9a

Please sign in to comment.