diff options
author | Lorenz <lo.scherf@gmail.com> | 2022-08-06 17:56:02 +0200 |
---|---|---|
committer | Lorenz <lo.scherf@gmail.com> | 2022-08-06 17:56:02 +0200 |
commit | 84b9b27da573a33d845642547a50510bf8a8a234 (patch) | |
tree | bb9baadd6324890e5cda1b01aac39a73d717116a /src/main/java/at/hannibal2/skyhanni/utils | |
parent | c9b4b56db48e935f7c671d0fe0c9c4a0e3edcfdf (diff) | |
download | skyhanni-84b9b27da573a33d845642547a50510bf8a8a234.tar.gz skyhanni-84b9b27da573a33d845642547a50510bf8a8a234.tar.bz2 skyhanni-84b9b27da573a33d845642547a50510bf8a8a234.zip |
adding support for damage indicator outside dungeon
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/GuiRender.kt | 4 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt | 4 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/GuiRender.kt b/src/main/java/at/hannibal2/skyhanni/utils/GuiRender.kt index 6d221daa7..014960e7a 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/GuiRender.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/GuiRender.kt @@ -1,7 +1,7 @@ package at.hannibal2.skyhanni.utils import at.hannibal2.skyhanni.config.gui.core.config.Position -import at.hannibal2.skyhanni.utils.LorenzUtils.removeColorCodes +import at.hannibal2.skyhanni.utils.LorenzUtils.removeColor import net.minecraft.client.Minecraft import net.minecraft.client.gui.ScaledResolution import net.minecraft.client.renderer.GlStateManager @@ -17,7 +17,7 @@ object GuiRender { val renderer = Minecraft.getMinecraft().renderManager.fontRenderer - val offsetX = (200 - renderer.getStringWidth(textToRender.removeColorCodes())) / 2 + val offsetX = (200 - renderer.getStringWidth(textToRender.removeColor())) / 2 val x = getAbsX(resolution, 200) + offsetX val y = getAbsY(resolution, 16) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt index db1767214..a4482247f 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt @@ -1,7 +1,7 @@ package at.hannibal2.skyhanni.utils import at.hannibal2.skyhanni.utils.LorenzUtils.matchRegex -import at.hannibal2.skyhanni.utils.LorenzUtils.removeColorCodes +import at.hannibal2.skyhanni.utils.LorenzUtils.removeColor import com.google.gson.GsonBuilder import com.google.gson.JsonObject import net.minecraft.client.Minecraft @@ -12,7 +12,7 @@ import java.util.* object ItemUtils { private val gson = GsonBuilder().setPrettyPrinting().create() - fun ItemStack.cleanName() = this.displayName.removeColorCodes() + fun ItemStack.cleanName() = this.displayName.removeColor() fun getItemsInOpenChest(): List<ItemStack> { val list = mutableListOf<ItemStack>() diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt index d29cbee71..94d12aa9b 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt @@ -58,7 +58,7 @@ object LorenzUtils { fun String.matchRegex(@Language("RegExp") regex: String): Boolean = regex.toRegex().matches(this) - fun String.removeColorCodes(): String { + fun String.removeColor(): String { val builder = StringBuilder() var skipNext = false for (c in this.toCharArray()) { |