diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-07-06 08:08:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-06 08:08:52 +0200 |
commit | 7b3ed85d171c156f895fdbaeff4d18572fc0f18e (patch) | |
tree | 0bbfeca0a796bdd6494548f9f161edbc7fb6b700 /src/main/java/at/hannibal2/skyhanni/utils | |
parent | 34ba8c5fb8304e7b568822f8d3f675a0f133c6da (diff) | |
download | skyhanni-7b3ed85d171c156f895fdbaeff4d18572fc0f18e.tar.gz skyhanni-7b3ed85d171c156f895fdbaeff4d18572fc0f18e.tar.bz2 skyhanni-7b3ed85d171c156f895fdbaeff4d18572fc0f18e.zip |
Backend: Fixed typos everywhere (#2175)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
15 files changed, 97 insertions, 93 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/CombatUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/CombatUtils.kt index 5edd33bc0..0ea909851 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/CombatUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/CombatUtils.kt @@ -113,10 +113,10 @@ object CombatUtils { /** * Taken from NotEnoughUpdates */ - fun interp(now: Float, last: Float, lastupdate: Long): Float { + fun interp(now: Float, last: Float, lastUpdate: Long): Float { var interp = now if (last >= 0 && last != now) { - var factor = (System.currentTimeMillis() - lastupdate) / 1000f + var factor = (System.currentTimeMillis() - lastUpdate) / 1000f factor = LerpUtils.clampZeroOne(factor) interp = last + (now - last) * factor } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/EntityOutlineRenderer.kt b/src/main/java/at/hannibal2/skyhanni/utils/EntityOutlineRenderer.kt index 889530cd6..97225369d 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/EntityOutlineRenderer.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/EntityOutlineRenderer.kt @@ -37,7 +37,7 @@ import java.lang.reflect.Method object EntityOutlineRenderer { private val entityRenderCache: CachedInfo = CachedInfo(null, null, null) - private var stopLookingForOptifine = false + private var stopLookingForOptiFine = false private var isMissingMixin = false private var isFastRender: Method? = null private var isShaders: Method? = null @@ -56,13 +56,13 @@ object EntityOutlineRenderer { */ private fun initSwapBuffer(): Framebuffer { val main = mc.framebuffer - val framebuffer = Framebuffer(main.framebufferTextureWidth, main.framebufferTextureHeight, true) - framebuffer.setFramebufferFilter(GL11.GL_NEAREST) - framebuffer.setFramebufferColor(0.0f, 0.0f, 0.0f, 0.0f) - return framebuffer + val frameBuffer = Framebuffer(main.framebufferTextureWidth, main.framebufferTextureHeight, true) + frameBuffer.setFramebufferFilter(GL11.GL_NEAREST) + frameBuffer.setFramebufferColor(0.0f, 0.0f, 0.0f, 0.0f) + return frameBuffer } - private fun updateFramebufferSize() { + private fun updateFrameBufferSize() { val width = mc.displayWidth val height = mc.displayHeight if (swapBuffer.framebufferWidth != width || swapBuffer.framebufferHeight != height) { @@ -94,7 +94,7 @@ object EntityOutlineRenderer { val renderGlobal = mc.renderGlobal as CustomRenderGlobal val renderManager = mc.renderManager mc.theWorld.theProfiler.endStartSection("entityOutlines") - updateFramebufferSize() + updateFrameBufferSize() // Clear and bind the outline framebuffer renderGlobal.frameBuffer.framebufferClear() @@ -216,7 +216,7 @@ object EntityOutlineRenderer { } /** - * Caches optifine settings and determines whether outlines should be rendered + * Caches OptiFine settings and determines whether outlines should be rendered * * @return `true` iff outlines should be rendered */ @@ -232,8 +232,8 @@ object EntityOutlineRenderer { val renderGlobal = mc.renderGlobal as CustomRenderGlobal if (renderGlobal.frameBuffer == null || renderGlobal.shader == null || mc.thePlayer == null) return false - // Optifine Conditions - if (!stopLookingForOptifine && isFastRender == null) { + // OptiFine Conditions + if (!stopLookingForOptiFine && isFastRender == null) { try { val config = Class.forName("Config") try { @@ -241,12 +241,12 @@ object EntityOutlineRenderer { isShaders = config.getMethod("isShaders") isAntialiasing = config.getMethod("isAntialiasing") } catch (ex: Exception) { - logger.log("Couldn't find Optifine methods for entity outlines.") - stopLookingForOptifine = true + logger.log("Couldn't find OptiFine methods for entity outlines.") + stopLookingForOptiFine = true } } catch (ex: Exception) { - logger.log("Couldn't find Optifine for entity outlines.") - stopLookingForOptifine = true + logger.log("Couldn't find OptiFine for entity outlines.") + stopLookingForOptiFine = true } } var isFastRenderValue = false @@ -258,9 +258,9 @@ object EntityOutlineRenderer { isShadersValue = isShaders!!.invoke(null) as Boolean isAntialiasingValue = isAntialiasing!!.invoke(null) as Boolean } catch (ex: IllegalAccessException) { - logger.log("An error occurred while calling Optifine methods for entity outlines... $ex") + logger.log("An error occurred while calling OptiFine methods for entity outlines... $ex") } catch (ex: InvocationTargetException) { - logger.log("An error occurred while calling Optifine methods for entity outlines... $ex") + logger.log("An error occurred while calling OptiFine methods for entity outlines... $ex") } } return !isFastRenderValue && !isShadersValue && !isAntialiasingValue @@ -373,15 +373,15 @@ object EntityOutlineRenderer { val xrayOutlineEvent = RenderEntityOutlineEvent(RenderEntityOutlineEvent.Type.XRAY, null) xrayOutlineEvent.postAndCatch() // Get all entities to render no xray outlines, using pre-filtered entities (no need to test xray outlined entities) - val noxrayOutlineEvent = RenderEntityOutlineEvent( + val noXrayOutlineEvent = RenderEntityOutlineEvent( RenderEntityOutlineEvent.Type.NO_XRAY, xrayOutlineEvent.entitiesToChooseFrom ) - noxrayOutlineEvent.postAndCatch() + noXrayOutlineEvent.postAndCatch() // Cache the entities for future use entityRenderCache.xrayCache = xrayOutlineEvent.entitiesToOutline - entityRenderCache.noXrayCache = noxrayOutlineEvent.entitiesToOutline - entityRenderCache.noOutlineCache = noxrayOutlineEvent.entitiesToChooseFrom + entityRenderCache.noXrayCache = noXrayOutlineEvent.entitiesToOutline + entityRenderCache.noOutlineCache = noXrayOutlineEvent.entitiesToChooseFrom emptyLastTick = if (isCacheEmpty()) { if (!emptyLastTick) { renderGlobal.frameBuffer.framebufferClear() diff --git a/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt index ab0afd93c..d2c24ceca 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt @@ -76,7 +76,7 @@ object InventoryUtils { val booleanField = storage.javaClass.getDeclaredField("enableStorageGUI3") booleanField.get(storage) as Boolean } catch (e: Throwable) { - ErrorManager.logErrorWithData(e, "Could not read NEU config to determine if the neu storage is emabled.") + ErrorManager.logErrorWithData(e, "Could not read NEU config to determine if the neu storage is enabled.") false } } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt index c094df489..5edc227dd 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt @@ -295,7 +295,7 @@ object ItemUtils { private val itemAmountCache = mutableMapOf<String, Pair<String, Int>>() fun readItemAmount(originalInput: String): Pair<String, Int>? { - // This workaround fixes 'Tubto Cacti I Book' + // This workaround fixes 'Turbo Cacti I Book' val input = (if (originalInput.endsWith(" Book")) { originalInput.replace(" Book", "") } else originalInput).removeResets() diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt index e322b5ae3..b9a790d31 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt @@ -62,9 +62,9 @@ object LocationUtils { val t1 = (this.minBox() - origin) * rayDirectionInverse val t2 = (this.maxBox() - origin) * rayDirectionInverse - val tmin = max(t1.minOfEachElement(t2).max(), Double.NEGATIVE_INFINITY) - val tmax = min(t1.maxOfEachElement(t2).min(), Double.POSITIVE_INFINITY) - return tmax >= tmin && tmax >= 0.0 + val tMin = max(t1.minOfEachElement(t2).max(), Double.NEGATIVE_INFINITY) + val tMax = min(t1.maxOfEachElement(t2).min(), Double.POSITIVE_INFINITY) + return tMax >= tMin && tMax >= 0.0 } fun AxisAlignedBB.union(aabbs: List<AxisAlignedBB>?): AxisAlignedBB? { diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt index ee9228609..ea2a935a3 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt @@ -126,7 +126,7 @@ object LorenzUtils { val EntityLivingBase.baseMaxHealth: Int get() = this.getEntityAttribute(SharedMonsterAttributes.maxHealth).baseValue.toInt() - // TODO create extenstion function + // TODO create extension function fun formatPercentage(percentage: Double): String = formatPercentage(percentage, "0.00") fun formatPercentage(percentage: Double, format: String?): String = diff --git a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt index fe9e9df6a..1f389e51b 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt @@ -215,7 +215,7 @@ object RenderUtils { val bottomOffset = 0 val topOffset = bottomOffset + height val tessellator = Tessellator.getInstance() - val worldrenderer = tessellator.worldRenderer + val worldRenderer = tessellator.worldRenderer Minecraft.getMinecraft().textureManager.bindTexture(beaconBeam) GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0f) GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0f) @@ -244,59 +244,59 @@ object RenderUtils { val d11 = 0.5 + sin(d2 + 5.497787143782138) * 0.2 val d14 = -1.0 + d1 val d15 = height.toDouble() * 2.5 + d14 - worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR) - worldrenderer.pos(x + d4, y + topOffset, z + d5).tex(1.0, d15).color(r, g, b, 1.0f * alphaMultiplier) + worldRenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR) + worldRenderer.pos(x + d4, y + topOffset, z + d5).tex(1.0, d15).color(r, g, b, 1.0f * alphaMultiplier) .endVertex() - worldrenderer.pos(x + d4, y + bottomOffset, z + d5).tex(1.0, d14).color(r, g, b, 1.0f).endVertex() - worldrenderer.pos(x + d6, y + bottomOffset, z + d7).tex(0.0, d14).color(r, g, b, 1.0f).endVertex() - worldrenderer.pos(x + d6, y + topOffset, z + d7).tex(0.0, d15).color(r, g, b, 1.0f * alphaMultiplier) + worldRenderer.pos(x + d4, y + bottomOffset, z + d5).tex(1.0, d14).color(r, g, b, 1.0f).endVertex() + worldRenderer.pos(x + d6, y + bottomOffset, z + d7).tex(0.0, d14).color(r, g, b, 1.0f).endVertex() + worldRenderer.pos(x + d6, y + topOffset, z + d7).tex(0.0, d15).color(r, g, b, 1.0f * alphaMultiplier) .endVertex() - worldrenderer.pos(x + d10, y + topOffset, z + d11).tex(1.0, d15).color(r, g, b, 1.0f * alphaMultiplier) + worldRenderer.pos(x + d10, y + topOffset, z + d11).tex(1.0, d15).color(r, g, b, 1.0f * alphaMultiplier) .endVertex() - worldrenderer.pos(x + d10, y + bottomOffset, z + d11).tex(1.0, d14).color(r, g, b, 1.0f).endVertex() - worldrenderer.pos(x + d8, y + bottomOffset, z + d9).tex(0.0, d14).color(r, g, b, 1.0f).endVertex() - worldrenderer.pos(x + d8, y + topOffset, z + d9).tex(0.0, d15).color(r, g, b, 1.0f * alphaMultiplier) + worldRenderer.pos(x + d10, y + bottomOffset, z + d11).tex(1.0, d14).color(r, g, b, 1.0f).endVertex() + worldRenderer.pos(x + d8, y + bottomOffset, z + d9).tex(0.0, d14).color(r, g, b, 1.0f).endVertex() + worldRenderer.pos(x + d8, y + topOffset, z + d9).tex(0.0, d15).color(r, g, b, 1.0f * alphaMultiplier) .endVertex() - worldrenderer.pos(x + d6, y + topOffset, z + d7).tex(1.0, d15).color(r, g, b, 1.0f * alphaMultiplier) + worldRenderer.pos(x + d6, y + topOffset, z + d7).tex(1.0, d15).color(r, g, b, 1.0f * alphaMultiplier) .endVertex() - worldrenderer.pos(x + d6, y + bottomOffset, z + d7).tex(1.0, d14).color(r, g, b, 1.0f).endVertex() - worldrenderer.pos(x + d10, y + bottomOffset, z + d11).tex(0.0, d14).color(r, g, b, 1.0f).endVertex() - worldrenderer.pos(x + d10, y + topOffset, z + d11).tex(0.0, d15).color(r, g, b, 1.0f * alphaMultiplier) + worldRenderer.pos(x + d6, y + bottomOffset, z + d7).tex(1.0, d14).color(r, g, b, 1.0f).endVertex() + worldRenderer.pos(x + d10, y + bottomOffset, z + d11).tex(0.0, d14).color(r, g, b, 1.0f).endVertex() + worldRenderer.pos(x + d10, y + topOffset, z + d11).tex(0.0, d15).color(r, g, b, 1.0f * alphaMultiplier) .endVertex() - worldrenderer.pos(x + d8, y + topOffset, z + d9).tex(1.0, d15).color(r, g, b, 1.0f * alphaMultiplier) + worldRenderer.pos(x + d8, y + topOffset, z + d9).tex(1.0, d15).color(r, g, b, 1.0f * alphaMultiplier) .endVertex() - worldrenderer.pos(x + d8, y + bottomOffset, z + d9).tex(1.0, d14).color(r, g, b, 1.0f).endVertex() - worldrenderer.pos(x + d4, y + bottomOffset, z + d5).tex(0.0, d14).color(r, g, b, 1.0f).endVertex() - worldrenderer.pos(x + d4, y + topOffset, z + d5).tex(0.0, d15).color(r, g, b, 1.0f * alphaMultiplier) + worldRenderer.pos(x + d8, y + bottomOffset, z + d9).tex(1.0, d14).color(r, g, b, 1.0f).endVertex() + worldRenderer.pos(x + d4, y + bottomOffset, z + d5).tex(0.0, d14).color(r, g, b, 1.0f).endVertex() + worldRenderer.pos(x + d4, y + topOffset, z + d5).tex(0.0, d15).color(r, g, b, 1.0f * alphaMultiplier) .endVertex() tessellator.draw() GlStateManager.disableCull() val d12 = -1.0 + d1 val d13 = height + d12 - worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR) - worldrenderer.pos(x + 0.2, y + topOffset, z + 0.2).tex(1.0, d13).color(r, g, b, 0.25f * alphaMultiplier) + worldRenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR) + worldRenderer.pos(x + 0.2, y + topOffset, z + 0.2).tex(1.0, d13).color(r, g, b, 0.25f * alphaMultiplier) .endVertex() - worldrenderer.pos(x + 0.2, y + bottomOffset, z + 0.2).tex(1.0, d12).color(r, g, b, 0.25f).endVertex() - worldrenderer.pos(x + 0.8, y + bottomOffset, z + 0.2).tex(0.0, d12).color(r, g, b, 0.25f).endVertex() - worldrenderer.pos(x + 0.8, y + topOffset, z + 0.2).tex(0.0, d13).color(r, g, b, 0.25f * alphaMultiplier) + worldRenderer.pos(x + 0.2, y + bottomOffset, z + 0.2).tex(1.0, d12).color(r, g, b, 0.25f).endVertex() + worldRenderer.pos(x + 0.8, y + bottomOffset, z + 0.2).tex(0.0, d12).color(r, g, b, 0.25f).endVertex() + worldRenderer.pos(x + 0.8, y + topOffset, z + 0.2).tex(0.0, d13).color(r, g, b, 0.25f * alphaMultiplier) .endVertex() - worldrenderer.pos(x + 0.8, y + topOffset, z + 0.8).tex(1.0, d13).color(r, g, b, 0.25f * alphaMultiplier) + worldRenderer.pos(x + 0.8, y + topOffset, z + 0.8).tex(1.0, d13).color(r, g, b, 0.25f * alphaMultiplier) .endVertex() - worldrenderer.pos(x + 0.8, y + bottomOffset, z + 0.8).tex(1.0, d12).color(r, g, b, 0.25f).endVertex() - worldrenderer.pos(x + 0.2, y + bottomOffset, z + 0.8).tex(0.0, d12).color(r, g, b, 0.25f).endVertex() - worldrenderer.pos(x + 0.2, y + topOffset, z + 0.8).tex(0.0, d13).color(r, g, b, 0.25f * alphaMultiplier) + worldRenderer.pos(x + 0.8, y + bottomOffset, z + 0.8).tex(1.0, d12).color(r, g, b, 0.25f).endVertex() + worldRenderer.pos(x + 0.2, y + bottomOffset, z + 0.8).tex(0.0, d12).color(r, g, b, 0.25f).endVertex() + worldRenderer.pos(x + 0.2, y + topOffset, z + 0.8).tex(0.0, d13).color(r, g, b, 0.25f * alphaMultiplier) .endVertex() - worldrenderer.pos(x + 0.8, y + topOffset, z + 0.2).tex(1.0, d13).color(r, g, b, 0.25f * alphaMultiplier) + worldRenderer.pos(x + 0.8, y + topOffset, z + 0.2).tex(1.0, d13).color(r, g, b, 0.25f * alphaMultiplier) .endVertex() - worldrenderer.pos(x + 0.8, y + bottomOffset, z + 0.2).tex(1.0, d12).color(r, g, b, 0.25f).endVertex() - worldrenderer.pos(x + 0.8, y + bottomOffset, z + 0.8).tex(0.0, d12).color(r, g, b, 0.25f).endVertex() - worldrenderer.pos(x + 0.8, y + topOffset, z + 0.8).tex(0.0, d13).color(r, g, b, 0.25f * alphaMultiplier) + worldRenderer.pos(x + 0.8, y + bottomOffset, z + 0.2).tex(1.0, d12).color(r, g, b, 0.25f).endVertex() + worldRenderer.pos(x + 0.8, y + bottomOffset, z + 0.8).tex(0.0, d12).color(r, g, b, 0.25f).endVertex() + worldRenderer.pos(x + 0.8, y + topOffset, z + 0.8).tex(0.0, d13).color(r, g, b, 0.25f * alphaMultiplier) .endVertex() - worldrenderer.pos(x + 0.2, y + topOffset, z + 0.8).tex(1.0, d13).color(r, g, b, 0.25f * alphaMultiplier) + worldRenderer.pos(x + 0.2, y + topOffset, z + 0.8).tex(1.0, d13).color(r, g, b, 0.25f * alphaMultiplier) .endVertex() - worldrenderer.pos(x + 0.2, y + bottomOffset, z + 0.8).tex(1.0, d12).color(r, g, b, 0.25f).endVertex() - worldrenderer.pos(x + 0.2, y + bottomOffset, z + 0.2).tex(0.0, d12).color(r, g, b, 0.25f).endVertex() - worldrenderer.pos(x + 0.2, y + topOffset, z + 0.2).tex(0.0, d13).color(r, g, b, 0.25f * alphaMultiplier) + worldRenderer.pos(x + 0.2, y + bottomOffset, z + 0.8).tex(1.0, d12).color(r, g, b, 0.25f).endVertex() + worldRenderer.pos(x + 0.2, y + bottomOffset, z + 0.2).tex(0.0, d12).color(r, g, b, 0.25f).endVertex() + worldRenderer.pos(x + 0.2, y + topOffset, z + 0.2).tex(0.0, d13).color(r, g, b, 0.25f * alphaMultiplier) .endVertex() tessellator.draw() } @@ -809,19 +809,19 @@ object RenderUtils { bindCamera() val tessellator = Tessellator.getInstance() - val worldrenderer = tessellator.worldRenderer - worldrenderer.begin(GL11.GL_QUAD_STRIP, DefaultVertexFormats.POSITION) + val worldRenderer = tessellator.worldRenderer + worldRenderer.begin(GL11.GL_QUAD_STRIP, DefaultVertexFormats.POSITION) var currentAngle = 0f val angleStep = 0.1f while (currentAngle < 2 * Math.PI) { val xOffset = radius * cos(currentAngle.toDouble()).toFloat() val zOffset = radius * sin(currentAngle.toDouble()).toFloat() - worldrenderer.pos(x + xOffset, y + height, z + zOffset).endVertex() - worldrenderer.pos(x + xOffset, y + 0, z + zOffset).endVertex() + worldRenderer.pos(x + xOffset, y + height, z + zOffset).endVertex() + worldRenderer.pos(x + xOffset, y + 0, z + zOffset).endVertex() currentAngle += angleStep } - worldrenderer.pos(x + radius, y + height, z).endVertex() - worldrenderer.pos(x + radius, y + 0.0, z).endVertex() + worldRenderer.pos(x + radius, y + height, z).endVertex() + worldRenderer.pos(x + radius, y + 0.0, z).endVertex() tessellator.draw() GlStateManager.enableCull() @@ -1388,9 +1388,9 @@ object RenderUtils { GlStateManager.depthMask(false) } GlStateManager.color(color.red / 255f, color.green / 255f, color.blue / 255f, color.alpha / 255f) - val ctrlpoints = p1.toFloatArray() + p2.toFloatArray() + p3.toFloatArray() + val ctrlPoints = p1.toFloatArray() + p2.toFloatArray() + p3.toFloatArray() bezier2Buffer.clear() - ctrlpoints.forEach { + ctrlPoints.forEach { bezier2Buffer.put(it) } bezier2Buffer.flip() @@ -1477,8 +1477,6 @@ object RenderUtils { GlStateManager.disableTexture2D() GlStateManager.disableCull() - val tessellator = Tessellator.getInstance() - GlStateManager.pushMatrix() RenderUtils.translate(getViewerPos(partialTicks).negated()) getViewerPos(partialTicks) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt index 1780764cd..2b3ece2c7 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt @@ -327,7 +327,7 @@ object SkyBlockItemModifierUtils { fun getByName(name: String): GemstoneSlotType = entries.firstOrNull { name.uppercase(Locale.ENGLISH).contains(it.name) } - ?: error("Unknwon GemstoneSlotType: '$name'") + ?: error("Unknown GemstoneSlotType: '$name'") fun getColorCode(name: String) = getByName(name).colorCode } 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 b51c83295..b12668d72 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt @@ -250,10 +250,16 @@ interface Renderable { val openGui = guiScreen?.javaClass?.name ?: "none" val isInNeuPv = openGui == "io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer" val neuFocus = NEUItems.neuHasFocus() - val isInSkyTilsPv = openGui == "gg.skytils.skytilsmod.gui.profile.ProfileGui" + val isInSkytilsPv = openGui == "gg.skytils.skytilsmod.gui.profile.ProfileGui" - val result = isGuiScreen && isGuiPositionEditor && inMenu && isNotInSignAndOnSlot && isConfigScreen && - !isInNeuPv && !isInSkyTilsPv && !neuFocus + val result = isGuiScreen && + isGuiPositionEditor && + inMenu && + isNotInSignAndOnSlot && + isConfigScreen && + !isInNeuPv && + !isInSkytilsPv && + !neuFocus if (debug) { if (!result) { @@ -266,7 +272,7 @@ interface Renderable { if (!isConfigScreen) logger.log("isConfigScreen") if (isInNeuPv) logger.log("isInNeuPv") if (neuFocus) logger.log("neuFocus") - if (isInSkyTilsPv) logger.log("isInSkyTilsPv") + if (isInSkytilsPv) logger.log("isInSkytilsPv") logger.log("") } else { logger.log("allowed click") @@ -647,7 +653,7 @@ interface Renderable { } } - fun fixedSizeCollum( + fun fixedSizeColumn( content: Renderable, height: Int, horizontalAlign: HorizontalAlignment = HorizontalAlignment.LEFT, diff --git a/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt b/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt index 8f55a8b1f..8d26cf46a 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt @@ -58,7 +58,7 @@ object RepoPatternManager { */ private var usedKeys: NavigableMap<String, CommonPatternInfo<*, *>> = TreeMap() - private var wasPreinitialized = false + private var wasPreInitialized = false private val isInDevEnv = try { Launch.blackboard["fml.deobfuscatedEnvironment"] as Boolean } catch (_: Exception) { @@ -261,7 +261,7 @@ object RepoPatternManager { @HandleEvent fun onPreInitFinished(event: PreInitFinishedEvent) { - wasPreinitialized = true + wasPreInitialized = true val dumpDirective = System.getenv("SKYHANNI_DUMP_REGEXES") if (dumpDirective.isNullOrBlank()) return val (sourceLabel, path) = dumpDirective.split(":", limit = 2) @@ -274,7 +274,7 @@ object RepoPatternManager { fun of(key: String, fallback: String, parentKeyHolder: RepoPatternKeyOwner? = null): RepoPattern { verifyKeyShape(key) - if (wasPreinitialized && !config.tolerateLateRegistration) { + if (wasPreInitialized && !config.tolerateLateRegistration) { crash("Illegal late initialization of repo pattern. Repo pattern needs to be created during pre-initialization.") } if (key in usedKeys) { @@ -289,7 +289,7 @@ object RepoPatternManager { parentKeyHolder: RepoPatternKeyOwner? = null, ): RepoPatternList { verifyKeyShape(key) - if (wasPreinitialized && !config.tolerateLateRegistration) { + if (wasPreInitialized && !config.tolerateLateRegistration) { crash("Illegal late initialization of repo pattern. Repo pattern needs to be created during pre-initialization.") } if (key in usedKeys) { diff --git a/src/main/java/at/hannibal2/skyhanni/utils/shader/Shader.kt b/src/main/java/at/hannibal2/skyhanni/utils/shader/Shader.kt index c110d6d6e..83e812149 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/shader/Shader.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/shader/Shader.kt @@ -66,7 +66,7 @@ abstract class Shader(val vertex: String, val fragment: String) { ShaderHelper.glLinkProgram(shaderProgram) - if (ShaderHelper.glGetProgrami(shaderProgram, ShaderHelper.GL_LINK_STATUS) == GL11.GL_FALSE) { + if (ShaderHelper.glGetProgramInt(shaderProgram, ShaderHelper.GL_LINK_STATUS) == GL11.GL_FALSE) { val errorMessage = "Failed to link vertex shader $vertex and fragment shader $fragment. Features that " + "utilise this shader will not work correctly, if at all" val errorLog = StringUtils.trim(ShaderHelper.glGetShaderInfoLog(shaderProgram, 1024)) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/shader/ShaderHelper.kt b/src/main/java/at/hannibal2/skyhanni/utils/shader/ShaderHelper.kt index 89efd7d9f..1e8062500 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/shader/ShaderHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/shader/ShaderHelper.kt @@ -82,11 +82,11 @@ class ShaderHelper { ) else GL20.glGetProgramInfoLog(program, maxLength) } - fun glGetProgrami(program: Int, pname: Int): Int { + fun glGetProgramInt(program: Int, pName: Int): Int { return if (USING_ARB_SHADERS) ARBShaderObjects.glGetObjectParameteriARB( program, - pname - ) else GL20.glGetProgrami(program, pname) + pName + ) else GL20.glGetProgrami(program, pName) } fun glUseProgram(program: Int) { @@ -115,11 +115,11 @@ class ShaderHelper { if (USING_ARB_SHADERS) ARBShaderObjects.glCompileShaderARB(shader) else GL20.glCompileShader(shader) } - fun glGetShaderi(shader: Int, pname: Int): Int { + fun glGetShaderInt(shader: Int, pName: Int): Int { return if (USING_ARB_SHADERS) ARBShaderObjects.glGetObjectParameteriARB( shader, - pname - ) else GL20.glGetShaderi(shader, pname) + pName + ) else GL20.glGetShaderi(shader, pName) } fun glGetShaderInfoLog(shader: Int, maxLength: Int): String { diff --git a/src/main/java/at/hannibal2/skyhanni/utils/shader/ShaderManager.kt b/src/main/java/at/hannibal2/skyhanni/utils/shader/ShaderManager.kt index 057e0a031..39a2fe302 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/shader/ShaderManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/shader/ShaderManager.kt @@ -71,7 +71,7 @@ object ShaderManager { ShaderHelper.glShaderSource(shaderID, source.toString()) ShaderHelper.glCompileShader(shaderID) - if (ShaderHelper.glGetShaderi(shaderID, ShaderHelper.GL_COMPILE_STATUS) == 0) { + if (ShaderHelper.glGetShaderInt(shaderID, ShaderHelper.GL_COMPILE_STATUS) == 0) { val errorMessage = "Failed to compile shader $fileName${type.extension}. Features that utilise this " + "shader will not work correctly, if at all" val errorLog = StringUtils.trim(ShaderHelper.glGetShaderInfoLog(shaderID, 1024)) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/tracker/ItemTrackerData.kt b/src/main/java/at/hannibal2/skyhanni/utils/tracker/ItemTrackerData.kt index 5fa12dbb6..4b871377b 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/tracker/ItemTrackerData.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/tracker/ItemTrackerData.kt @@ -24,7 +24,7 @@ abstract class ItemTrackerData : TrackerData() { resetItems() } - fun additem(internalName: NEUInternalName, stackSize: Int) { + fun addItem(internalName: NEUInternalName, stackSize: Int) { val item = items.getOrPut(internalName) { TrackedItem() } item.timesGained++ diff --git a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt index f7bafb7f3..21f115746 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt @@ -37,7 +37,7 @@ class SkyHanniItemTracker<Data : ItemTrackerData>( fun addItem(internalName: NEUInternalName, amount: Int) { modify { - it.additem(internalName, amount) + it.addItem(internalName, amount) } getSharedTracker()?.let { val hidden = it.get(DisplayMode.TOTAL).items[internalName]!!.hidden |