diff --git a/fabric/src/main/java/com/discordsrv/fabric/console/FabricConsole.java b/fabric/src/main/java/com/discordsrv/fabric/console/FabricConsole.java index 61548c0c..9b8095f1 100644 --- a/fabric/src/main/java/com/discordsrv/fabric/console/FabricConsole.java +++ b/fabric/src/main/java/com/discordsrv/fabric/console/FabricConsole.java @@ -19,22 +19,22 @@ package com.discordsrv.fabric.console; import com.discordsrv.fabric.FabricDiscordSRV; -import com.discordsrv.fabric.console.executor.FabricCommandExecutorProvider; import com.discordsrv.fabric.command.game.sender.FabricCommandSender; import com.discordsrv.common.command.game.abstraction.executor.CommandExecutorProvider; import com.discordsrv.common.core.logging.backend.LoggingBackend; import com.discordsrv.common.core.logging.backend.impl.Log4JLoggerImpl; import com.discordsrv.common.feature.console.Console; +import com.discordsrv.fabric.console.executor.FabricCommandExecutor; public class FabricConsole extends FabricCommandSender implements Console { private final LoggingBackend loggingBackend; - private final FabricCommandExecutorProvider executorProvider; + private final CommandExecutorProvider executorProvider; public FabricConsole(FabricDiscordSRV discordSRV) { super(discordSRV, discordSRV.getServer().getCommandSource()); this.loggingBackend = Log4JLoggerImpl.getRoot(); - this.executorProvider = new FabricCommandExecutorProvider(discordSRV); + this.executorProvider = consumer -> new FabricCommandExecutor(discordSRV); } @Override diff --git a/fabric/src/main/java/com/discordsrv/fabric/console/executor/FabricCommandExecutor.java b/fabric/src/main/java/com/discordsrv/fabric/console/executor/FabricCommandExecutor.java index abe66336..0d986698 100644 --- a/fabric/src/main/java/com/discordsrv/fabric/console/executor/FabricCommandExecutor.java +++ b/fabric/src/main/java/com/discordsrv/fabric/console/executor/FabricCommandExecutor.java @@ -19,24 +19,17 @@ package com.discordsrv.fabric.console.executor; import com.discordsrv.fabric.FabricDiscordSRV; -import com.discordsrv.common.command.game.abstraction.executor.AdventureCommandExecutorProxy; import com.discordsrv.common.command.game.abstraction.executor.CommandExecutor; -import net.kyori.adventure.text.Component; import net.minecraft.server.command.ServerCommandSource; -import java.util.function.Consumer; - public class FabricCommandExecutor implements CommandExecutor { private final FabricDiscordSRV discordSRV; private final ServerCommandSource source; - public FabricCommandExecutor(FabricDiscordSRV discordSRV, Consumer componentConsumer) { + public FabricCommandExecutor(FabricDiscordSRV discordSRV) { this.discordSRV = discordSRV; - this.source = (ServerCommandSource) new AdventureCommandExecutorProxy( - discordSRV.getServer().getCommandSource(), - componentConsumer - ).getProxy(); + this.source = discordSRV.getServer().getCommandSource(); } @Override diff --git a/fabric/src/main/java/com/discordsrv/fabric/console/executor/FabricCommandExecutorProvider.java b/fabric/src/main/java/com/discordsrv/fabric/console/executor/FabricCommandExecutorProvider.java deleted file mode 100644 index 1c005011..00000000 --- a/fabric/src/main/java/com/discordsrv/fabric/console/executor/FabricCommandExecutorProvider.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * This file is part of DiscordSRV, licensed under the GPLv3 License - * Copyright (c) 2016-2025 Austin "Scarsz" Shapiro, Henri "Vankka" Schubin and DiscordSRV contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.discordsrv.fabric.console.executor; - -import com.discordsrv.fabric.FabricDiscordSRV; -import com.discordsrv.common.command.game.abstraction.executor.CommandExecutor; -import com.discordsrv.common.command.game.abstraction.executor.CommandExecutorProvider; -import net.kyori.adventure.text.Component; - -import java.util.function.Consumer; - -public class FabricCommandExecutorProvider implements CommandExecutorProvider { - - private final FabricDiscordSRV discordSRV; - - public FabricCommandExecutorProvider(FabricDiscordSRV discordSRV) { - this.discordSRV = discordSRV; - } - - @Override - public CommandExecutor getConsoleExecutor(Consumer componentConsumer) { - return new FabricCommandExecutor(discordSRV, componentConsumer); - } -}