mirror of
https://github.com/Melledy/Grasscutter.git
synced 2025-02-05 10:18:51 +00:00
Reformat
This commit is contained in:
parent
269149bb1f
commit
f86b4bec11
@ -146,22 +146,12 @@ public final class Utils {
|
|||||||
|
|
||||||
Files.copy(stream, new File(destination).toPath(), StandardCopyOption.REPLACE_EXISTING);
|
Files.copy(stream, new File(destination).toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||||
return true;
|
return true;
|
||||||
} catch (Exception e) {
|
} catch (Exception exception) {
|
||||||
Grasscutter.getLogger().warn("Unable to copy resource " + resource + " to " + destination, e);
|
Grasscutter.getLogger().warn("Unable to copy resource " + resource + " to " + destination, exception);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get object with null fallback.
|
|
||||||
* @param nonNull The object to return if not null.
|
|
||||||
* @param fallback The object to return if null.
|
|
||||||
* @return One of the two provided objects.
|
|
||||||
*/
|
|
||||||
public static <T> T requireNonNullElseGet(T nonNull, T fallback) {
|
|
||||||
return nonNull != null ? nonNull : fallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs an object to the console.
|
* Logs an object to the console.
|
||||||
* @param object The object to log.
|
* @param object The object to log.
|
||||||
@ -276,7 +266,7 @@ public final class Utils {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs a linear interpolation using a table of fixed points to create an effective piecewise f(x) = y function.
|
* Performs a linear interpolation using a table of fixed points to create an effective piecewise f(x) = y function.
|
||||||
* @param x
|
* @param x The x value.
|
||||||
* @param xyArray Array of points in [[x0,y0], ... [xN, yN]] format
|
* @param xyArray Array of points in [[x0,y0], ... [xN, yN]] format
|
||||||
* @return f(x) = y
|
* @return f(x) = y
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user