mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-25 14:05:39 -04:00
Merge pull request #42 from repo-alt/master
GT blocks facing and sensor information added to geolyzer.analyze
This commit is contained in:
commit
eb86eba881
@ -2,11 +2,24 @@ package li.cil.oc.integration.gregtech
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent
|
||||
import gregtech.api.interfaces.IDamagableItem
|
||||
import gregtech.api.interfaces.tileentity.IGregTechTileEntity
|
||||
import gregtech.api.items.GT_MetaGenerated_Tool
|
||||
import li.cil.oc.api.event.RobotUsedToolEvent
|
||||
import li.cil.oc.api.event.{GeolyzerEvent, RobotUsedToolEvent}
|
||||
import net.minecraft.item.ItemStack
|
||||
import net.minecraftforge.common.util.ForgeDirection
|
||||
import scala.collection.convert.WrapAsScala._
|
||||
|
||||
object EventHandlerGregTech {
|
||||
@SubscribeEvent
|
||||
def onGeolyzerAnalyze(e: GeolyzerEvent.Analyze) {
|
||||
val world = e.host.world
|
||||
world.getTileEntity(e.x, e.y, e.z) match {
|
||||
case tile : IGregTechTileEntity =>
|
||||
e.data += "facing" -> ForgeDirection.getOrientation(tile.getFrontFacing).name()
|
||||
e.data += "sensorInformation" -> tile.getInfoData()
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
def onRobotApplyDamageRate(e: RobotUsedToolEvent.ApplyDamageRate) {
|
||||
(e.toolBeforeUse.getItem, e.toolAfterUse.getItem) match {
|
||||
|
Loading…
x
Reference in New Issue
Block a user