AE Compat Plugin + Router Unit

This commit is contained in:
Sunstrike committed 2013-11-03 11:07:37 +00:00
1 parent 6e5041dfb6
commit 2ebedc8b08
3 files changed
+55 -1

No files matched your search

@@ -0,0 +1,32 @@
package mantle.compat.plugins.builtin
import mantle.compat.plugins.ICompatPlugin
import mantle.router.routing.RouterCoordinator
import mantle.router.routing.builtin.UnitAppEng
/**
* Applied Energistics compatibility plugin
*
* @author Sunstrike <[email protected]>
*/
object PluginAppEng extends ICompatPlugin {
def providedMod: String = "AppliedEnergistics"
def accept() {
RouterCoordinator.registerPipelineUnit(UnitAppEng) // Register AE pipeline object
}
def preInit() {
}
def init() {
}
def postInit() {
}
}
@@ -11,7 +11,8 @@ import mantle.router.lib.RouterRepo._
* Handles all incoming Mantle messages and their processing.
*
* Reserved Mantle messages:
* * registerDecorativeBlock (Block) -- Used for FMP/BC Facades. May be hooked by other units.
* * registerDecorativeBlock (Int[] - bID & meta OR tuple(bID, meta)) -- Used for FMP/BC Facades. May be hooked by other units.
* * movableTile (String (full class path)) -- Used for AE SpatialIO. May be hooked by other units.
*
* @author Sunstrike <[email protected]>
*/
@@ -0,0 +1,21 @@
package mantle.router.routing.builtin
import mantle.router.routing.{MantleMessage, IPipelineUnit}
import mantle.router.lib.RouterRepo._
import cpw.mods.fml.common.event.FMLInterModComms
/**
* Applied Energistics pipeline unit
*
* @author Sunstrike <[email protected]>
*/
object UnitAppEng extends IPipelineUnit {
def unitName: String = "AppEng Compat"
def handleMessage(msg: MantleMessage) = msg.getAttachment match {
case s:String => FMLInterModComms.sendMessage("AppliedEnergistics", "movabletile", s)
case _ => logger.warning(s"Received invalid movableTile message: $msg")
}
}