update Forge / Forgelin / Kotlin versions
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user