rework stuff
This commit is contained in:
parent
e66327e3fb
commit
7cb1ed6f75
4 changed files with 11 additions and 2 deletions
|
@ -14,6 +14,7 @@ public class EaaMod implements ModInitializer {
|
|||
private final List<HandlerInterface> handler;
|
||||
|
||||
public EaaMod(){
|
||||
instance = this;
|
||||
handler = new ArrayList<>();
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,8 @@ public class CommandHandler implements HandlerInterface {
|
|||
LOGGER.debug("Valid Prefix received");
|
||||
|
||||
for (Command command : commands){
|
||||
if (command.run(commandSource, args)) { // Try execute command
|
||||
if (command.acceptInput()) { // Try execute command
|
||||
command.run(commandSource, args);
|
||||
LOGGER.debug("Executed following command: " + message);
|
||||
return command.intercept(); // if executed return interception flag
|
||||
}
|
||||
|
|
|
@ -2,10 +2,18 @@ package net.saltymc.eaa.handler.commands;
|
|||
|
||||
import net.fabricmc.fabric.api.client.command.v1.FabricClientCommandSource;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public interface Command {
|
||||
|
||||
boolean run(final FabricClientCommandSource cs, String[] args);
|
||||
|
||||
String getCommand();
|
||||
|
||||
Set<String> getAlias();
|
||||
|
||||
boolean acceptInput();
|
||||
|
||||
/**
|
||||
* should message get intercepted and not send to Server?
|
||||
*/
|
||||
|
|
|
@ -2,7 +2,6 @@ package net.saltymc.eaa.mixin;
|
|||
|
||||
import net.minecraft.client.network.ClientPlayerEntity;
|
||||
import net.saltymc.eaa.EaaMod;
|
||||
import net.saltymc.eaa.handler.CommandHandler;
|
||||
import net.saltymc.eaa.util.ResponseEntity;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
|
Loading…
Reference in a new issue