diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test')
6 files changed, 16 insertions, 56 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/ParkourWaypointSaver.kt b/src/main/java/at/hannibal2/skyhanni/test/ParkourWaypointSaver.kt index f21d4cac0..59df2bf37 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/ParkourWaypointSaver.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/ParkourWaypointSaver.kt @@ -42,9 +42,7 @@ class ParkourWaypointSaver { } if (config.saveKey == key) { val newLocation = LorenzVec.getBlockBelowPlayer() - if (locations.isNotEmpty()) { - if (newLocation == locations.last()) return - } + if (locations.isNotEmpty() && newLocation == locations.last()) return locations.add(newLocation) update() } diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt index c1aa5a313..f80b96f8f 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt @@ -220,12 +220,8 @@ object SkyHanniConfigSearchResetCommand { val fieldName = "$parentName.$name" val newObj = field.makeAccessible().get(obj) map[fieldName] = newObj - if (newObj != null) { - if (newObj !is Boolean && newObj !is String && newObj !is Long && newObj !is Int && newObj !is Double) { - if (newObj !is Position && !newObj.javaClass.isEnum) { - map.putAll(loadAllFields(fieldName, newObj, depth + 1)) - } - } + if (newObj != null && newObj !is Boolean && newObj !is String && newObj !is Long && newObj !is Int && newObj !is Double && newObj !is Position && !newObj.javaClass.isEnum) { + map.putAll(loadAllFields(fieldName, newObj, depth + 1)) } } diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt index 66b29a3d7..a50d684de 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt @@ -182,11 +182,9 @@ class SkyHanniDebugsAndTests { val x = LorenzUtils.formatDouble(location.x + 0.001).replace(",", ".") val y = LorenzUtils.formatDouble(location.y + 0.001).replace(",", ".") val z = LorenzUtils.formatDouble(location.z + 0.001).replace(",", ".") - if (args.size == 1) { - if (args[0].equals("json", false)) { - OSUtils.copyToClipboard("\"$x:$y:$z\"") - return - } + if (args.size == 1 && args[0].equals("json", false)) { + OSUtils.copyToClipboard("\"$x:$y:$z\"") + return } OSUtils.copyToClipboard("LorenzVec($x, $y, $z)") @@ -197,12 +195,10 @@ class SkyHanniDebugsAndTests { } fun debugData(args: Array<String>) { - if (args.size == 2) { - if (args[0] == "profileName") { - HypixelData.profileName = args[1].lowercase() - LorenzUtils.chat("§eManually set profileName to '${HypixelData.profileName}'") - return - } + if (args.size == 2 && args[0] == "profileName") { + HypixelData.profileName = args[1].lowercase() + LorenzUtils.chat("§eManually set profileName to '${HypixelData.profileName}'") + return } val builder = StringBuilder() builder.append("```\n") diff --git a/src/main/java/at/hannibal2/skyhanni/test/TestCopyBestiaryValues.kt b/src/main/java/at/hannibal2/skyhanni/test/TestCopyBestiaryValues.kt index fdb4a58c3..993778afc 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/TestCopyBestiaryValues.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/TestCopyBestiaryValues.kt @@ -48,21 +48,17 @@ object TestCopyBestiaryValues { val backItem = event.inventoryItems[3 + 9 * 5 + 3] if (backItem == null) { -// println("first is null!") return } if (backItem.getLore().none { it.contains("Bestiary Milestone") }) { -// println("wrong first: ${backItem.getLore()}") return } val rankingItem = event.inventoryItems[3 + 9 * 5 + 2] if (rankingItem == null) { -// println("second is null!") return } if (rankingItem.getLore().none { it.contains("Ranking") }) { -// println("wrong second: ${rankingItem.getLore()}") return } diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/CopyErrorCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/CopyErrorCommand.kt index 5852c9922..cc909469e 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/CopyErrorCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyErrorCommand.kt @@ -86,11 +86,9 @@ private fun Throwable.getExactStackTrace(full: Boolean, parent: List<String> = e for (traceElement in stackTrace) { var text = "\tat $traceElement" - if (!full) { - if (text in parent) { - println("broke at: $text") - break - } + if (!full && text in parent) { + println("broke at: $text") + break } if (!full) { for ((from, to) in replace) { @@ -98,11 +96,9 @@ private fun Throwable.getExactStackTrace(full: Boolean, parent: List<String> = e } } add(text) - if (!full) { - if (breakAfter.any { text.contains(it) }) { - println("breakAfter: $text") - break - } + if (!full && breakAfter.any { text.contains(it) }) { + println("breakAfter: $text") + break } } 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 51c5a28fb..b7c4ae4a1 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyEntitiesCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyEntitiesCommand.kt @@ -135,28 +135,6 @@ object CopyNearbyEntitiesCommand { val skinTexture = entity.getSkinTexture() resultList.add("- skin texture: $skinTexture") - -// val gameProfile = entity.gameProfile -// if (gameProfile == null) { -// resultList.add("- gameProfile is null!") -// } else { -// val id = gameProfile.id -// val name = gameProfile.name -// -// resultList.add("- gameProfile id: $id") -// resultList.add("- gameProfile name: $name") -// val properties = gameProfile.properties -// resultList.add("- gameProfile properties: (${properties.size()})") -// for (entry in properties.entries()) { -// val key = entry.key -// val property = entry.value -// resultList.add("- key: '$key'") -// val name1 = property.name -// val value = property.value -// resultList.add("- property name: '$name1'") -// resultList.add("- property value: '$value'") -// } -// } } } resultList.add("") |
