package net.shadowfacts.phycon.init import net.minecraft.block.Block import net.minecraft.block.entity.BlockEntity import net.minecraft.block.entity.BlockEntityType import net.minecraft.util.Identifier import net.minecraft.util.registry.Registry import net.shadowfacts.phycon.network.block.netswitch.SwitchBlock import net.shadowfacts.phycon.network.block.netswitch.SwitchBlockEntity import net.shadowfacts.phycon.network.block.test.DestBlock import net.shadowfacts.phycon.network.block.test.DestBlockEntity import net.shadowfacts.phycon.network.block.test.SourceBlock import net.shadowfacts.phycon.network.block.test.SourceBlockEntity //import net.shadowfacts.phycon.network.block.netinterface.InterfaceBlock //import net.shadowfacts.phycon.network.block.netinterface.InterfaceBlockEntity //import net.shadowfacts.phycon.network.block.terminal.TerminalBlock //import net.shadowfacts.phycon.network.block.terminal.TerminalBlockEntity /** * @author shadowfacts */ object PhyBlockEntities { // val INTERFACE = create(::InterfaceBlockEntity, PhyBlocks.INTERFACE) // val TERMINAL = create(::TerminalBlockEntity, PhyBlocks.TERMINAL) val SWITCH = create(::SwitchBlockEntity, PhyBlocks.SWITCH) val SOURCE = create(::SourceBlockEntity, PhyBlocks.SOURCE) val DEST = create(::DestBlockEntity, PhyBlocks.DEST) private fun create(builder: () -> T, block: Block): BlockEntityType { return BlockEntityType.Builder.create(builder, block).build(null) } fun init() { // register(InterfaceBlock.ID, INTERFACE) // register(TerminalBlock.ID, TERMINAL) register(SwitchBlock.ID, SWITCH) register(SourceBlock.ID, SOURCE) register(DestBlock.ID, DEST) } private fun register(id: Identifier, type: BlockEntityType<*>) { Registry.register(Registry.BLOCK_ENTITY_TYPE, id, type) } }