diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test/command')
6 files changed, 26 insertions, 22 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt index 6a583b1e3..d038d7759 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyItemCommand.kt @@ -1,9 +1,9 @@ package at.hannibal2.skyhanni.test.command +import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.ItemUtils.getLore -import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.OSUtils import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getMinecraftId import net.minecraft.item.ItemStack @@ -14,7 +14,7 @@ object CopyItemCommand { fun command() { val itemStack = InventoryUtils.getItemInHand() if (itemStack == null) { - LorenzUtils.userError("No item in hand!") + ChatUtils.userError("No item in hand!") return } copyItemToClipboard(itemStack) @@ -53,6 +53,6 @@ object CopyItemCommand { val string = resultList.joinToString("\n") OSUtils.copyToClipboard(string) - LorenzUtils.chat("Item info copied into the clipboard!") + ChatUtils.chat("Item info copied into the clipboard!") } } diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyEntitiesCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyEntitiesCommand.kt index dae69775a..5ba4447f2 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyEntitiesCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyEntitiesCommand.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.test.command +import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.EntityUtils import at.hannibal2.skyhanni.utils.EntityUtils.getBlockInHand import at.hannibal2.skyhanni.utils.EntityUtils.getSkinTexture @@ -8,7 +9,6 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getSkullTexture import at.hannibal2.skyhanni.utils.ItemUtils.isEnchanted import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LocationUtils -import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.baseMaxHealth import at.hannibal2.skyhanni.utils.OSUtils import at.hannibal2.skyhanni.utils.toLorenzVec @@ -45,7 +45,7 @@ object CopyNearbyEntitiesCommand { resultList.add("name: '" + entity.name + "'") resultList.add("displayName: '${displayName.formattedText}'") resultList.add("entityId: ${entity.entityId}") - resultList.add("uuid version: ${entity.uniqueID.version()} ${if(entity.uniqueID.version() != 4) "NPC " else ""}(${entity.uniqueID})") + resultList.add("uuid version: ${entity.uniqueID.version()} ${if (entity.uniqueID.version() != 4) "NPC " else ""}(${entity.uniqueID})") resultList.add("location data:") resultList.add("- vec: $vec") resultList.add("- distance: $distance") @@ -147,9 +147,9 @@ object CopyNearbyEntitiesCommand { if (counter != 0) { val string = resultList.joinToString("\n") OSUtils.copyToClipboard(string) - LorenzUtils.chat("$counter entities copied into the clipboard!") + ChatUtils.chat("$counter entities copied into the clipboard!") } else { - LorenzUtils.chat("No entities found in a search radius of $searchRadius!") + ChatUtils.chat("No entities found in a search radius of $searchRadius!") } } diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyParticlesCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyParticlesCommand.kt index 67b28f0aa..c76d7318f 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyParticlesCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyParticlesCommand.kt @@ -1,8 +1,8 @@ package at.hannibal2.skyhanni.test.command import at.hannibal2.skyhanni.events.PacketEvent +import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.LocationUtils -import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.round import at.hannibal2.skyhanni.utils.LorenzVec import at.hannibal2.skyhanni.utils.OSUtils @@ -13,6 +13,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent // Note: Each particle is copied anywhere between 1-3 times. Different each time. Shouldn't affect using this for debugging or developing object CopyNearbyParticlesCommand { + private var searchRadius = 0 private var saveNextTick = false private var searchTime: Long = 0 @@ -41,10 +42,10 @@ object CopyNearbyParticlesCommand { if (resultList.isEmpty() && tickTime == 0L) tickTime = System.currentTimeMillis() if (System.currentTimeMillis() > tickTime + 30) { - if (counter == 0) LorenzUtils.chat("No particles found nearby, try a larger search radius") else { + if (counter == 0) ChatUtils.chat("No particles found nearby, try a larger search radius") else { val string = resultList.joinToString("\n") OSUtils.copyToClipboard(string) - LorenzUtils.chat("$counter particles copied into the clipboard!") + ChatUtils.chat("$counter particles copied into the clipboard!") } saveNextTick = false return diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/CopyScoreboardCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/CopyScoreboardCommand.kt index b940d1948..e0750c5a1 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/CopyScoreboardCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyScoreboardCommand.kt @@ -1,12 +1,13 @@ package at.hannibal2.skyhanni.test.command import at.hannibal2.skyhanni.data.ScoreboardData -import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.LorenzUtils.transformIf +import at.hannibal2.skyhanni.utils.ChatUtils +import at.hannibal2.skyhanni.utils.ConditionalUtils.transformIf import at.hannibal2.skyhanni.utils.OSUtils import at.hannibal2.skyhanni.utils.StringUtils.removeColor object CopyScoreboardCommand { + fun command(args: Array<String>) { val resultList = mutableListOf<String>() val noColor = args.size == 1 && args[0] == "true" @@ -21,6 +22,6 @@ object CopyScoreboardCommand { val string = resultList.joinToString("\n") OSUtils.copyToClipboard(string) - LorenzUtils.chat("Scoreboard copied into your clipboard!") + ChatUtils.chat("Scoreboard copied into your clipboard!") } } diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt b/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt index 092800c10..ca9449419 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt @@ -1,8 +1,8 @@ package at.hannibal2.skyhanni.test.command import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.KeyboardManager -import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.OSUtils import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.TimeLimitedSet @@ -11,6 +11,7 @@ import java.util.UUID import kotlin.time.Duration.Companion.minutes object ErrorManager { + // random id -> error message private val errorMessages = mutableMapOf<String, String>() private val fullErrorMessages = mutableMapOf<String, String>() @@ -28,7 +29,7 @@ object ErrorManager { fun command(array: Array<String>) { if (array.size != 1) { - LorenzUtils.userError("Use /shcopyerror <error id>") + ChatUtils.userError("Use /shcopyerror <error id>") return } @@ -40,7 +41,7 @@ object ErrorManager { errorMessages[id] } val name = if (fullErrorMessage) "Full error" else "Error" - LorenzUtils.chat(errorMessage?.let { + ChatUtils.chat(errorMessage?.let { OSUtils.copyToClipboard(it) "$name copied into the clipboard, please report it on the SkyHanni discord!" } ?: "Error id not found!") @@ -68,7 +69,7 @@ object ErrorManager { throwable: Throwable, message: String, ignoreErrorCache: Boolean, - vararg extraData: Pair<String, Any?> + vararg extraData: Pair<String, Any?>, ) { val error = Error(message, throwable) error.printStackTrace() @@ -93,7 +94,7 @@ object ErrorManager { fullErrorMessages[randomId] = "```\nSkyHanni ${SkyHanniMod.version}: $rawMessage\n(full stack trace)\n \n$fullStackTrace\n$extraDataString```" - LorenzUtils.clickableChat( + ChatUtils.clickableChat( "§c[SkyHanni-${SkyHanniMod.version}]: $message§c. Click here to copy the error into the clipboard.", "shcopyerror $randomId", false diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt index a60b0f0d2..0f14c94fd 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt @@ -1,23 +1,24 @@ package at.hannibal2.skyhanni.test.command -import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.ChatUtils import net.minecraft.util.ChatComponentText import net.minecraftforge.client.event.ClientChatReceivedEvent import net.minecraftforge.common.MinecraftForge object TestChatCommand { + fun command(args: Array<String>) { if (args.isEmpty()) { - LorenzUtils.userError("Specify a chat message to test!") + ChatUtils.userError("Specify a chat message to test!") return } val hidden = args.last() == "-s" var rawMessage = args.toList().joinToString(" ") - if (!hidden) LorenzUtils.chat("Testing message: §7$rawMessage", prefixColor = "§a") + if (!hidden) ChatUtils.chat("Testing message: §7$rawMessage", prefixColor = "§a") if (hidden) rawMessage = rawMessage.replace(" -s", "") val formattedMessage = rawMessage.replace("&", "§") - LorenzUtils.chat(formattedMessage, false) + ChatUtils.chat(formattedMessage, false) MinecraftForge.EVENT_BUS.post(ClientChatReceivedEvent(0, ChatComponentText(formattedMessage))) } } |
