|
| 1 | +/* |
| 2 | + * Minosoft |
| 3 | + * Copyright (C) 2020-2025 Moritz Zwerger |
| 4 | + * |
| 5 | + * 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. |
| 6 | + * |
| 7 | + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
| 8 | + * |
| 9 | + * You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 10 | + * |
| 11 | + * This software is not affiliated with Mojang AB, the original developer of Minecraft. |
| 12 | + */ |
| 13 | + |
| 14 | +package de.bixilon.minosoft.data.registries.blocks.types.building.nether |
| 15 | + |
| 16 | +import de.bixilon.kutil.cast.CastUtil.unsafeCast |
| 17 | +import de.bixilon.minosoft.data.registries.blocks.factory.BlockFactory |
| 18 | +import de.bixilon.minosoft.data.registries.blocks.settings.BlockSettings |
| 19 | +import de.bixilon.minosoft.data.registries.blocks.state.BlockState |
| 20 | +import de.bixilon.minosoft.data.registries.blocks.state.builder.BlockStateBuilder |
| 21 | +import de.bixilon.minosoft.data.registries.blocks.types.Block |
| 22 | +import de.bixilon.minosoft.data.registries.blocks.types.building.RockBlock |
| 23 | +import de.bixilon.minosoft.data.registries.blocks.types.properties.FullBlock |
| 24 | +import de.bixilon.minosoft.data.registries.blocks.types.properties.item.BlockWithItem |
| 25 | +import de.bixilon.minosoft.data.registries.identified.Namespaces.minecraft |
| 26 | +import de.bixilon.minosoft.data.registries.identified.ResourceLocation |
| 27 | +import de.bixilon.minosoft.data.registries.item.items.Item |
| 28 | +import de.bixilon.minosoft.data.registries.item.items.tool.pickaxe.PickaxeRequirement |
| 29 | +import de.bixilon.minosoft.data.registries.registries.Registries |
| 30 | +import de.bixilon.minosoft.data.world.chunk.light.types.LightLevel |
| 31 | +import de.bixilon.minosoft.protocol.versions.Version |
| 32 | + |
| 33 | +open class Glowstone(identifier: ResourceLocation = Companion.identifier, settings: BlockSettings) : Block(identifier, settings), PickaxeRequirement, FullBlock, BlockWithItem<Item> { |
| 34 | + override val item: Item = this::item.inject(identifier) |
| 35 | + override val hardness get() = 0.3f |
| 36 | + |
| 37 | + override fun buildState(version: Version, settings: BlockStateBuilder): BlockState { |
| 38 | + return settings.build(this, luminance = LightLevel.MAX_LEVEL) |
| 39 | + } |
| 40 | + |
| 41 | + companion object : BlockFactory<Glowstone> { |
| 42 | + override val identifier = minecraft("glowstone") |
| 43 | + |
| 44 | + override fun build(registries: Registries, settings: BlockSettings) = Glowstone(settings = settings) |
| 45 | + } |
| 46 | +} |
0 commit comments