Exemplo n.º 1
0
        """
        self.turtlespeed = turtlespeed

    def _drawTurtle(self, x, y, z):
        # draw turtle
        self.mcDrawing.drawPoint3d(x, y, z, self.turtleblock.id, self.turtleblock.data)
        lastDrawnTurtle = minecraft.Vec3(x, y, z)

    def _clearTurtle(self, x, y, z):
        # clear turtle
        self.mcDrawing.drawPoint3d(x, y, z, block.AIR.id)

    def _findTargetBlock(self, turtleX, turtleY, turtleZ, heading, verticalheading, distance):
        x, y, z = self._findPointOnSphere(turtleX, turtleY, turtleZ, heading, verticalheading, distance)
        x = int(round(x, 0))
        y = int(round(y, 0))
        z = int(round(z, 0))
        return x, y, z

    def _findPointOnSphere(self, cx, cy, cz, horizontalAngle, verticalAngle, radius):
        x = cx + (radius * (math.cos(math.radians(verticalAngle)) * math.cos(math.radians(horizontalAngle))))
        y = cy + (radius * (math.sin(math.radians(verticalAngle))))
        z = cz + (radius * (math.cos(math.radians(verticalAngle)) * math.sin(math.radians(horizontalAngle))))
        return x, y, z

    def _roundXYZ(x, y, z):
        return int(round(x, 0)), int(round(y, 0)), int(round(z, 0))

    def _roundVec3(position):
return minecraft.vec3(int(position.x), int(position.y), int(position.z))
Exemplo n.º 2
0
 def _roundVec3(position):
     return minecraft.vec3(int(position.x), int(position.y), int(position.z))
 def _roundVec3(position):
     return minecraft.vec3(int(position.x), int(position.y), int(position.z))