mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-18 19:56:17 -04:00
Merge branch 'OC1.3-MC1.7.10' of github.com:MightyPirates/OpenComputers into master-MC1.7.10
This commit is contained in:
commit
080b400901
@ -67,6 +67,8 @@ class Player(val robot: tileentity.Robot) extends FakePlayer(robot.world.asInsta
|
|||||||
|
|
||||||
override def getDisplayName = robot.name
|
override def getDisplayName = robot.name
|
||||||
|
|
||||||
|
theItemInWorldManager.setBlockReachDistance(1)
|
||||||
|
|
||||||
// ----------------------------------------------------------------------- //
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
def updatePositionAndRotation(facing: ForgeDirection, side: ForgeDirection) {
|
def updatePositionAndRotation(facing: ForgeDirection, side: ForgeDirection) {
|
||||||
@ -74,9 +76,9 @@ class Player(val robot: tileentity.Robot) extends FakePlayer(robot.world.asInsta
|
|||||||
this.side = side
|
this.side = side
|
||||||
// Slightly offset in robot's facing to avoid glitches (e.g. Portal Gun).
|
// Slightly offset in robot's facing to avoid glitches (e.g. Portal Gun).
|
||||||
val direction = Vec3.createVectorHelper(
|
val direction = Vec3.createVectorHelper(
|
||||||
facing.offsetX + side.offsetX * 0.5 + robot.facing.offsetX * 0.01,
|
facing.offsetX + side.offsetX + robot.facing.offsetX * 0.01,
|
||||||
facing.offsetY + side.offsetY * 0.5 + robot.facing.offsetY * 0.01,
|
facing.offsetY + side.offsetY + robot.facing.offsetY * 0.01,
|
||||||
facing.offsetZ + side.offsetZ * 0.5 + robot.facing.offsetZ * 0.01).normalize()
|
facing.offsetZ + side.offsetZ + robot.facing.offsetZ * 0.01).normalize()
|
||||||
val yaw = Math.toDegrees(-Math.atan2(direction.xCoord, direction.zCoord)).toFloat
|
val yaw = Math.toDegrees(-Math.atan2(direction.xCoord, direction.zCoord)).toFloat
|
||||||
val pitch = Math.toDegrees(-Math.atan2(direction.yCoord, Math.sqrt((direction.xCoord * direction.xCoord) + (direction.zCoord * direction.zCoord)))).toFloat * 0.99f
|
val pitch = Math.toDegrees(-Math.atan2(direction.yCoord, Math.sqrt((direction.xCoord * direction.xCoord) + (direction.zCoord * direction.zCoord)))).toFloat * 0.99f
|
||||||
setLocationAndAngles(robot.x + 0.5, robot.y, robot.z + 0.5, yaw, pitch)
|
setLocationAndAngles(robot.x + 0.5, robot.y, robot.z + 0.5, yaw, pitch)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user