diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt | 2 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt | 1 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt | 12 |
3 files changed, 14 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt index b34462e3e..721547ef4 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt @@ -16,7 +16,7 @@ import net.minecraft.item.ItemStack import net.minecraft.nbt.NBTTagCompound object NEUItems { - private val manager: NEUManager get() = NotEnoughUpdates.INSTANCE.manager + val manager: NEUManager get() = NotEnoughUpdates.INSTANCE.manager private val itemCache = mutableMapOf<String, ItemStack>() private val itemNameCache = mutableMapOf<String, String>() // item name -> internal name private val multiplierCache = mutableMapOf<String, Pair<String, Int>>() diff --git a/src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt index 5089b4d82..050937022 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt @@ -12,6 +12,7 @@ import java.net.URI object OSUtils { + @JvmStatic fun openBrowser(url: String) { if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) { try { diff --git a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt index df5567415..bab653f68 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt @@ -790,4 +790,16 @@ object RenderUtils { GlStateManager.disableLighting() GlStateManager.enableDepth() } + + /** + * Taken from NotEnoughUpdates + */ + fun drawStringCentered(str: String?, fr: FontRenderer, x: Float, y: Float, shadow: Boolean, colour: Int) { + val strLen = fr.getStringWidth(str) + val x2 = x - strLen / 2f + val y2 = y - fr.FONT_HEIGHT / 2f + GL11.glTranslatef(x2, y2, 0f) + fr.drawString(str, 0f, 0f, colour, shadow) + GL11.glTranslatef(-x2, -y2, 0f) + } }
\ No newline at end of file |