2019-08-09 01:44:59 +00:00
|
|
|
package net.shadowfacts.asmr.program.blocks
|
|
|
|
|
2019-08-10 02:39:01 +00:00
|
|
|
import net.minecraft.util.Identifier
|
|
|
|
import net.shadowfacts.asmr.ASMR
|
2019-08-10 03:18:02 +00:00
|
|
|
import net.shadowfacts.asmr.program.*
|
2019-08-12 00:05:09 +00:00
|
|
|
import net.shadowfacts.asmr.program.execution.SimpleExecutableBlock
|
2019-08-09 01:44:59 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author shadowfacts
|
|
|
|
*/
|
|
|
|
class PrintBlock<Type: Any>(
|
|
|
|
val type: ProgramType<Type>
|
2019-08-12 00:05:09 +00:00
|
|
|
): SimpleExecutableBlock(
|
2019-08-10 23:21:26 +00:00
|
|
|
Identifier(ASMR.modid, "print")
|
|
|
|
) {
|
2019-08-09 01:44:59 +00:00
|
|
|
|
2019-08-10 23:21:26 +00:00
|
|
|
val input = ProgramBlockInput(Identifier(ASMR.modid, "print.input"), type, this)
|
2019-08-09 01:44:59 +00:00
|
|
|
|
|
|
|
override val inputs: Array<ProgramBlockInput<*>> = arrayOf(input)
|
|
|
|
override val outputs: Array<ProgramBlockOutput<*>> = arrayOf()
|
|
|
|
|
|
|
|
override fun execute() {
|
|
|
|
println(input.value)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|