mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-25 09:02:59 +08: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);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
Grasscutter.getLogger().warn("Unable to copy resource " + resource + " to " + destination, e);
|
||||
} catch (Exception exception) {
|
||||
Grasscutter.getLogger().warn("Unable to copy resource " + resource + " to " + destination, exception);
|
||||
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.
|
||||
* @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.
|
||||
* @param x
|
||||
* @param x The x value.
|
||||
* @param xyArray Array of points in [[x0,y0], ... [xN, yN]] format
|
||||
* @return f(x) = y
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user