mcpyproject / McPy

A open source Minecraft server written 100% in Python
GNU Affero General Public License v3.0
82 stars 16 forks source link

[Feedback] Thinking of a command implementation #23

Open 0ddlyoko opened 4 years ago

0ddlyoko commented 4 years ago

Information This issue is not an issue, it's more about informations / questions for the Command Implementation in McPy

Before Implementing Commands I think we should handle commands when we have the general architecture of McPy. By general architecture, I want to say having network in his correct package, worlds in another package, some Unit Tests etc.

How it could be implemented

This is not an official implementation, just an example of how it could be implemented

Geolykt commented 4 years ago

I think that is an invalid label

0ddlyoko commented 4 years ago

I think that is an invalid label

Yeah, idk why this label has been automatically added, I can't remove it

tazz4843 commented 4 years ago

Fixed labels

I'll look into the issue there later

Geolykt commented 3 years ago

I think it's the best to do this without decorator and instead be similar to how Minestom handles commands (which is pretty similar to what you are going for but requires a bit more input from the developer).

So pseudocode for registering a command executor would look something like

Commands.register_executor(cmd, CommandArgs.string("target"), executePlayer)

this would also mean that commands may not need to be registered (just the executors), but it depends on the implementation really