KStarbound/src/main/kotlin/ru/dbotthepony/kstarbound/defs/tile/BuiltinMetaMaterials.kt

67 lines
2.0 KiB
Kotlin

package ru.dbotthepony.kstarbound.defs.tile
import com.google.common.collect.ImmutableList
import it.unimi.dsi.fastutil.objects.Object2DoubleMap
import it.unimi.dsi.fastutil.objects.Object2DoubleMaps
import ru.dbotthepony.kstarbound.Registries
import ru.dbotthepony.kstarbound.Registry
import ru.dbotthepony.kstarbound.defs.AssetReference
import ru.dbotthepony.kstarbound.world.physics.CollisionType
import ru.dbotthepony.kstarbound.defs.ThingDescription
object BuiltinMetaMaterials {
private fun make(id: Int, name: String, collisionType: CollisionType) = Registries.tiles.add(name, id, TileDefinition(
materialId = id,
materialName = "metamaterial:$name",
descriptionData = ThingDescription.EMPTY,
category = "meta",
renderTemplate = AssetReference.empty(),
renderParameters = RenderParameters.META,
isMeta = true,
collisionKind = collisionType,
damageConfig = TileDamageConfig(
damageFactors = Object2DoubleMaps.emptyMap(),
damageRecovery = 1.0,
maximumEffectTime = 0.0,
health = null,
harvestLevel = null,
)
))
/**
* air
*/
val EMPTY = make(65535, "empty", CollisionType.NONE)
/**
* not set / out of bounds
*/
val NULL = make(65534, "null", CollisionType.BLOCK)
val STRUCTURE = make(65533, "structure", CollisionType.BLOCK)
val BIOME = make(65527, "biome", CollisionType.BLOCK)
val BIOME1 = make(65528, "biome1", CollisionType.BLOCK)
val BIOME2 = make(65529, "biome2", CollisionType.BLOCK)
val BIOME3 = make(65530, "biome3", CollisionType.BLOCK)
val BIOME4 = make(65531, "biome4", CollisionType.BLOCK)
val BIOME5 = make(65532, "biome5", CollisionType.BLOCK)
val BOUNDARY = make(65526, "boundary", CollisionType.SLIPPERY)
val OBJECT_SOLID = make(65500, "objectsolid", CollisionType.BLOCK)
val OBJECT_PLATFORM = make(65501, "objectplatform", CollisionType.PLATFORM)
val MATERIALS: ImmutableList<Registry.Entry<TileDefinition>> = ImmutableList.of(
EMPTY,
NULL,
STRUCTURE,
BIOME,
BIOME1,
BIOME2,
BIOME3,
BIOME4,
BIOME5,
BOUNDARY,
OBJECT_SOLID,
OBJECT_PLATFORM,
)
}