11-01-2015, 07:45 PM
Wouldn't overloading commands be confusing?
But anyways, you can also create a register method, where you can register the command for specific types only.
The main goal of this attempt is to avoid code deduplication. Look at the /list command in the Core plugin.
It is defined in https://github.com/mc-server/Core/blob/m...le.lua#L86 and in https://github.com/mc-server/Core/blob/m...ist.lua#L1.
The result is: Nearly 100% copied code(except the command output) and in order to fix a command, you have to copy the code and slightly modify it.
Also the a_CommandOutput is too static in my eyes. Think of a command, which informs you, when a player mines a diamond block. You want to send single messages and not the whole message block at once.
P.S.: What about of giving permissions to command blocks? This would give the Server owners more control about the command blocks. Think of a command block, which can execute a /save-all on a specific action.
But anyways, you can also create a register method, where you can register the command for specific types only.
The main goal of this attempt is to avoid code deduplication. Look at the /list command in the Core plugin.
It is defined in https://github.com/mc-server/Core/blob/m...le.lua#L86 and in https://github.com/mc-server/Core/blob/m...ist.lua#L1.
The result is: Nearly 100% copied code(except the command output) and in order to fix a command, you have to copy the code and slightly modify it.
Also the a_CommandOutput is too static in my eyes. Think of a command, which informs you, when a player mines a diamond block. You want to send single messages and not the whole message block at once.
P.S.: What about of giving permissions to command blocks? This would give the Server owners more control about the command blocks. Think of a command block, which can execute a /save-all on a specific action.