Skip to content

Commit 4c3225b

Browse files
committed
Add @OverRide decorator to Plugin method overrides
1 parent de1c303 commit 4c3225b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
55
[project]
66
name = "endstone-example"
77
dynamic = ["version"]
8-
dependencies = [] # Add third-party PyPI packages here, e.g. ["requests>=2.31"]
8+
dependencies = ["typing_extensions>=4.0"]
99
authors = [
1010
{ name = "Endstone Developers", email = "hello@endstone.dev" },
1111
]

src/endstone_example/plugin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from endstone import Player
44
from endstone.command import Command, CommandSender, ConsoleCommandSender
55
from endstone.plugin import Plugin
6+
from typing_extensions import override
67

78
from endstone_example.listener import ExampleListener
89

@@ -43,6 +44,7 @@ class ExamplePlugin(Plugin):
4344
},
4445
}
4546

47+
@override
4648
def on_enable(self) -> None:
4749
"""Called when the plugin is enabled. Use this for setup."""
4850

@@ -56,10 +58,12 @@ def on_enable(self) -> None:
5658

5759
self.logger.info("ExamplePlugin enabled!")
5860

61+
@override
5962
def on_disable(self) -> None:
6063
"""Called when the plugin is disabled. Use this for cleanup."""
6164
self.logger.info("ExamplePlugin disabled!")
6265

66+
@override
6367
def on_command(self, sender: CommandSender, command: Command, args: list[str]) -> bool:
6468
"""Called when a player or the console runs one of this plugin's commands.
6569

0 commit comments

Comments
 (0)