Pass CommandContext to commands

CommandContext is the carrier of dependencies.
Currently, it only carries a DropProvider, but
it will grow bit by bit as more static singletons
and other similar structures get refactored.
This commit is contained in:
P0nk
2023-03-15 23:18:39 +01:00
parent eed94ec34a
commit fa3481fa99
176 changed files with 357 additions and 183 deletions

View File

@@ -26,6 +26,7 @@ package client.command.commands.gm3;
import client.Character;
import client.Client;
import client.command.Command;
import client.command.CommandContext;
import net.server.Server;
import server.TimerManager;
import tools.DatabaseConnection;
@@ -41,7 +42,7 @@ public class BanCommand extends Command {
}
@Override
public void execute(Client c, String[] params) {
public void execute(Client c, String[] params, CommandContext ctx) {
Character player = c.getPlayer();
if (params.length < 2) {
player.yellowMessage("Syntax: !ban <IGN> <Reason> (Please be descriptive)");