Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Grasscutter
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
ziqian zhang
Grasscutter
Commits
f86b4bec
Commit
f86b4bec
authored
3 years ago
by
KingRainbow44
Browse files
Options
Downloads
Patches
Plain Diff
Reformat
parent
269149bb
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/emu/grasscutter/utils/Utils.java
+17
-27
17 additions, 27 deletions
src/main/java/emu/grasscutter/utils/Utils.java
with
17 additions
and
27 deletions
src/main/java/emu/grasscutter/utils/Utils.java
+
17
−
27
View file @
f86b4bec
...
@@ -146,22 +146,12 @@ public final class Utils {
...
@@ -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
e
xception
)
{
Grasscutter
.
getLogger
().
warn
(
"Unable to copy resource "
+
resource
+
" to "
+
destination
,
e
);
Grasscutter
.
getLogger
().
warn
(
"Unable to copy resource "
+
resource
+
" to "
+
destination
,
e
xception
);
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 {
...
@@ -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
*/
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment