25 lines
724 B
Kotlin
25 lines
724 B
Kotlin
package net.shadowfacts.asmr.program.blocks
|
|
|
|
import net.minecraft.util.Identifier
|
|
import net.shadowfacts.asmr.ASMR
|
|
import net.shadowfacts.asmr.program.ProgramBlock
|
|
import net.shadowfacts.asmr.program.ProgramBlockInput
|
|
import net.shadowfacts.asmr.program.ProgramBlockOutput
|
|
import net.shadowfacts.asmr.program.ProgramType
|
|
|
|
/**
|
|
* @author shadowfacts
|
|
*/
|
|
class ConstantBlock<Type: Any>(
|
|
val type: ProgramType<Type>,
|
|
val value: Type
|
|
): ProgramBlock() {
|
|
|
|
val output = ProgramBlockOutput(Identifier(ASMR.modid, "constant_output"), type, this).apply {
|
|
value = this@ConstantBlock.value
|
|
}
|
|
|
|
override val inputs: Array<ProgramBlockInput<*>> = arrayOf()
|
|
override val outputs: Array<ProgramBlockOutput<*>> = arrayOf(output)
|
|
|
|
} |