aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/BlockUtils.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/EntityOutlineRenderer.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/GuiRenderUtils.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/KeyboardManager.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt7
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/Timer.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt10
12 files changed, 20 insertions, 21 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/BlockUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/BlockUtils.kt
index b37f9b885..9bc353820 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/BlockUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/BlockUtils.kt
@@ -40,7 +40,7 @@ object BlockUtils {
return false
}
- private fun rayTrace(start: LorenzVec, direction: LorenzVec, distance: Double = 50.0): LorenzVec? {
+ fun rayTrace(start: LorenzVec, direction: LorenzVec, distance: Double = 50.0): LorenzVec? {
val help = direction.normalize().multiply(distance)
val target = start.add(help)
val result = Minecraft.getMinecraft().theWorld.rayTraceBlocks(start.toVec3(), target.toVec3())
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/EntityOutlineRenderer.kt b/src/main/java/at/hannibal2/skyhanni/utils/EntityOutlineRenderer.kt
index 611edc75b..28fc08807 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/EntityOutlineRenderer.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/EntityOutlineRenderer.kt
@@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.RenderEntityOutlineEvent
import at.hannibal2.skyhanni.mixins.transformers.CustomRenderGlobal
-import at.hannibal2.skyhanni.test.command.ErrorManager.logErrorWithData
+import at.hannibal2.skyhanni.test.command.ErrorManager
import net.minecraft.client.Minecraft
import net.minecraft.client.renderer.GlStateManager
import net.minecraft.client.renderer.OpenGlHelper
@@ -366,7 +366,7 @@ object EntityOutlineRenderer {
val renderGlobal = try {
mc.renderGlobal as CustomRenderGlobal
} catch (e: NoClassDefFoundError) {
- logErrorWithData(e, "Unable to enable entity outlines, the required mixin is not loaded")
+ ErrorManager.logErrorWithData(e, "Unable to enable entity outlines, the required mixin is not loaded")
isMissingMixin = true
return
}
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/GuiRenderUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/GuiRenderUtils.kt
index 7dfae5bac..5e4a63452 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/GuiRenderUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/GuiRenderUtils.kt
@@ -16,7 +16,7 @@ import kotlin.math.roundToInt
*/
object GuiRenderUtils {
- private fun drawStringCentered(str: String?, fr: FontRenderer, x: Float, y: Float, shadow: Boolean, colour: Int) {
+ 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
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
index b419b46f4..a1b7ed09f 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
@@ -158,7 +158,7 @@ object ItemUtils {
}
// Taken from NEU
- private fun createSkull(displayName: String, uuid: String, value: String, lore: Array<String>?): ItemStack {
+ fun createSkull(displayName: String, uuid: String, value: String, lore: Array<String>?): ItemStack {
val render = ItemStack(Items.skull, 1, 3)
val tag = NBTTagCompound()
val skullOwner = NBTTagCompound()
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/KeyboardManager.kt b/src/main/java/at/hannibal2/skyhanni/utils/KeyboardManager.kt
index 9b7e1afdb..5078a492f 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/KeyboardManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/KeyboardManager.kt
@@ -16,7 +16,7 @@ object KeyboardManager {
private var lastClickedMouseButton = -1
// A mac-only key, represents Windows key on windows (but different key code)
- private fun isCommandKeyDown() = Keyboard.KEY_LMETA.isKeyHeld() || Keyboard.KEY_RMETA.isKeyHeld()
+ fun isCommandKeyDown() = Keyboard.KEY_LMETA.isKeyHeld() || Keyboard.KEY_RMETA.isKeyHeld()
fun isControlKeyDown() = Keyboard.KEY_LCONTROL.isKeyHeld() || Keyboard.KEY_RCONTROL.isKeyHeld()
fun isShiftKeyDown() = Keyboard.KEY_LSHIFT.isKeyHeld() || Keyboard.KEY_RSHIFT.isKeyHeld()
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt
index 2079408f7..e6929d737 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt
@@ -6,9 +6,8 @@ import net.minecraft.util.AxisAlignedBB
object LocationUtils {
- private fun canSee(a: LorenzVec, b: LorenzVec): Boolean {
- return Minecraft.getMinecraft().theWorld.rayTraceBlocks(a.toVec3(), b.toVec3(), false, true, false) == null
- }
+ fun canSee(a: LorenzVec, b: LorenzVec) =
+ Minecraft.getMinecraft().theWorld.rayTraceBlocks(a.toVec3(), b.toVec3(), false, true, false) == null
fun playerLocation() = Minecraft.getMinecraft().thePlayer.getLorenzVec()
@@ -28,7 +27,7 @@ object LocationUtils {
return vec.add(0.0, 0.0 + player.getEyeHeight(), 0.0)
}
- private fun AxisAlignedBB.isVecInside(vec: LorenzVec) = isVecInside(vec.toVec3())
+ fun AxisAlignedBB.isVecInside(vec: LorenzVec) = isVecInside(vec.toVec3())
fun AxisAlignedBB.isPlayerInside() = isVecInside(playerLocation())
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
index 88678fdd0..90970a315 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
@@ -367,7 +367,7 @@ object LorenzUtils {
}
// MoulConfig is in Java, I don't want to downgrade this logic
- private fun <T> onChange(vararg properties: Property<out T>, observer: Observer<T>) {
+ fun <T> onChange(vararg properties: Property<out T>, observer: Observer<T>) {
for (property in properties) {
property.whenChanged { a, b -> observer.observeChange(a, b) }
}
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt
index 869aeeb25..03f552e7a 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt
@@ -244,7 +244,7 @@ object RenderUtils {
/**
* @author Mojang
*/
- private fun drawNametag(str: String, color: Color?) {
+ fun drawNametag(str: String, color: Color?) {
val fontRenderer = Minecraft.getMinecraft().fontRendererObj
val f1 = 0.02666667f
GlStateManager.pushMatrix()
@@ -352,7 +352,7 @@ object RenderUtils {
return lastValue + (currentValue - lastValue) * multiplier
}
- private fun Position.transform(): Pair<Int, Int> {
+ fun Position.transform(): Pair<Int, Int> {
GlStateManager.translate(getAbsX().toFloat(), getAbsY().toFloat(), 0F)
GlStateManager.scale(effectiveScale, effectiveScale, 1F)
val x = ((Utils.getMouseX() - getAbsX()) / effectiveScale).toInt()
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
index b0533a142..9f65a71f1 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
@@ -254,7 +254,7 @@ object SkyBlockItemModifierUtils {
fun ItemStack.getExtraAttributes() = tagCompound?.getCompoundTag("ExtraAttributes")
- class GemstoneSlot(val type: GemstoneType, private val quality: GemstoneQuality) {
+ class GemstoneSlot(val type: GemstoneType, val quality: GemstoneQuality) {
fun getInternalName() = "${quality}_${type}_GEM".asInternalName()
}
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
index 12b2e4c64..dd114d8fd 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
@@ -61,7 +61,7 @@ object StringUtils {
return map.subMap(prefix, true, lastKey, false)
}
- private fun nextLexicographicallyStringWithSameLength(input: String): String {
+ fun nextLexicographicallyStringWithSameLength(input: String): String {
val lastCharPosition = input.length - 1
val inputWithoutLastChar = input.substring(0, lastCharPosition)
val lastChar = input[lastCharPosition]
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/Timer.kt b/src/main/java/at/hannibal2/skyhanni/utils/Timer.kt
index a03270c57..2a6d1f5ab 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/Timer.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/Timer.kt
@@ -24,7 +24,7 @@ class Timer(
val ended get() = !remaining.isPositive()
val remaining get() = duration - elapsed
- private val elapsed get() = paused?.let { it - started } ?: started.passedSince()
+ val elapsed get() = paused?.let { it - started } ?: started.passedSince()
fun pause() {
paused = SimpleTimeMark.now()
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt b/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt
index aa63f3382..9367e5ee1 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt
@@ -35,7 +35,7 @@ interface Renderable {
val list = mutableMapOf<Pair<Int, Int>, List<Int>>()
var currentRenderPassMousePosition: Pair<Int, Int>? = null
- private set
+ set
fun <T> withMousePosition(posX: Int, posY: Int, block: () -> T): T {
val last = currentRenderPassMousePosition
@@ -90,7 +90,7 @@ interface Renderable {
return clickable(hoverTips(text, tips, bypassChecks = bypassChecks), onClick, bypassChecks = bypassChecks)
}
- private fun clickable(
+ fun clickable(
render: Renderable,
onClick: () -> Unit,
button: Int = 0,
@@ -195,7 +195,7 @@ interface Renderable {
return result
}
- private fun underlined(renderable: Renderable) = object : Renderable {
+ fun underlined(renderable: Renderable) = object : Renderable {
override val width: Int
get() = renderable.width
override val height = 10
@@ -207,7 +207,7 @@ interface Renderable {
}
}
- private fun hoverable(
+ fun hoverable(
hovered: Renderable,
unhovered: Renderable,
bypassChecks: Boolean = false,
@@ -254,7 +254,7 @@ interface Renderable {
}
}
- private fun placeholder(width: Int) = object : Renderable {
+ fun placeholder(width: Int) = object : Renderable {
override val width: Int = width
override val height = 10