@Callback( doc = "function(x:number,y:number,z:number,facing:number):nill -- Sets The golems home position") @Optional.Method(modid = "OpenComputers") public Object[] setHome(Context context, Arguments args) throws Exception { return setHomeImplementation( args.checkDouble(0), args.checkDouble(1), args.checkDouble(2), args.checkDouble(3)); }
@Callback(direct = true, limit = CALL_LIMIT) public Object[] setRayDirection(Context context, Arguments args) { camera.reset(); float x = args.count() == 2 ? (float) args.checkDouble(0) : 0.0F; float y = args.count() == 2 ? (float) args.checkDouble(1) : 0.0F; if (args.count() == 2) { int l = MathHelper.floor_double((double) (robot.player().rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; l = Direction.directionToFacing[l]; return new Object[] { camera.setRayDirection( entity.getWorldObj(), entity.xCoord, entity.yCoord, entity.zCoord, ForgeDirection.getOrientation(l), (float) args.checkDouble(0), (float) args.checkDouble(1)) }; } return null; }
@Callback(direct = true, limit = CALL_LIMIT) public Object[] distanceDown(Context context, Arguments args) { camera.reset(); if (args.count() == 2) { camera.setRayDirection( entity.getWorldObj(), entity.xCoord, entity.yCoord, entity.zCoord, ForgeDirection.DOWN, (float) args.checkDouble(0), (float) args.checkDouble(1)); } else { camera.setRayDirection( entity.getWorldObj(), entity.xCoord, entity.yCoord, entity.zCoord, ForgeDirection.DOWN, 0.0F, 0.0F); } return new Object[] {camera.getDistance()}; }