Merge branch master-MC1.10 into master-MC1.11

This commit is contained in:
payonel 2017-12-10 03:53:14 -08:00
commit c0eefc152e

View File

@ -102,18 +102,15 @@ class MotionSensor(val host: EnvironmentHost) extends prefab.AbstractManagedEnvi
// is pseudo-infrared driven (it only works for *living* entities, after
// all), so I think it makes more sense for it to work in the dark, too.
/* entity.getBrightness(0) > 0.2 && */ {
var ox = x + 0.5
var oy = y + 0.5
var oz = z + 0.5
var origin = new Vec3d(x, y, z)
val target = new Vec3d(entity.posX, entity.posY, entity.posZ)
// Start trace outside of this block.
if (entity.posX < x) ox -= 0.75
if (entity.posX > x + 1) ox += 0.75
if (entity.posY < y) oy -= 0.75
if (entity.posY > y + 1) oy += 0.75
if (entity.posZ < z) oz -= 0.75
if (entity.posZ > z + 1) oz += 0.75
world.rayTraceBlocks(new Vec3d(ox, oy, oz), target) == null
val path = origin.subtract(target).normalize()
origin = origin.addVector(
path.xCoord * 0.75,
path.yCoord * 0.75,
path.zCoord * 0.75
)
world.rayTraceBlocks(origin, target) == null
}
private def sendSignal(entity: EntityLivingBase) {