Merge branch 'master-MC1.7.10' of github.com:MightyPirates/OpenComputers into master-MC1.8.9

# Conflicts:
#	src/main/scala/li/cil/oc/server/component/traits/WorldAware.scala
This commit is contained in:
Florian Nücke 2016-07-24 20:10:40 +02:00
commit ca5fa481fe

View File

@ -1,5 +1,6 @@
package li.cil.oc.server.component.traits package li.cil.oc.server.component.traits
import li.cil.oc.OpenComputers
import li.cil.oc.Settings import li.cil.oc.Settings
import li.cil.oc.util.BlockPosition import li.cil.oc.util.BlockPosition
import li.cil.oc.util.ExtendedBlock._ import li.cil.oc.util.ExtendedBlock._
@ -33,8 +34,14 @@ trait WorldAware {
} }
def mayInteract(blockPos: BlockPosition, face: EnumFacing): Boolean = { def mayInteract(blockPos: BlockPosition, face: EnumFacing): Boolean = {
val event = ForgeEventFactory.onPlayerInteract(fakePlayer, Action.RIGHT_CLICK_BLOCK, world, blockPos.toBlockPos, face) try {
!event.isCanceled && event.useBlock != Result.DENY val event = ForgeEventFactory.onPlayerInteract(fakePlayer, Action.RIGHT_CLICK_BLOCK, world, blockPos.toBlockPos, face)
!event.isCanceled && event.useBlock != Result.DENY
} catch {
case t: Throwable =>
OpenComputers.log.warn("Some event handler threw up while checking for permission to access a block.", t)
true
}
} }
def entitiesInBounds[Type <: Entity](clazz: Class[Type], bounds: AxisAlignedBB) = { def entitiesInBounds[Type <: Entity](clazz: Class[Type], bounds: AxisAlignedBB) = {