Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
f86b4bec
Commit
f86b4bec
authored
Jun 26, 2022
by
KingRainbow44
Browse files
Reformat
parent
269149bb
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/utils/Utils.java
View file @
f86b4bec
...
...
@@ -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
e
xception
)
{
Grasscutter
.
getLogger
().
warn
(
"Unable to copy resource "
+
resource
+
" to "
+
destination
,
e
xception
);
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
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment