27 lines
762 B
Kotlin
27 lines
762 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(
|
|
Identifier(ASMR.modid, "constant")
|
|
) {
|
|
|
|
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)
|
|
|
|
} |