From 084b31ea344f6372d7c6ea1638b88ba5768c93d7 Mon Sep 17 00:00:00 2001 From: bluefireoly Date: Sat, 12 Sep 2020 13:55:29 +0200 Subject: [PATCH] Update Structure.kt --- .../net/axay/kspigot/structures/Structure.kt | 36 +++++++++++++------ 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/src/main/kotlin/net/axay/kspigot/structures/Structure.kt b/src/main/kotlin/net/axay/kspigot/structures/Structure.kt index 8c8f39a7..4a6eea51 100644 --- a/src/main/kotlin/net/axay/kspigot/structures/Structure.kt +++ b/src/main/kotlin/net/axay/kspigot/structures/Structure.kt @@ -15,6 +15,30 @@ interface StructureData { fun createAt(loc: Location) } +class SingleStructureData( + val location: Location, + val structureData: StructureData +) + +data class Structure( + val blocks: Set = emptySet(), + val entities: Set = emptySet() +) + +/* + * Structure data implementations. + */ + +data class StructureDataMaterial( + val material: Material +) : StructureData { + + override fun createAt(loc: Location) { + loc.block.type = material + } + +} + data class StructureDataBlock( val material: Material, val blockData: BlockData @@ -43,14 +67,4 @@ data class StructureDataEntity( loc.spawnCleanEntity(entityType)?.nbtData = nbtData } -} - -class SingleStructureData( - val location: Location, - val structureData: StructureData -) - -data class Structure( - val blocks: Set = emptySet(), - val entities: Set = emptySet() -) \ No newline at end of file +} \ No newline at end of file