mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-14 18:05:51 -04:00
leaves: use new reflection
This commit is contained in:
parent
9c84f6caec
commit
1be37cd9ba
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Minosoft
|
* Minosoft
|
||||||
* Copyright (C) 2020-2023 Moritz Zwerger
|
* Copyright (C) 2020-2024 Moritz Zwerger
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
@ -13,7 +13,8 @@
|
|||||||
|
|
||||||
package de.bixilon.minosoft.data.registries.blocks.types.wood
|
package de.bixilon.minosoft.data.registries.blocks.types.wood
|
||||||
|
|
||||||
import de.bixilon.kutil.reflection.ReflectionUtil.forceSet
|
import de.bixilon.kutil.reflection.ReflectionUtil.field
|
||||||
|
import de.bixilon.kutil.reflection.ReflectionUtil.jvmField
|
||||||
import de.bixilon.minosoft.data.container.stack.ItemStack
|
import de.bixilon.minosoft.data.container.stack.ItemStack
|
||||||
import de.bixilon.minosoft.data.direction.Directions
|
import de.bixilon.minosoft.data.direction.Directions
|
||||||
import de.bixilon.minosoft.data.registries.blocks.light.CustomLightProperties
|
import de.bixilon.minosoft.data.registries.blocks.light.CustomLightProperties
|
||||||
@ -47,7 +48,7 @@ abstract class LeavesBlock(identifier: ResourceLocation, settings: BlockSettings
|
|||||||
override val tintProvider: TintProvider? = null
|
override val tintProvider: TintProvider? = null
|
||||||
|
|
||||||
override fun initTint(manager: TintManager) {
|
override fun initTint(manager: TintManager) {
|
||||||
this::tintProvider.forceSet(manager.foliage)
|
TINT_PROVIDER.set(this, manager.foliage)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun buildState(version: Version, settings: BlockStateSettings): BlockState {
|
override fun buildState(version: Version, settings: BlockStateSettings): BlockState {
|
||||||
@ -73,6 +74,7 @@ abstract class LeavesBlock(identifier: ResourceLocation, settings: BlockSettings
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
private val TINT_PROVIDER = LeavesBlock::tintProvider.jvmField.field
|
||||||
val LIGHT_PROPERTIES = CustomLightProperties(true, false, true)
|
val LIGHT_PROPERTIES = CustomLightProperties(true, false, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -333,6 +333,7 @@ object KUtil {
|
|||||||
return x.matches(other.x, margin) && y.matches(other.y, margin) && z.matches(other.z, margin)
|
return x.matches(other.x, margin) && y.matches(other.y, margin) && z.matches(other.z, margin)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated("jiibles 1.2")
|
||||||
fun <T> table(elements: Collection<T>, vararg headers: AnyString, builder: (T) -> Array<Any?>?): Table {
|
fun <T> table(elements: Collection<T>, vararg headers: AnyString, builder: (T) -> Array<Any?>?): Table {
|
||||||
val table = Table(headers.unsafeCast())
|
val table = Table(headers.unsafeCast())
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user