KStarbound/src/main/kotlin/ru/dbotthepony/kstarbound/defs/tile/BuiltinMetaMaterials.kt
2024-03-28 10:15:43 +07:00

68 lines
2.1 KiB
Kotlin

package ru.dbotthepony.kstarbound.defs.tile
import com.google.common.collect.ImmutableList
import com.google.common.collect.ImmutableMap
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,
damageTable = AssetReference(TileDamageConfig(
damageFactors = ImmutableMap.of(),
damageRecovery = Double.MAX_VALUE,
maximumEffectTime = 0.0,
totalHealth = Double.MAX_VALUE,
harvestLevel = Int.MAX_VALUE,
))
))
/**
* 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,
)
}