PhysicalConnectivity/src/main/kotlin/net/shadowfacts/phycon/PhysicalConnectivity.kt

35 lines
989 B
Kotlin

package net.shadowfacts.phycon
import net.fabricmc.api.ModInitializer
import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking
import net.shadowfacts.phycon.init.PhyBlockEntities
import net.shadowfacts.phycon.init.PhyBlocks
import net.shadowfacts.phycon.init.PhyItems
import net.shadowfacts.phycon.init.PhyScreens
import net.shadowfacts.phycon.networking.C2STerminalRequestItem
import net.shadowfacts.phycon.networking.C2STerminalUpdateDisplayedItems
import net.shadowfacts.phycon.networking.ServerReceiver
/**
* @author shadowfacts
*/
object PhysicalConnectivity: ModInitializer {
val MODID = "phycon"
override fun onInitialize() {
PhyBlocks.init()
PhyBlockEntities.init()
PhyItems.init()
PhyScreens.init()
registerGlobalReceiver(C2STerminalRequestItem)
registerGlobalReceiver(C2STerminalUpdateDisplayedItems)
}
private fun registerGlobalReceiver(receiver: ServerReceiver) {
ServerPlayNetworking.registerGlobalReceiver(receiver.CHANNEL, receiver)
}
}