Skip to content

Commit

Permalink
feat: ensure plugin distribution names always start with the "endston…
Browse files Browse the repository at this point in the history
…e_" namespace
  • Loading branch information
wu-vincent committed Mar 13, 2024
1 parent 5dc4916 commit d4faa50
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/src/endstone/_internal/plugin_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ def load_plugins(self, directory) -> List[Plugin]:
if not isinstance(plugin, Plugin):
raise TypeError("Main class {ep.value} does not extend endstone.plugin.Plugin")

plugin_metadata = metadata(ep.name.replace("-", "_")).json
ep_name = ep.name.replace("-", "_")
dist_name = "endstone_" + ep_name
plugin_metadata = metadata(dist_name).json
plugin._description = PluginDescription(
name=plugin_metadata["name"].replace("_", " ").replace("-", " ").title().replace(" ", ""),
name=ep_name.replace("_", " ").title().replace(" ", ""),
version=plugin_metadata["version"],
description=plugin_metadata.get("summary"),
authors=[plugin_metadata.get("author_email")],
)
# TODO: pass plugin_metadata.get("project_url") to PluginDescription

self._plugins.append(plugin)
loaded_plugins.append(plugin)
Expand Down

0 comments on commit d4faa50

Please sign in to comment.