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
5db73d28
Unverified
Commit
5db73d28
authored
Aug 23, 2022
by
omg-xtao
Committed by
GitHub
Aug 23, 2022
Browse files
Fix QuestEncryptionKeys Path (#1696)
* Fix QuestEncryptionKeys Path * Load resources QuestEncryptionKeys
parent
1dd84d69
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/data/DataLoader.java
View file @
5db73d28
...
...
@@ -112,7 +112,7 @@ public class DataLoader {
if
(!
Utils
.
fileExists
(
filePath
))
{
// Check if file is in subdirectory
if
(
name
.
indexOf
(
"/"
)
!=
-
1
)
{
if
(
name
.
contains
(
"/"
)
)
{
String
[]
path
=
name
.
split
(
"/"
);
String
folder
=
""
;
...
...
src/main/java/emu/grasscutter/data/ResourceLoader.java
View file @
5db73d28
...
...
@@ -413,13 +413,18 @@ public class ResourceLoader {
}
try
{
List
<
QuestEncryptionKey
>
keys
=
DataLoader
.
loadList
(
"QuestEncryptionKeys.json"
,
QuestEncryptionKey
.
class
);
List
<
QuestEncryptionKey
>
keys
;
Int2ObjectMap
<
QuestEncryptionKey
>
questEncryptionMap
=
GameData
.
getMainQuestEncryptionMap
();
keys
.
forEach
(
key
->
questEncryptionMap
.
put
(
key
.
getMainQuestId
(),
key
));
String
path
=
"QuestEncryptionKeys.json"
;
if
(
Utils
.
fileExists
(
RESOURCE
(
path
)))
{
keys
=
JsonUtils
.
loadToList
(
RESOURCE
(
path
),
QuestEncryptionKey
.
class
);
keys
.
forEach
(
key
->
questEncryptionMap
.
put
(
key
.
getMainQuestId
(),
key
));
}
if
(
Utils
.
fileExists
(
DATA
(
path
)))
{
keys
=
DataLoader
.
loadList
(
path
,
QuestEncryptionKey
.
class
);
keys
.
forEach
(
key
->
questEncryptionMap
.
put
(
key
.
getMainQuestId
(),
key
));
}
Grasscutter
.
getLogger
().
debug
(
"Loaded {} quest keys."
,
questEncryptionMap
.
size
());
}
catch
(
FileNotFoundException
|
NullPointerException
ignored
)
{
Grasscutter
.
getLogger
().
warn
(
"Unable to load quest keys - ./resources/QuestEncryptionKeys.json not found."
);
}
catch
(
Exception
e
)
{
Grasscutter
.
getLogger
().
error
(
"Unable to load quest keys."
,
e
);
}
...
...
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