parent
06a368c740
commit
f2fa61c1ab
@ -359,6 +359,10 @@ private fun blocks(provider: MatteryLanguageProvider) {
|
|||||||
add(MBlocks.TRITANIUM_TRAPDOOR, "Tritanium Trapdoor")
|
add(MBlocks.TRITANIUM_TRAPDOOR, "Tritanium Trapdoor")
|
||||||
add(MBlocks.TRITANIUM_TRAPDOOR, "description0", "High blast resistance door with redstone latch...")
|
add(MBlocks.TRITANIUM_TRAPDOOR, "description0", "High blast resistance door with redstone latch...")
|
||||||
add(MBlocks.TRITANIUM_TRAPDOOR, "description1", "...feeling safe now?")
|
add(MBlocks.TRITANIUM_TRAPDOOR, "description1", "...feeling safe now?")
|
||||||
|
|
||||||
|
add(MBlocks.TRITANIUM_PRESSURE_PLATE, "Tritanium Pressure Plate")
|
||||||
|
add(MBlocks.TRITANIUM_PRESSURE_PLATE, "description0", "Activates only if player steps on it")
|
||||||
|
add(MBlocks.TRITANIUM_PRESSURE_PLATE, "description1", "High blast resistance")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ fun addLootTables(lootTables: LootTables) {
|
|||||||
lootTables.dropsSelf(MBlocks.METAL_BEAM)
|
lootTables.dropsSelf(MBlocks.METAL_BEAM)
|
||||||
|
|
||||||
lootTables.dropsSelf(MBlocks.TRITANIUM_TRAPDOOR)
|
lootTables.dropsSelf(MBlocks.TRITANIUM_TRAPDOOR)
|
||||||
|
lootTables.dropsSelf(MBlocks.TRITANIUM_PRESSURE_PLATE)
|
||||||
|
|
||||||
lootTables.blockSimple(MBlocks.PHANTOM_ATTRACTOR) {
|
lootTables.blockSimple(MBlocks.PHANTOM_ATTRACTOR) {
|
||||||
it.add(LootItem.lootTableItem(MBlocks.PHANTOM_ATTRACTOR)
|
it.add(LootItem.lootTableItem(MBlocks.PHANTOM_ATTRACTOR)
|
||||||
|
@ -56,6 +56,11 @@ fun addCraftingTableRecipes(consumer: Consumer<FinishedRecipe>) {
|
|||||||
.unlockedBy(MItemTags.TRITANIUM_PLATES)
|
.unlockedBy(MItemTags.TRITANIUM_PLATES)
|
||||||
.build(consumer)
|
.build(consumer)
|
||||||
|
|
||||||
|
MatteryRecipe(MBlocks.TRITANIUM_PRESSURE_PLATE)
|
||||||
|
.row(MItemTags.TRITANIUM_PLATES, MItemTags.BASIC_CIRCUIT, MItemTags.TRITANIUM_PLATES)
|
||||||
|
.unlockedBy(MItemTags.TRITANIUM_PLATES)
|
||||||
|
.build(consumer)
|
||||||
|
|
||||||
MatteryRecipe(MBlocks.PLATE_PRESS)
|
MatteryRecipe(MBlocks.PLATE_PRESS)
|
||||||
.row(MItems.ELECTRIC_PARTS, MItems.ENERGY_BUS, MItems.ELECTRIC_PARTS)
|
.row(MItems.ELECTRIC_PARTS, MItems.ENERGY_BUS, MItems.ELECTRIC_PARTS)
|
||||||
.row(MItemTags.TRITANIUM_INGOTS, Items.BLAST_FURNACE, MItemTags.TRITANIUM_INGOTS)
|
.row(MItemTags.TRITANIUM_INGOTS, Items.BLAST_FURNACE, MItemTags.TRITANIUM_INGOTS)
|
||||||
|
@ -99,6 +99,7 @@ fun addTags(tagsProvider: TagsProvider) {
|
|||||||
|
|
||||||
MBlocks.TRITANIUM_DOOR,
|
MBlocks.TRITANIUM_DOOR,
|
||||||
MBlocks.TRITANIUM_TRAPDOOR,
|
MBlocks.TRITANIUM_TRAPDOOR,
|
||||||
|
MBlocks.TRITANIUM_PRESSURE_PLATE,
|
||||||
), Tiers.IRON)
|
), Tiers.IRON)
|
||||||
|
|
||||||
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_ORE, Tiers.IRON)
|
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_ORE, Tiers.IRON)
|
||||||
|
@ -0,0 +1,64 @@
|
|||||||
|
package ru.dbotthepony.mc.otm.block
|
||||||
|
|
||||||
|
import net.minecraft.ChatFormatting
|
||||||
|
import net.minecraft.core.BlockPos
|
||||||
|
import net.minecraft.network.chat.Component
|
||||||
|
import net.minecraft.server.level.ServerPlayer
|
||||||
|
import net.minecraft.sounds.SoundEvents
|
||||||
|
import net.minecraft.sounds.SoundSource
|
||||||
|
import net.minecraft.world.item.DyeColor
|
||||||
|
import net.minecraft.world.item.ItemStack
|
||||||
|
import net.minecraft.world.item.TooltipFlag
|
||||||
|
import net.minecraft.world.level.BlockGetter
|
||||||
|
import net.minecraft.world.level.Level
|
||||||
|
import net.minecraft.world.level.LevelAccessor
|
||||||
|
import net.minecraft.world.level.block.BasePressurePlateBlock
|
||||||
|
import net.minecraft.world.level.block.Block
|
||||||
|
import net.minecraft.world.level.block.state.BlockState
|
||||||
|
import net.minecraft.world.level.block.state.StateDefinition
|
||||||
|
import net.minecraft.world.level.block.state.properties.BlockStateProperties
|
||||||
|
import net.minecraft.world.level.material.Material
|
||||||
|
import ru.dbotthepony.mc.otm.core.TranslatableComponent
|
||||||
|
import ru.dbotthepony.mc.otm.core.get
|
||||||
|
|
||||||
|
class TritaniumPressurePlate : BasePressurePlateBlock(Properties.of(Material.METAL, DyeColor.LIGHT_BLUE).explosionResistance(80f).noOcclusion().destroyTime(3f).requiresCorrectToolForDrops()) {
|
||||||
|
override fun appendHoverText(
|
||||||
|
p_49816_: ItemStack,
|
||||||
|
p_49817_: BlockGetter?,
|
||||||
|
p_49818_: MutableList<Component>,
|
||||||
|
p_49819_: TooltipFlag
|
||||||
|
) {
|
||||||
|
super.appendHoverText(p_49816_, p_49817_, p_49818_, p_49819_)
|
||||||
|
p_49818_.add(TranslatableComponent("$descriptionId.description0").withStyle(ChatFormatting.DARK_GRAY))
|
||||||
|
p_49818_.add(TranslatableComponent("$descriptionId.description1").withStyle(ChatFormatting.DARK_GRAY))
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun createBlockStateDefinition(p_49915_: StateDefinition.Builder<Block, BlockState>) {
|
||||||
|
super.createBlockStateDefinition(p_49915_)
|
||||||
|
p_49915_.add(BlockStateProperties.POWERED)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun playOnSound(level: LevelAccessor, pos: BlockPos) {
|
||||||
|
level.playSound(null, pos, SoundEvents.METAL_PRESSURE_PLATE_CLICK_ON, SoundSource.BLOCKS, 0.3f, 0.9f)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun playOffSound(level: LevelAccessor, pos: BlockPos) {
|
||||||
|
level.playSound(null, pos, SoundEvents.METAL_PRESSURE_PLATE_CLICK_OFF, SoundSource.BLOCKS, 0.3f, 0.9f)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getSignalStrength(level: Level, pos: BlockPos): Int {
|
||||||
|
if (level.getEntitiesOfClass(ServerPlayer::class.java, TOUCH_AABB.move(pos)).isNotEmpty()) {
|
||||||
|
return 15
|
||||||
|
} else {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getSignalForState(state: BlockState): Int {
|
||||||
|
return if (state[BlockStateProperties.POWERED]) 15 else 0
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun setSignalForState(state: BlockState, signal: Int): BlockState {
|
||||||
|
return state.setValue(BlockStateProperties.POWERED, signal > 0)
|
||||||
|
}
|
||||||
|
}
|
@ -336,8 +336,13 @@ fun FriendlyByteBuf.readItemType(): Item? {
|
|||||||
return ForgeRegistries.ITEMS.getValue(readInt())
|
return ForgeRegistries.ITEMS.getValue(readInt())
|
||||||
}
|
}
|
||||||
|
|
||||||
operator fun <T : Comparable<T>> StateHolder<*, *>.get(value: Property<T>): T {
|
operator fun <T : Comparable<T>> StateHolder<*, *>.get(property: Property<T>): T {
|
||||||
return getValue(value)
|
return getValue(property)
|
||||||
|
}
|
||||||
|
|
||||||
|
operator fun <S : StateHolder<*, *>, T : Comparable<T>> S.set(property: Property<T>, value: T): S {
|
||||||
|
setValue(property, value)
|
||||||
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
fun <T> List<T>.toImmutableList(): List<T> {
|
fun <T> List<T>.toImmutableList(): List<T> {
|
||||||
|
@ -19,12 +19,40 @@ import net.minecraftforge.eventbus.api.IEventBus
|
|||||||
import net.minecraftforge.registries.DeferredRegister
|
import net.minecraftforge.registries.DeferredRegister
|
||||||
import net.minecraftforge.registries.ForgeRegistries
|
import net.minecraftforge.registries.ForgeRegistries
|
||||||
import ru.dbotthepony.mc.otm.OverdriveThatMatters
|
import ru.dbotthepony.mc.otm.OverdriveThatMatters
|
||||||
import ru.dbotthepony.mc.otm.block.*
|
import ru.dbotthepony.mc.otm.block.AndroidStationBlock
|
||||||
import ru.dbotthepony.mc.otm.block.matter.*
|
import ru.dbotthepony.mc.otm.block.BatteryBankBlock
|
||||||
import ru.dbotthepony.mc.otm.block.storage.*
|
import ru.dbotthepony.mc.otm.block.BlackHoleBlock
|
||||||
|
import ru.dbotthepony.mc.otm.block.BlockExplosionDebugger
|
||||||
|
import ru.dbotthepony.mc.otm.block.BlockGravitationStabilizer
|
||||||
|
import ru.dbotthepony.mc.otm.block.BlockGravitationStabilizerLens
|
||||||
|
import ru.dbotthepony.mc.otm.block.BlockSphereDebugger
|
||||||
|
import ru.dbotthepony.mc.otm.block.ChemicalGeneratorBlock
|
||||||
|
import ru.dbotthepony.mc.otm.block.EnergyCounterBlock
|
||||||
|
import ru.dbotthepony.mc.otm.block.EnergyServoBlock
|
||||||
|
import ru.dbotthepony.mc.otm.block.LaboratoryLamp
|
||||||
|
import ru.dbotthepony.mc.otm.block.LaboratoryLampLight
|
||||||
|
import ru.dbotthepony.mc.otm.block.MatterCableBlock
|
||||||
|
import ru.dbotthepony.mc.otm.block.PhantomAttractorBlock
|
||||||
|
import ru.dbotthepony.mc.otm.block.PlatePressBlock
|
||||||
|
import ru.dbotthepony.mc.otm.block.StorageCableBlock
|
||||||
|
import ru.dbotthepony.mc.otm.block.TritaniumPressurePlate
|
||||||
|
import ru.dbotthepony.mc.otm.block.matter.MatterBottlerBlock
|
||||||
|
import ru.dbotthepony.mc.otm.block.matter.MatterCapacitorBankBlock
|
||||||
|
import ru.dbotthepony.mc.otm.block.matter.MatterDecomposerBlock
|
||||||
|
import ru.dbotthepony.mc.otm.block.matter.MatterPanelBlock
|
||||||
|
import ru.dbotthepony.mc.otm.block.matter.MatterRecyclerBlock
|
||||||
|
import ru.dbotthepony.mc.otm.block.matter.MatterReplicatorBlock
|
||||||
|
import ru.dbotthepony.mc.otm.block.matter.MatterScannerBlock
|
||||||
|
import ru.dbotthepony.mc.otm.block.matter.PatternStorageBlock
|
||||||
|
import ru.dbotthepony.mc.otm.block.storage.DriveRackBlock
|
||||||
|
import ru.dbotthepony.mc.otm.block.storage.DriveViewerBlock
|
||||||
|
import ru.dbotthepony.mc.otm.block.storage.ItemMonitorBlock
|
||||||
|
import ru.dbotthepony.mc.otm.block.storage.StorageBusBlock
|
||||||
|
import ru.dbotthepony.mc.otm.block.storage.StorageExporterBlock
|
||||||
|
import ru.dbotthepony.mc.otm.block.storage.StorageImporterBlock
|
||||||
|
import ru.dbotthepony.mc.otm.block.storage.StoragePowerSupplierBlock
|
||||||
import ru.dbotthepony.mc.otm.core.TranslatableComponent
|
import ru.dbotthepony.mc.otm.core.TranslatableComponent
|
||||||
|
|
||||||
|
|
||||||
object MBlocks {
|
object MBlocks {
|
||||||
private val registry = DeferredRegister.create(ForgeRegistries.BLOCKS, OverdriveThatMatters.MOD_ID)
|
private val registry = DeferredRegister.create(ForgeRegistries.BLOCKS, OverdriveThatMatters.MOD_ID)
|
||||||
|
|
||||||
@ -121,6 +149,8 @@ object MBlocks {
|
|||||||
}
|
}
|
||||||
} }
|
} }
|
||||||
|
|
||||||
|
val TRITANIUM_PRESSURE_PLATE: Block by registry.register(MNames.TRITANIUM_PRESSURE_PLATE) { TritaniumPressurePlate() }
|
||||||
|
|
||||||
init {
|
init {
|
||||||
MRegistry.CARGO_CRATES.registerBlocks(registry)
|
MRegistry.CARGO_CRATES.registerBlocks(registry)
|
||||||
MRegistry.TRITANIUM_BLOCK.registerBlocks(registry)
|
MRegistry.TRITANIUM_BLOCK.registerBlocks(registry)
|
||||||
|
@ -226,6 +226,7 @@ object MItems {
|
|||||||
|
|
||||||
val TRITANIUM_DOOR: Item by registry.register(MNames.TRITANIUM_DOOR) { DoubleHighBlockItem(MBlocks.TRITANIUM_DOOR, DEFAULT_PROPERTIES_DECORATIVE) }
|
val TRITANIUM_DOOR: Item by registry.register(MNames.TRITANIUM_DOOR) { DoubleHighBlockItem(MBlocks.TRITANIUM_DOOR, DEFAULT_PROPERTIES_DECORATIVE) }
|
||||||
val TRITANIUM_TRAPDOOR: Item by registry.register(MNames.TRITANIUM_TRAPDOOR) { BlockItem(MBlocks.TRITANIUM_TRAPDOOR, DEFAULT_PROPERTIES_DECORATIVE) }
|
val TRITANIUM_TRAPDOOR: Item by registry.register(MNames.TRITANIUM_TRAPDOOR) { BlockItem(MBlocks.TRITANIUM_TRAPDOOR, DEFAULT_PROPERTIES_DECORATIVE) }
|
||||||
|
val TRITANIUM_PRESSURE_PLATE: Item by registry.register(MNames.TRITANIUM_TRAPDOOR) { BlockItem(MBlocks.TRITANIUM_PRESSURE_PLATE, DEFAULT_PROPERTIES_DECORATIVE) }
|
||||||
|
|
||||||
// components
|
// components
|
||||||
val MATTER_IO_PORT: Item by registry.register(MNames.MATTER_IO_PORT) { Item(DEFAULT_PROPERTIES) }
|
val MATTER_IO_PORT: Item by registry.register(MNames.MATTER_IO_PORT) { Item(DEFAULT_PROPERTIES) }
|
||||||
|
@ -229,6 +229,7 @@ object MNames {
|
|||||||
|
|
||||||
const val TRITANIUM_DOOR = "tritanium_door"
|
const val TRITANIUM_DOOR = "tritanium_door"
|
||||||
const val TRITANIUM_TRAPDOOR = "tritanium_trapdoor"
|
const val TRITANIUM_TRAPDOOR = "tritanium_trapdoor"
|
||||||
|
const val TRITANIUM_PRESSURE_PLATE = "tritanium_pressure_plate"
|
||||||
}
|
}
|
||||||
|
|
||||||
object StatNames {
|
object StatNames {
|
||||||
|
Loading…
Reference in New Issue
Block a user