Merge branch 'kotlin-1.8' into kotlin-1.9

This commit is contained in:
octarine-noise
2016-04-19 21:00:48 +02:00
8 changed files with 27 additions and 10 deletions

View File

@@ -18,7 +18,7 @@ class RenderAlgae : AbstractBlockRenderingHandler(BetterFoliageMod.MOD_ID) {
val noise = simplexNoise()
val algaeIcons = iconSet(BetterFoliageMod.LEGACY_DOMAIN, "blocks/better_algae_%d")
val algaeModels = modelSet(64, RenderGrass.grassTopQuads)
val algaeModels = modelSet(64, RenderGrass.grassTopQuads(Config.algae.heightMin, Config.algae.heightMax))
override fun afterStitch() {
Client.log(INFO, "Registered ${algaeIcons.num} algae textures")

View File

@@ -45,7 +45,7 @@ class RenderCoral : AbstractBlockRenderingHandler(BetterFoliageMod.MOD_ID) {
override fun isEligible(ctx: BlockContext) =
Config.enabled && Config.coral.enabled &&
ctx.cameraDistance < Config.coral.distance &&
ctx.blockState(up2).material == Material.water &&
(ctx.blockState(up2).material == Material.water || Config.coral.shallowWater) &&
ctx.blockState(up1).material == Material.water &&
Config.blocks.sand.matchesID(ctx.block) &&
ctx.biomeId in Config.coral.biomes &&

View File

@@ -21,9 +21,9 @@ import org.apache.logging.log4j.Level.INFO
class RenderGrass : AbstractBlockRenderingHandler(BetterFoliageMod.MOD_ID) {
companion object {
@JvmStatic val grassTopQuads: Model.(Int)->Unit = { modelIdx ->
@JvmStatic fun grassTopQuads(heightMin: Double, heightMax: Double): Model.(Int)->Unit = { modelIdx ->
verticalRectangle(x1 = -0.5, z1 = 0.5, x2 = 0.5, z2 = -0.5, yBottom = 0.5,
yTop = 0.5 + random(Config.shortGrass.heightMin, Config.shortGrass.heightMax)
yTop = 0.5 + random(heightMin, heightMax)
)
.setAoShader(faceOrientedAuto(overrideFace = UP, corner = cornerAo(Axis.Y)))
.setFlatShader(faceOrientedAuto(overrideFace = UP, corner = cornerFlat))
@@ -36,7 +36,7 @@ class RenderGrass : AbstractBlockRenderingHandler(BetterFoliageMod.MOD_ID) {
val normalGenIcon = iconStatic(Client.genGrass.generatedResource("minecraft:blocks/tallgrass", "snowed" to false))
val snowedGenIcon = iconStatic(Client.genGrass.generatedResource("minecraft:blocks/tallgrass", "snowed" to true))
val grassModels = modelSet(64, grassTopQuads)
val grassModels = modelSet(64, grassTopQuads(Config.shortGrass.heightMin, Config.shortGrass.heightMax))
override fun afterStitch() {
Client.log(INFO, "Registered ${normalIcons.num} grass textures")

View File

@@ -16,6 +16,8 @@ import net.minecraft.util.EnumFacing.*
class RenderLog : AbstractRenderColumn(BetterFoliageMod.MOD_ID) {
override val moveToCutout: Boolean get() = false
override fun isEligible(ctx: BlockContext) =
Config.enabled && Config.roundLogs.enabled &&
ctx.cameraDistance < Config.roundLogs.distance &&

View File

@@ -18,7 +18,7 @@ import org.apache.logging.log4j.Level.INFO
class RenderMycelium : AbstractBlockRenderingHandler(BetterFoliageMod.MOD_ID) {
val myceliumIcon = iconSet(BetterFoliageMod.LEGACY_DOMAIN, "blocks/better_mycel_%d")
val myceliumModel = modelSet(64, RenderGrass.grassTopQuads)
val myceliumModel = modelSet(64, RenderGrass.grassTopQuads(Config.shortGrass.heightMin, Config.shortGrass.heightMax))
override fun afterStitch() {
Client.log(INFO, "Registered ${myceliumIcon.num} mycelium textures")