Added an option to disable kami command feedback

This commit is contained in:
Bella 2020-05-07 13:46:20 -04:00
parent 016756391c
commit cea3c69f13
No known key found for this signature in database
GPG Key ID: DBD4A6030080C8B3
2 changed files with 15 additions and 4 deletions

View File

@ -10,6 +10,7 @@ import java.math.RoundingMode;
import java.util.Objects;
import static me.zeroeightsix.kami.util.MessageSendHelper.sendChatMessage;
import static me.zeroeightsix.kami.util.MessageSendHelper.sendErrorMessage;
/**
* Created by d1gress/Qther on 25/11/2017, updated on 16/12/2019
@ -42,7 +43,7 @@ public class EntityStatsCommand extends Command {
EntityLivingBase entity = (EntityLivingBase) mc.player.getRidingEntity();
sendChatMessage("&6Entity Stats:\n&cMax Health: &b" + entity.getMaxHealth() + " &2HP" + "\n&cSpeed: &b" + round(43.17 * entity.getAIMoveSpeed(), 2) + " &2m/s");
} else {
sendChatMessage("&4&lError: &cNot riding a compatible entity.");
sendErrorMessage("&4&lError: &cNot riding a compatible entity.");
}
}

View File

@ -2,6 +2,7 @@ package me.zeroeightsix.kami.util;
import me.zeroeightsix.kami.KamiMod;
import me.zeroeightsix.kami.command.Command;
import me.zeroeightsix.kami.module.modules.client.CommandConfig;
import net.minecraft.client.Minecraft;
import net.minecraft.launchwrapper.LogWrapper;
import net.minecraft.network.play.client.CPacketChatMessage;
@ -15,15 +16,24 @@ import static me.zeroeightsix.kami.KamiMod.MODULE_MANAGER;
public class MessageSendHelper {
public static void sendChatMessage(String message) {
sendRawChatMessage("&7[&9" + KamiMod.KAMI_KANJI + "&7] &r" + message);
CommandConfig commandConfig = MODULE_MANAGER.getModuleT(CommandConfig.class);
if (commandConfig.logLevel.getValue().equals(CommandConfig.LogLevel.ALL)) {
sendRawChatMessage("&7[&9" + KamiMod.KAMI_KANJI + "&7] &r" + message);
}
}
public static void sendWarningMessage(String message) {
sendRawChatMessage("&7[&6" + KamiMod.KAMI_KANJI + "&7] &r" + message);
CommandConfig commandConfig = MODULE_MANAGER.getModuleT(CommandConfig.class);
if (commandConfig.logLevel.getValue().equals(CommandConfig.LogLevel.ALL) || commandConfig.logLevel.getValue().equals(CommandConfig.LogLevel.WARN)) {
sendRawChatMessage("&7[&6" + KamiMod.KAMI_KANJI + "&7] &r" + message);
}
}
public static void sendErrorMessage(String message) {
sendRawChatMessage("&7[&4" + KamiMod.KAMI_KANJI + "&7] &r" + message);
CommandConfig commandConfig = MODULE_MANAGER.getModuleT(CommandConfig.class);
if (commandConfig.logLevel.getValue().equals(CommandConfig.LogLevel.ALL) || commandConfig.logLevel.getValue().equals(CommandConfig.LogLevel.WARN) || commandConfig.logLevel.getValue().equals(CommandConfig.LogLevel.ERROR)) {
sendRawChatMessage("&7[&4" + KamiMod.KAMI_KANJI + "&7] &r" + message);
}
}
public static void sendKamiCommand(String command, boolean addToHistory) {