update Forge / Forgelin / Kotlin versions

This commit is contained in:
octarine-noise
2019-09-03 14:23:44 +02:00
parent ac015b12df
commit d96ac1c94c
5 changed files with 10 additions and 9 deletions

View File

@@ -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) {

View File

@@ -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))
}
}

View File

@@ -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<ConfigPropertyBase>): Boolean {
reflectNestedObjects.forEach { category ->
if (category.second in elements && config?.getCategory(category.first)?.hasChanged() ?: false) return true
}