From d96ac1c94c70d72fafba3cefac19e56ac840b9e1 Mon Sep 17 00:00:00 2001 From: octarine-noise Date: Tue, 3 Sep 2019 14:23:44 +0200 Subject: [PATCH] update Forge / Forgelin / Kotlin versions --- build.gradle | 2 +- gradle.properties | 6 +++--- src/main/kotlin/mods/betterfoliage/client/config/Config.kt | 2 +- .../client/render/AbstractBlockRenderingHandler.kt | 7 ++++--- .../mods/octarinecore/common/config/DelegatingConfig.kt | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index 80aa42e..0acbc5d 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ repositories { } dependencies { - compileOnly "net.shadowfacts:Forgelin:$forgelin_version" + compile "net.shadowfacts:Forgelin:$forgelin_version" } minecraft { diff --git a/gradle.properties b/gradle.properties index 250fe6d..39e328b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,8 +4,8 @@ jarName = BetterFoliage-MC1.12 version = 2.2.1 mc_version = 1.12.2 -forge_version = 14.23.5.2768 +forge_version = 14.23.5.2844 mcp_mappings = stable_39 -kotlin_version = 1.2.41 -forgelin_version = 1.6.0 \ No newline at end of file +kotlin_version = 1.3.40 +forgelin_version = 1.8.3 \ No newline at end of file diff --git a/src/main/kotlin/mods/betterfoliage/client/config/Config.kt b/src/main/kotlin/mods/betterfoliage/client/config/Config.kt index a0526df..4cab178 100644 --- a/src/main/kotlin/mods/betterfoliage/client/config/Config.kt +++ b/src/main/kotlin/mods/betterfoliage/client/config/Config.kt @@ -198,7 +198,7 @@ object Config : DelegatingConfig(BetterFoliageMod.MOD_ID, BetterFoliageMod.DOMAI blocks.leavesModels, blocks.grassClasses, blocks.grassModels, - shortGrass["saturationThreshold"] + shortGrass["saturationThreshold"]!! ) override fun onChange(event: ConfigChangedEvent.PostConfigChangedEvent) { diff --git a/src/main/kotlin/mods/octarinecore/client/render/AbstractBlockRenderingHandler.kt b/src/main/kotlin/mods/octarinecore/client/render/AbstractBlockRenderingHandler.kt index c7b6344..ae62e95 100644 --- a/src/main/kotlin/mods/octarinecore/client/render/AbstractBlockRenderingHandler.kt +++ b/src/main/kotlin/mods/octarinecore/client/render/AbstractBlockRenderingHandler.kt @@ -22,6 +22,7 @@ import net.minecraft.util.math.BlockPos import net.minecraft.util.math.MathHelper import net.minecraft.world.IBlockAccess import net.minecraft.world.biome.Biome +import kotlin.math.abs /** * [ThreadLocal] instance of [BlockContext] representing the block being rendered. @@ -114,8 +115,8 @@ class BlockContext { /** Get the distance of the block from the camera (player). */ val cameraDistance: Int get() { val camera = Minecraft.getMinecraft().renderViewEntity ?: return 0 - return Math.abs(pos.x - MathHelper.floor(camera.posX)) + - Math.abs(pos.y - MathHelper.floor(camera.posY)) + - Math.abs(pos.z - MathHelper.floor(camera.posZ)) + return abs(pos.x - MathHelper.floor(camera.posX)) + + abs(pos.y - MathHelper.floor(camera.posY)) + + abs(pos.z - MathHelper.floor(camera.posZ)) } } \ No newline at end of file diff --git a/src/main/kotlin/mods/octarinecore/common/config/DelegatingConfig.kt b/src/main/kotlin/mods/octarinecore/common/config/DelegatingConfig.kt index bbddd94..92948e2 100644 --- a/src/main/kotlin/mods/octarinecore/common/config/DelegatingConfig.kt +++ b/src/main/kotlin/mods/octarinecore/common/config/DelegatingConfig.kt @@ -92,7 +92,7 @@ abstract class DelegatingConfig(val modId: String, val langPrefix: String) { * Returns true if any of the given configuration elements have changed. * Supports both categories and */ - fun hasChanged(elements: List<*>): Boolean { + fun hasChanged(elements: List): Boolean { reflectNestedObjects.forEach { category -> if (category.second in elements && config?.getCategory(category.first)?.hasChanged() ?: false) return true }