feat: abstract projection block
This commit is contained in:
parent
76be0de81e
commit
81735d5f12
@ -33,7 +33,7 @@ object ProjectorBlock : Block(Properties.of()
|
||||
.lightLevel { 3 }
|
||||
.mapColor(MapColor.COLOR_BLACK)
|
||||
.randomTicks()
|
||||
.destroyTime(4.0f)
|
||||
.strength(4.0f)
|
||||
.requiresCorrectToolForDrops()) {
|
||||
|
||||
override fun use(
|
||||
|
22
common/src/main/kotlin/quaedam/projection/ProjectionBlock.kt
Normal file
22
common/src/main/kotlin/quaedam/projection/ProjectionBlock.kt
Normal file
@ -0,0 +1,22 @@
|
||||
package quaedam.projection
|
||||
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import net.minecraft.world.level.block.Block
|
||||
import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraft.world.level.material.MapColor
|
||||
import net.minecraft.world.level.storage.loot.LootParams
|
||||
|
||||
abstract class ProjectionBlock(properties: Properties = createProperties()) : Block(properties) {
|
||||
|
||||
companion object {
|
||||
fun createProperties(): Properties = Properties.of()
|
||||
.strength(3.5f)
|
||||
.requiresCorrectToolForDrops()
|
||||
.mapColor(MapColor.COLOR_GRAY)
|
||||
|
||||
}
|
||||
|
||||
@Suppress("OVERRIDE_DEPRECATION")
|
||||
override fun getDrops(blockState: BlockState, builder: LootParams.Builder) = listOf(ItemStack(asItem()))
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package quaedam.projection
|
||||
|
||||
import net.minecraft.core.BlockPos
|
||||
import net.minecraft.world.InteractionHand
|
||||
import net.minecraft.world.InteractionResult
|
||||
import net.minecraft.world.entity.player.Player
|
||||
import net.minecraft.world.item.BlockItem
|
||||
import net.minecraft.world.item.Item
|
||||
import net.minecraft.world.level.Level
|
||||
import net.minecraft.world.level.block.Block
|
||||
import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraft.world.level.material.MapColor
|
||||
import net.minecraft.world.phys.BlockHitResult
|
||||
import quaedam.Quaedam
|
||||
|
||||
object SkylightProjection {
|
||||
|
||||
const val ID = "skylight_projection"
|
||||
|
||||
val block = Quaedam.blocks.register(ID) { SkylightProjectionBlock }
|
||||
|
||||
val item = Quaedam.items.register(ID) {
|
||||
BlockItem(
|
||||
SkylightProjectionBlock, Item.Properties()
|
||||
.`arch$tab`(Quaedam.creativeModeTab)
|
||||
)
|
||||
}!!
|
||||
|
||||
}
|
||||
|
||||
object SkylightProjectionBlock : ProjectionBlock(createProperties().lightLevel { 3 }) {
|
||||
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "quaedam:block/skylight_projection"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"parent": "minecraft:block/cube_all",
|
||||
"textures": {
|
||||
"all": "quaedam:block/projection",
|
||||
"up": "#ext"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "quaedam:block/projection",
|
||||
"textures": {
|
||||
"ext": "quaedam:block/skylight_projection"
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 257 B |
Binary file not shown.
After Width: | Height: | Size: 363 B |
Loading…
Reference in New Issue
Block a user