summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/test
diff options
context:
space:
mode:
authorThunderblade73 <85900443+Thunderblade73@users.noreply.github.com>2024-04-08 20:27:38 +0200
committerGitHub <noreply@github.com>2024-04-08 20:27:38 +0200
commit4aaf4295152d211b1c8853a173cc4cf6a9d000a2 (patch)
tree9ebd0a44cad5329bdd2452e99395e7cc7ba16f41 /src/main/java/at/hannibal2/skyhanni/test
parent451a9b5636c113d1da15fc6419ea99f306f66e55 (diff)
downloadskyhanni-4aaf4295152d211b1c8853a173cc4cf6a9d000a2.tar.gz
skyhanni-4aaf4295152d211b1c8853a173cc4cf6a9d000a2.tar.bz2
skyhanni-4aaf4295152d211b1c8853a173cc4cf6a9d000a2.zip
Fix/Backend: Renderable.itemStack itemScale (#1390)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt
index a4b36db3b..4ece06c55 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt
@@ -17,6 +17,7 @@ import at.hannibal2.skyhanni.features.garden.GardenNextJacobContest
import at.hannibal2.skyhanni.features.garden.visitor.GardenVisitorColorNames
import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled
import at.hannibal2.skyhanni.utils.ChatUtils
+import at.hannibal2.skyhanni.utils.CollectionUtils.editCopy
import at.hannibal2.skyhanni.utils.InventoryUtils
import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName
import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull
@@ -30,6 +31,7 @@ import at.hannibal2.skyhanni.utils.LorenzColor
import at.hannibal2.skyhanni.utils.LorenzDebug
import at.hannibal2.skyhanni.utils.LorenzLogger
import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.LorenzUtils.round
import at.hannibal2.skyhanni.utils.LorenzVec
import at.hannibal2.skyhanni.utils.NEUInternalName
import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName
@@ -41,12 +43,18 @@ import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
import at.hannibal2.skyhanni.utils.OSUtils
import at.hannibal2.skyhanni.utils.ReflectionUtils.makeAccessible
import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText
+import at.hannibal2.skyhanni.utils.RenderUtils.renderRenderables
import at.hannibal2.skyhanni.utils.RenderUtils.renderString
import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems
import at.hannibal2.skyhanni.utils.SimpleTimeMark
import at.hannibal2.skyhanni.utils.SoundUtils
+import at.hannibal2.skyhanni.utils.renderables.Renderable
+import at.hannibal2.skyhanni.utils.renderables.Renderable.Companion.renderBounds
import kotlinx.coroutines.launch
import net.minecraft.client.Minecraft
+import net.minecraft.init.Blocks
+import net.minecraft.init.Items
+import net.minecraft.item.ItemStack
import net.minecraft.nbt.NBTTagCompound
import net.minecraftforge.common.MinecraftForge
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -482,6 +490,11 @@ class SkyHanniDebugsAndTests {
fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) {
if (!LorenzUtils.inSkyBlock) return
+ @Suppress("ConstantConditionIf")
+ if (false) {
+ itemRenderDebug()
+ }
+
if (Minecraft.getMinecraft().gameSettings.showDebugInfo && debugConfig.currentAreaDebug) {
config.debugLocationPos.renderString(
"Current Area: ${HypixelData.skyBlockArea}",
@@ -497,6 +510,34 @@ class SkyHanniDebugsAndTests {
config.debugPos.renderStringsAndItems(displayList, posLabel = "Test Display")
}
+ private fun itemRenderDebug() {
+ val scale = 0.1
+ val renderables = listOf(
+ ItemStack(Blocks.glass_pane), ItemStack(Items.diamond_sword), ItemStack(Items.skull),
+ ItemStack(Blocks.melon_block)
+ ).map { item ->
+ generateSequence(scale) { it + 0.1 }.take(25).map {
+ Renderable.itemStack(item, it, xSpacing = 0).renderBounds()
+ }.toList()
+ }.editCopy {
+ this.add(
+ 0,
+ generateSequence(scale) { it + 0.1 }.take(25).map { Renderable.string(it.round(1).toString()) }.toList()
+ )
+ }
+ config.debugItemPos.renderRenderables(
+ listOf(
+ Renderable.table(renderables),
+ Renderable.horizontalContainer(
+ listOf(
+ Renderable.string("Test:").renderBounds(),
+ Renderable.itemStack(ItemStack(Items.diamond_sword)).renderBounds()
+ ), spacing = 1
+ )
+ ), posLabel = "Item Debug"
+ )
+ }
+
@SubscribeEvent
fun onReceiveParticle(event: ReceiveParticleEvent) {
// val particleType = event.type