-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
buj
committed
May 24, 2024
1 parent
6774b66
commit 2fd1fe1
Showing
5 changed files
with
48 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package darkdustry.commands; | ||
|
||
import arc.struct.Seq; | ||
import arc.util.CommandHandler; | ||
import mindustry.Vars; | ||
|
||
public class ModCommandHandler extends CommandHandler { | ||
private final CommandHandler proxied; | ||
|
||
public static void load() { | ||
Vars.netServer.clientCommands = new ModCommandHandler(Vars.netServer.clientCommands); | ||
} | ||
|
||
public ModCommandHandler(CommandHandler proxied) { | ||
super(proxied.prefix); | ||
this.proxied = proxied; | ||
} | ||
|
||
@Override | ||
public CommandResponse handleMessage(String message, Object params) { | ||
if (message.contains(" ")) { | ||
message = message.substring(0, message.indexOf(" ")).toLowerCase() + message.substring(message.indexOf(" ")); | ||
} | ||
else { | ||
message = message.toLowerCase(); | ||
} | ||
return proxied.handleMessage(message, params); | ||
} | ||
|
||
@Override | ||
public <T> Command register(String text, String params, String description, CommandRunner<T> runner) { | ||
return proxied.register(text, params, description, runner); | ||
} | ||
|
||
@Override | ||
public Seq<Command> getCommandList() { | ||
return proxied.getCommandList(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters