mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 11:15:12 -04:00
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:
commit
ca5fa481fe
@ -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) = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user