diff --git a/src/main/java/net/emc/emce/utils/Messaging.java b/src/main/java/net/emc/emce/utils/Messaging.java index d703ea2..76ec7fb 100644 --- a/src/main/java/net/emc/emce/utils/Messaging.java +++ b/src/main/java/net/emc/emce/utils/Messaging.java @@ -4,11 +4,9 @@ import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.NamedTextColor; import net.minecraft.client.MinecraftClient; -import org.jetbrains.annotations.NotNull; import java.util.Collections; import java.util.List; -import java.util.function.Function; import static net.emc.emce.EarthMCEssentials.instance; import static net.kyori.adventure.platform.fabric.FabricClientAudiences.of; @@ -18,17 +16,17 @@ public class Messaging { //#region Helper Methods - public static Component create(String key, NamedTextColor keyColour, Object @NotNull ... args) { + public static Component create(String key, NamedTextColor keyColour, Object... args) { List argList = Collections.emptyList(); for (Object obj : args) argList.add(Component.text(obj.toString())); return translatable().key(key).color(keyColour).args(argList).build(); } + //#endregion private static Component prefix() { return translatable("mod_prefix"); } - //#endregion //#region Regular Msg public static void send(String text) { @@ -60,10 +58,9 @@ public static void sendPrefixedActionBar(Component text) { } //#endregion - //#region Command - static Function sendCmd = getInstance().player.networkHandler::sendCommand; + //#region Send Command public static void performCommand(String cmd) { - sendCmd.apply(cmd); + getInstance().player.networkHandler.sendCommand(cmd); } //endregion