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
dffffc8d
Commit
dffffc8d
authored
Apr 22, 2022
by
Melledy
Browse files
Merge branch 'stable' into development
parents
5100729a
ca6315f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/tools/Tools.java
View file @
dffffc8d
package
emu.grasscutter.tools
;
import
java.io.FileInputStream
;
import
java.io.FileOutputStream
;
import
java.io.FileReader
;
import
java.io.FileWriter
;
import
java.io.InputStreamReader
;
import
java.io.OutputStreamWriter
;
import
java.io.PrintWriter
;
import
java.nio.charset.StandardCharsets
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
...
...
@@ -30,13 +35,13 @@ public final class Tools {
ResourceLoader
.
loadResources
();
Map
<
Long
,
String
>
map
;
try
(
File
Reader
fileReader
=
new
FileReader
(
Utils
.
toFilePath
(
Grasscutter
.
getConfig
().
RESOURCE_FOLDER
+
"TextMap/TextMapEN.json"
)))
{
try
(
InputStream
Reader
fileReader
=
new
InputStreamReader
(
new
FileInputStream
(
Utils
.
toFilePath
(
Grasscutter
.
getConfig
().
RESOURCE_FOLDER
+
"TextMap/TextMapEN.json"
))
,
StandardCharsets
.
UTF_8
)
)
{
map
=
Grasscutter
.
getGsonFactory
().
fromJson
(
fileReader
,
new
TypeToken
<
Map
<
Long
,
String
>>()
{}.
getType
());
}
List
<
Integer
>
list
;
String
fileName
=
"./GM Handbook.txt"
;
try
(
File
Writer
fileW
riter
=
new
File
Writer
(
fileName
);
PrintWriter
w
riter
=
new
PrintWriter
(
fileWriter
))
{
try
(
Print
Writer
w
riter
=
new
Print
Writer
(
new
OutputStreamW
riter
(
new
FileOutputStream
(
fileName
),
StandardCharsets
.
UTF_8
),
false
))
{
DateTimeFormatter
dtf
=
DateTimeFormatter
.
ofPattern
(
"yyyy/MM/dd HH:mm:ss"
);
LocalDateTime
now
=
LocalDateTime
.
now
();
...
...
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