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
d32f706c
Commit
d32f706c
authored
Apr 27, 2022
by
KingRainbow44
Browse files
Merge branch 'development' into api
# Conflicts: # src/main/java/emu/grasscutter/plugin/api/ServerHook.java
parents
47d8fd3c
f0d728b4
Changes
308
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/command/commands/TalentCommand.java
View file @
d32f706c
...
@@ -3,9 +3,9 @@ package emu.grasscutter.command.commands;
...
@@ -3,9 +3,9 @@ package emu.grasscutter.command.commands;
import
emu.grasscutter.command.Command
;
import
emu.grasscutter.command.Command
;
import
emu.grasscutter.command.CommandHandler
;
import
emu.grasscutter.command.CommandHandler
;
import
emu.grasscutter.data.def.AvatarSkillDepotData
;
import
emu.grasscutter.data.def.AvatarSkillDepotData
;
import
emu.grasscutter.game.GenshinPlayer
;
import
emu.grasscutter.game.avatar.Avatar
;
import
emu.grasscutter.game.avatar.GenshinAvatar
;
import
emu.grasscutter.game.entity.EntityAvatar
;
import
emu.grasscutter.game.entity.EntityAvatar
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.server.packet.send.PacketAvatarSkillChangeNotify
;
import
emu.grasscutter.server.packet.send.PacketAvatarSkillChangeNotify
;
import
emu.grasscutter.server.packet.send.PacketAvatarSkillUpgradeRsp
;
import
emu.grasscutter.server.packet.send.PacketAvatarSkillUpgradeRsp
;
...
@@ -16,7 +16,7 @@ import java.util.List;
...
@@ -16,7 +16,7 @@ import java.util.List;
public
final
class
TalentCommand
implements
CommandHandler
{
public
final
class
TalentCommand
implements
CommandHandler
{
@Override
@Override
public
void
execute
(
Genshin
Player
sender
,
List
<
String
>
args
)
{
public
void
execute
(
Player
sender
,
List
<
String
>
args
)
{
if
(
sender
==
null
)
{
if
(
sender
==
null
)
{
CommandHandler
.
sendMessage
(
null
,
"Run this command in-game."
);
CommandHandler
.
sendMessage
(
null
,
"Run this command in-game."
);
return
;
return
;
...
@@ -41,7 +41,7 @@ public final class TalentCommand implements CommandHandler {
...
@@ -41,7 +41,7 @@ public final class TalentCommand implements CommandHandler {
int
skillId
=
Integer
.
parseInt
(
args
.
get
(
1
));
int
skillId
=
Integer
.
parseInt
(
args
.
get
(
1
));
int
nextLevel
=
Integer
.
parseInt
(
args
.
get
(
2
));
int
nextLevel
=
Integer
.
parseInt
(
args
.
get
(
2
));
EntityAvatar
entity
=
sender
.
getTeamManager
().
getCurrentAvatarEntity
();
EntityAvatar
entity
=
sender
.
getTeamManager
().
getCurrentAvatarEntity
();
Genshin
Avatar
avatar
=
entity
.
getAvatar
();
Avatar
avatar
=
entity
.
getAvatar
();
int
skillIdNorAtk
=
avatar
.
getData
().
getSkillDepot
().
getSkills
().
get
(
0
);
int
skillIdNorAtk
=
avatar
.
getData
().
getSkillDepot
().
getSkills
().
get
(
0
);
int
skillIdE
=
avatar
.
getData
().
getSkillDepot
().
getSkills
().
get
(
1
);
int
skillIdE
=
avatar
.
getData
().
getSkillDepot
().
getSkills
().
get
(
1
);
int
skillIdQ
=
avatar
.
getData
().
getSkillDepot
().
getEnergySkill
();
int
skillIdQ
=
avatar
.
getData
().
getSkillDepot
().
getEnergySkill
();
...
@@ -97,7 +97,7 @@ public final class TalentCommand implements CommandHandler {
...
@@ -97,7 +97,7 @@ public final class TalentCommand implements CommandHandler {
case
"n"
:
case
"e"
:
case
"q"
:
case
"n"
:
case
"e"
:
case
"q"
:
try
{
try
{
EntityAvatar
entity
=
sender
.
getTeamManager
().
getCurrentAvatarEntity
();
EntityAvatar
entity
=
sender
.
getTeamManager
().
getCurrentAvatarEntity
();
Genshin
Avatar
avatar
=
entity
.
getAvatar
();
Avatar
avatar
=
entity
.
getAvatar
();
AvatarSkillDepotData
SkillDepot
=
avatar
.
getData
().
getSkillDepot
();
AvatarSkillDepotData
SkillDepot
=
avatar
.
getData
().
getSkillDepot
();
int
skillId
;
int
skillId
;
switch
(
cmdSwitch
)
{
switch
(
cmdSwitch
)
{
...
@@ -135,7 +135,7 @@ public final class TalentCommand implements CommandHandler {
...
@@ -135,7 +135,7 @@ public final class TalentCommand implements CommandHandler {
break
;
break
;
case
"getid"
:
case
"getid"
:
EntityAvatar
entity
=
sender
.
getTeamManager
().
getCurrentAvatarEntity
();
EntityAvatar
entity
=
sender
.
getTeamManager
().
getCurrentAvatarEntity
();
Genshin
Avatar
avatar
=
entity
.
getAvatar
();
Avatar
avatar
=
entity
.
getAvatar
();
int
skillIdNorAtk
=
avatar
.
getData
().
getSkillDepot
().
getSkills
().
get
(
0
);
int
skillIdNorAtk
=
avatar
.
getData
().
getSkillDepot
().
getSkills
().
get
(
0
);
int
skillIdE
=
avatar
.
getData
().
getSkillDepot
().
getSkills
().
get
(
1
);
int
skillIdE
=
avatar
.
getData
().
getSkillDepot
().
getSkills
().
get
(
1
);
int
skillIdQ
=
avatar
.
getData
().
getSkillDepot
().
getEnergySkill
();
int
skillIdQ
=
avatar
.
getData
().
getSkillDepot
().
getEnergySkill
();
...
...
src/main/java/emu/grasscutter/command/commands/TeleportCommand.java
View file @
d32f706c
...
@@ -2,7 +2,7 @@ package emu.grasscutter.command.commands;
...
@@ -2,7 +2,7 @@ package emu.grasscutter.command.commands;
import
emu.grasscutter.command.Command
;
import
emu.grasscutter.command.Command
;
import
emu.grasscutter.command.CommandHandler
;
import
emu.grasscutter.command.CommandHandler
;
import
emu.grasscutter.game.
Genshin
Player
;
import
emu.grasscutter.game.
player.
Player
;
import
emu.grasscutter.utils.Position
;
import
emu.grasscutter.utils.Position
;
import
java.util.List
;
import
java.util.List
;
...
@@ -12,7 +12,7 @@ import java.util.List;
...
@@ -12,7 +12,7 @@ import java.util.List;
public
final
class
TeleportCommand
implements
CommandHandler
{
public
final
class
TeleportCommand
implements
CommandHandler
{
@Override
@Override
public
void
execute
(
Genshin
Player
sender
,
List
<
String
>
args
)
{
public
void
execute
(
Player
sender
,
List
<
String
>
args
)
{
if
(
sender
==
null
)
{
if
(
sender
==
null
)
{
CommandHandler
.
sendMessage
(
null
,
"Run this command in-game."
);
CommandHandler
.
sendMessage
(
null
,
"Run this command in-game."
);
return
;
return
;
...
...
src/main/java/emu/grasscutter/command/commands/WeatherCommand.java
View file @
d32f706c
...
@@ -2,7 +2,7 @@ package emu.grasscutter.command.commands;
...
@@ -2,7 +2,7 @@ package emu.grasscutter.command.commands;
import
emu.grasscutter.command.Command
;
import
emu.grasscutter.command.Command
;
import
emu.grasscutter.command.CommandHandler
;
import
emu.grasscutter.command.CommandHandler
;
import
emu.grasscutter.game.
Genshin
Player
;
import
emu.grasscutter.game.
player.
Player
;
import
emu.grasscutter.game.props.ClimateType
;
import
emu.grasscutter.game.props.ClimateType
;
import
emu.grasscutter.server.packet.send.PacketSceneAreaWeatherNotify
;
import
emu.grasscutter.server.packet.send.PacketSceneAreaWeatherNotify
;
...
@@ -13,7 +13,7 @@ import java.util.List;
...
@@ -13,7 +13,7 @@ import java.util.List;
public
final
class
WeatherCommand
implements
CommandHandler
{
public
final
class
WeatherCommand
implements
CommandHandler
{
@Override
@Override
public
void
execute
(
Genshin
Player
sender
,
List
<
String
>
args
)
{
public
void
execute
(
Player
sender
,
List
<
String
>
args
)
{
if
(
sender
==
null
)
{
if
(
sender
==
null
)
{
CommandHandler
.
sendMessage
(
null
,
"Run this command in-game."
);
CommandHandler
.
sendMessage
(
null
,
"Run this command in-game."
);
return
;
return
;
...
...
src/main/java/emu/grasscutter/data/G
enshin
Data.java
→
src/main/java/emu/grasscutter/data/G
ame
Data.java
View file @
d32f706c
...
@@ -16,7 +16,7 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap;
...
@@ -16,7 +16,7 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap;
import
it.unimi.dsi.fastutil.ints.Int2ObjectMap
;
import
it.unimi.dsi.fastutil.ints.Int2ObjectMap
;
import
it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap
;
import
it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap
;
public
class
G
enshin
Data
{
public
class
G
ame
Data
{
// BinOutputs
// BinOutputs
private
static
final
Int2ObjectMap
<
String
>
abilityHashes
=
new
Int2ObjectOpenHashMap
<>();
private
static
final
Int2ObjectMap
<
String
>
abilityHashes
=
new
Int2ObjectOpenHashMap
<>();
private
static
final
Map
<
String
,
AbilityEmbryoEntry
>
abilityEmbryos
=
new
HashMap
<>();
private
static
final
Map
<
String
,
AbilityEmbryoEntry
>
abilityEmbryos
=
new
HashMap
<>();
...
@@ -69,7 +69,7 @@ public class GenshinData {
...
@@ -69,7 +69,7 @@ public class GenshinData {
Int2ObjectMap
<?>
map
=
null
;
Int2ObjectMap
<?>
map
=
null
;
try
{
try
{
Field
field
=
G
enshin
Data
.
class
.
getDeclaredField
(
Utils
.
lowerCaseFirstChar
(
resourceDefinition
.
getSimpleName
())
+
"Map"
);
Field
field
=
G
ame
Data
.
class
.
getDeclaredField
(
Utils
.
lowerCaseFirstChar
(
resourceDefinition
.
getSimpleName
())
+
"Map"
);
field
.
setAccessible
(
true
);
field
.
setAccessible
(
true
);
map
=
(
Int2ObjectMap
<?>)
field
.
get
(
null
);
map
=
(
Int2ObjectMap
<?>)
field
.
get
(
null
);
...
...
src/main/java/emu/grasscutter/data/G
enshin
Depot.java
→
src/main/java/emu/grasscutter/data/G
ame
Depot.java
View file @
d32f706c
...
@@ -15,21 +15,21 @@ import emu.grasscutter.utils.WeightedList;
...
@@ -15,21 +15,21 @@ import emu.grasscutter.utils.WeightedList;
import
it.unimi.dsi.fastutil.ints.Int2ObjectMap
;
import
it.unimi.dsi.fastutil.ints.Int2ObjectMap
;
import
it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap
;
import
it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap
;
public
class
G
enshin
Depot
{
public
class
G
ame
Depot
{
private
static
Int2ObjectMap
<
WeightedList
<
ReliquaryMainPropData
>>
relicMainPropDepot
=
new
Int2ObjectOpenHashMap
<>();
private
static
Int2ObjectMap
<
WeightedList
<
ReliquaryMainPropData
>>
relicMainPropDepot
=
new
Int2ObjectOpenHashMap
<>();
private
static
Int2ObjectMap
<
List
<
ReliquaryAffixData
>>
relicAffixDepot
=
new
Int2ObjectOpenHashMap
<>();
private
static
Int2ObjectMap
<
List
<
ReliquaryAffixData
>>
relicAffixDepot
=
new
Int2ObjectOpenHashMap
<>();
private
static
Int2ObjectMap
<
SpatialIndex
<
SpawnGroupEntry
>>
spawnLists
=
new
Int2ObjectOpenHashMap
<>();
private
static
Int2ObjectMap
<
SpatialIndex
<
SpawnGroupEntry
>>
spawnLists
=
new
Int2ObjectOpenHashMap
<>();
public
static
void
load
()
{
public
static
void
load
()
{
for
(
ReliquaryMainPropData
data
:
G
enshin
Data
.
getReliquaryMainPropDataMap
().
values
())
{
for
(
ReliquaryMainPropData
data
:
G
ame
Data
.
getReliquaryMainPropDataMap
().
values
())
{
if
(
data
.
getWeight
()
<=
0
||
data
.
getPropDepotId
()
<=
0
)
{
if
(
data
.
getWeight
()
<=
0
||
data
.
getPropDepotId
()
<=
0
)
{
continue
;
continue
;
}
}
WeightedList
<
ReliquaryMainPropData
>
list
=
relicMainPropDepot
.
computeIfAbsent
(
data
.
getPropDepotId
(),
k
->
new
WeightedList
<>());
WeightedList
<
ReliquaryMainPropData
>
list
=
relicMainPropDepot
.
computeIfAbsent
(
data
.
getPropDepotId
(),
k
->
new
WeightedList
<>());
list
.
add
(
data
.
getWeight
(),
data
);
list
.
add
(
data
.
getWeight
(),
data
);
}
}
for
(
ReliquaryAffixData
data
:
G
enshin
Data
.
getReliquaryAffixDataMap
().
values
())
{
for
(
ReliquaryAffixData
data
:
G
ame
Data
.
getReliquaryAffixDataMap
().
values
())
{
if
(
data
.
getWeight
()
<=
0
||
data
.
getDepotId
()
<=
0
)
{
if
(
data
.
getWeight
()
<=
0
||
data
.
getDepotId
()
<=
0
)
{
continue
;
continue
;
}
}
...
...
src/main/java/emu/grasscutter/data/G
enshin
Resource.java
→
src/main/java/emu/grasscutter/data/G
ame
Resource.java
View file @
d32f706c
package
emu.grasscutter.data
;
package
emu.grasscutter.data
;
public
abstract
class
G
enshin
Resource
{
public
abstract
class
G
ame
Resource
{
public
int
getId
()
{
public
int
getId
()
{
return
0
;
return
0
;
...
...
src/main/java/emu/grasscutter/data/ResourceLoader.java
View file @
d32f706c
...
@@ -27,7 +27,7 @@ public class ResourceLoader {
...
@@ -27,7 +27,7 @@ public class ResourceLoader {
public
static
List
<
Class
<?>>
getResourceDefClasses
()
{
public
static
List
<
Class
<?>>
getResourceDefClasses
()
{
Reflections
reflections
=
new
Reflections
(
ResourceLoader
.
class
.
getPackage
().
getName
());
Reflections
reflections
=
new
Reflections
(
ResourceLoader
.
class
.
getPackage
().
getName
());
Set
<?>
classes
=
reflections
.
getSubTypesOf
(
G
enshin
Resource
.
class
);
Set
<?>
classes
=
reflections
.
getSubTypesOf
(
G
ame
Resource
.
class
);
List
<
Class
<?>>
classList
=
new
ArrayList
<>(
classes
.
size
());
List
<
Class
<?>>
classList
=
new
ArrayList
<>(
classes
.
size
());
classes
.
forEach
(
o
->
{
classes
.
forEach
(
o
->
{
...
@@ -50,12 +50,12 @@ public class ResourceLoader {
...
@@ -50,12 +50,12 @@ public class ResourceLoader {
loadResources
();
loadResources
();
loadScenePoints
();
loadScenePoints
();
// Process into depots
// Process into depots
G
enshin
Depot
.
load
();
G
ame
Depot
.
load
();
// Load spawn data
// Load spawn data
loadSpawnData
();
loadSpawnData
();
// Custom - TODO move this somewhere else
// Custom - TODO move this somewhere else
try
{
try
{
G
enshin
Data
.
getAvatarSkillDepotDataMap
().
get
(
504
).
setAbilities
(
G
ame
Data
.
getAvatarSkillDepotDataMap
().
get
(
504
).
setAbilities
(
new
AbilityEmbryoEntry
(
new
AbilityEmbryoEntry
(
""
,
""
,
new
String
[]
{
new
String
[]
{
...
@@ -68,7 +68,7 @@ public class ResourceLoader {
...
@@ -68,7 +68,7 @@ public class ResourceLoader {
"Avatar_Player_WindBreathe_CameraController"
"Avatar_Player_WindBreathe_CameraController"
}
}
));
));
G
enshin
Data
.
getAvatarSkillDepotDataMap
().
get
(
704
).
setAbilities
(
G
ame
Data
.
getAvatarSkillDepotDataMap
().
get
(
704
).
setAbilities
(
new
AbilityEmbryoEntry
(
new
AbilityEmbryoEntry
(
""
,
""
,
new
String
[]
{
new
String
[]
{
...
@@ -95,7 +95,7 @@ public class ResourceLoader {
...
@@ -95,7 +95,7 @@ public class ResourceLoader {
}
}
@SuppressWarnings
(
"rawtypes"
)
@SuppressWarnings
(
"rawtypes"
)
Int2ObjectMap
map
=
G
enshin
Data
.
getMapByResourceDef
(
resourceDefinition
);
Int2ObjectMap
map
=
G
ame
Data
.
getMapByResourceDef
(
resourceDefinition
);
if
(
map
==
null
)
{
if
(
map
==
null
)
{
continue
;
continue
;
...
@@ -123,7 +123,7 @@ public class ResourceLoader {
...
@@ -123,7 +123,7 @@ public class ResourceLoader {
List
list
=
Grasscutter
.
getGsonFactory
().
fromJson
(
fileReader
,
TypeToken
.
getParameterized
(
Collection
.
class
,
c
).
getType
());
List
list
=
Grasscutter
.
getGsonFactory
().
fromJson
(
fileReader
,
TypeToken
.
getParameterized
(
Collection
.
class
,
c
).
getType
());
for
(
Object
o
:
list
)
{
for
(
Object
o
:
list
)
{
G
enshin
Resource
res
=
(
G
enshin
Resource
)
o
;
G
ame
Resource
res
=
(
G
ame
Resource
)
o
;
res
.
onLoad
();
res
.
onLoad
();
map
.
put
(
res
.
getId
(),
res
);
map
.
put
(
res
.
getId
(),
res
);
}
}
...
@@ -140,7 +140,7 @@ public class ResourceLoader {
...
@@ -140,7 +140,7 @@ public class ResourceLoader {
}
}
List
<
ScenePointEntry
>
scenePointList
=
new
ArrayList
<>();
List
<
ScenePointEntry
>
scenePointList
=
new
ArrayList
<>();
for
(
File
file
:
folder
.
listFiles
())
{
for
(
File
file
:
Objects
.
requireNonNull
(
folder
.
listFiles
())
)
{
ScenePointConfig
config
=
null
;
ScenePointConfig
config
=
null
;
Integer
sceneId
=
null
;
Integer
sceneId
=
null
;
...
@@ -170,7 +170,7 @@ public class ResourceLoader {
...
@@ -170,7 +170,7 @@ public class ResourceLoader {
}
}
for
(
ScenePointEntry
entry
:
scenePointList
)
{
for
(
ScenePointEntry
entry
:
scenePointList
)
{
G
enshin
Data
.
getScenePointEntries
().
put
(
entry
.
getName
(),
entry
);
G
ame
Data
.
getScenePointEntries
().
put
(
entry
.
getName
(),
entry
);
}
}
}
}
}
}
...
@@ -190,7 +190,7 @@ public class ResourceLoader {
...
@@ -190,7 +190,7 @@ public class ResourceLoader {
}
else
{
}
else
{
// Load from BinOutput
// Load from BinOutput
Pattern
pattern
=
Pattern
.
compile
(
"(?<=ConfigAvatar_)(.*?)(?=.json)"
);
Pattern
pattern
=
Pattern
.
compile
(
"(?<=ConfigAvatar_)(.*?)(?=.json)"
);
embryoList
=
new
LinkedList
<>();
embryoList
=
new
LinkedList
<>();
File
folder
=
new
File
(
Utils
.
toFilePath
(
Grasscutter
.
getConfig
().
RESOURCE_FOLDER
+
"BinOutput/Avatar/"
));
File
folder
=
new
File
(
Utils
.
toFilePath
(
Grasscutter
.
getConfig
().
RESOURCE_FOLDER
+
"BinOutput/Avatar/"
));
File
[]
files
=
folder
.
listFiles
();
File
[]
files
=
folder
.
listFiles
();
...
@@ -198,29 +198,29 @@ public class ResourceLoader {
...
@@ -198,29 +198,29 @@ public class ResourceLoader {
Grasscutter
.
getLogger
().
error
(
"Error loading ability embryos: no files found in "
+
folder
.
getAbsolutePath
());
Grasscutter
.
getLogger
().
error
(
"Error loading ability embryos: no files found in "
+
folder
.
getAbsolutePath
());
return
;
return
;
}
}
for
(
File
file
:
files
)
{
for
(
File
file
:
files
)
{
AvatarConfig
config
;
AvatarConfig
config
;
String
avatarName
;
String
avatarName
;
Matcher
matcher
=
pattern
.
matcher
(
file
.
getName
());
Matcher
matcher
=
pattern
.
matcher
(
file
.
getName
());
if
(
matcher
.
find
())
{
if
(
matcher
.
find
())
{
avatarName
=
matcher
.
group
(
0
);
avatarName
=
matcher
.
group
(
0
);
}
else
{
}
else
{
continue
;
continue
;
}
}
try
(
FileReader
fileReader
=
new
FileReader
(
file
))
{
try
(
FileReader
fileReader
=
new
FileReader
(
file
))
{
config
=
Grasscutter
.
getGsonFactory
().
fromJson
(
fileReader
,
AvatarConfig
.
class
);
config
=
Grasscutter
.
getGsonFactory
().
fromJson
(
fileReader
,
AvatarConfig
.
class
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
continue
;
continue
;
}
}
if
(
config
.
abilities
==
null
)
{
if
(
config
.
abilities
==
null
)
{
continue
;
continue
;
}
}
int
s
=
config
.
abilities
.
size
();
int
s
=
config
.
abilities
.
size
();
AbilityEmbryoEntry
al
=
new
AbilityEmbryoEntry
(
avatarName
,
config
.
abilities
.
stream
().
map
(
Object:
:
toString
).
toArray
(
size
->
new
String
[
s
]));
AbilityEmbryoEntry
al
=
new
AbilityEmbryoEntry
(
avatarName
,
config
.
abilities
.
stream
().
map
(
Object:
:
toString
).
toArray
(
size
->
new
String
[
s
]));
embryoList
.
add
(
al
);
embryoList
.
add
(
al
);
...
@@ -233,7 +233,7 @@ public class ResourceLoader {
...
@@ -233,7 +233,7 @@ public class ResourceLoader {
}
}
for
(
AbilityEmbryoEntry
entry
:
embryoList
)
{
for
(
AbilityEmbryoEntry
entry
:
embryoList
)
{
G
enshin
Data
.
getAbilityEmbryoInfo
().
put
(
entry
.
getName
(),
entry
);
G
ame
Data
.
getAbilityEmbryoInfo
().
put
(
entry
.
getName
(),
entry
);
}
}
}
}
...
@@ -260,7 +260,7 @@ public class ResourceLoader {
...
@@ -260,7 +260,7 @@ public class ResourceLoader {
entry
.
getSpawns
().
stream
().
forEach
(
s
->
{
entry
.
getSpawns
().
stream
().
forEach
(
s
->
{
s
.
setGroup
(
entry
);
s
.
setGroup
(
entry
);
});
});
G
enshin
Depot
.
getSpawnListById
(
entry
.
getSceneId
()).
insert
(
entry
,
entry
.
getPos
().
getX
(),
entry
.
getPos
().
getZ
());
G
ame
Depot
.
getSpawnListById
(
entry
.
getSceneId
()).
insert
(
entry
,
entry
.
getPos
().
getX
(),
entry
.
getPos
().
getZ
());
}
}
}
}
...
@@ -328,10 +328,10 @@ public class ResourceLoader {
...
@@ -328,10 +328,10 @@ public class ResourceLoader {
}
}
for
(
OpenConfigEntry
entry
:
list
)
{
for
(
OpenConfigEntry
entry
:
list
)
{
G
enshin
Data
.
getOpenConfigEntries
().
put
(
entry
.
getName
(),
entry
);
G
ame
Data
.
getOpenConfigEntries
().
put
(
entry
.
getName
(),
entry
);
}
}
}
}
// BinOutput configs
// BinOutput configs
private
static
class
AvatarConfig
{
private
static
class
AvatarConfig
{
...
...
src/main/java/emu/grasscutter/data/def/AvatarCostumeData.java
View file @
d32f706c
package
emu.grasscutter.data.def
;
package
emu.grasscutter.data.def
;
import
emu.grasscutter.data.G
enshin
Data
;
import
emu.grasscutter.data.G
ame
Data
;
import
emu.grasscutter.data.G
enshin
Resource
;
import
emu.grasscutter.data.G
ame
Resource
;
import
emu.grasscutter.data.ResourceType
;
import
emu.grasscutter.data.ResourceType
;
@ResourceType
(
name
=
"AvatarCostumeExcelConfigData.json"
)
@ResourceType
(
name
=
"AvatarCostumeExcelConfigData.json"
)
public
class
AvatarCostumeData
extends
G
enshin
Resource
{
public
class
AvatarCostumeData
extends
G
ame
Resource
{
private
int
CostumeId
;
private
int
CostumeId
;
private
int
ItemId
;
private
int
ItemId
;
private
int
AvatarId
;
private
int
AvatarId
;
...
@@ -25,6 +25,6 @@ public class AvatarCostumeData extends GenshinResource {
...
@@ -25,6 +25,6 @@ public class AvatarCostumeData extends GenshinResource {
@Override
@Override
public
void
onLoad
()
{
public
void
onLoad
()
{
G
enshin
Data
.
getAvatarCostumeDataItemIdMap
().
put
(
this
.
getItemId
(),
this
);
G
ame
Data
.
getAvatarCostumeDataItemIdMap
().
put
(
this
.
getItemId
(),
this
);
}
}
}
}
src/main/java/emu/grasscutter/data/def/AvatarCurveData.java
View file @
d32f706c
...
@@ -4,12 +4,12 @@ import java.util.HashMap;
...
@@ -4,12 +4,12 @@ import java.util.HashMap;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
import
emu.grasscutter.data.G
enshin
Resource
;
import
emu.grasscutter.data.G
ame
Resource
;
import
emu.grasscutter.data.ResourceType
;
import
emu.grasscutter.data.ResourceType
;
import
emu.grasscutter.data.common.CurveInfo
;
import
emu.grasscutter.data.common.CurveInfo
;
@ResourceType
(
name
=
"AvatarCurveExcelConfigData.json"
)
@ResourceType
(
name
=
"AvatarCurveExcelConfigData.json"
)
public
class
AvatarCurveData
extends
G
enshin
Resource
{
public
class
AvatarCurveData
extends
G
ame
Resource
{
private
int
Level
;
private
int
Level
;
private
CurveInfo
[]
CurveInfos
;
private
CurveInfo
[]
CurveInfos
;
...
...
src/main/java/emu/grasscutter/data/def/AvatarData.java
View file @
d32f706c
...
@@ -2,8 +2,8 @@ package emu.grasscutter.data.def;
...
@@ -2,8 +2,8 @@ package emu.grasscutter.data.def;
import
java.util.List
;
import
java.util.List
;
import
emu.grasscutter.data.G
enshin
Data
;
import
emu.grasscutter.data.G
ame
Data
;
import
emu.grasscutter.data.G
enshin
Resource
;
import
emu.grasscutter.data.G
ame
Resource
;
import
emu.grasscutter.data.ResourceType
;
import
emu.grasscutter.data.ResourceType
;
import
emu.grasscutter.data.ResourceType.LoadPriority
;
import
emu.grasscutter.data.ResourceType.LoadPriority
;
import
emu.grasscutter.data.common.PropGrowCurve
;
import
emu.grasscutter.data.common.PropGrowCurve
;
...
@@ -15,7 +15,7 @@ import it.unimi.dsi.fastutil.ints.IntArrayList;
...
@@ -15,7 +15,7 @@ import it.unimi.dsi.fastutil.ints.IntArrayList;
import
it.unimi.dsi.fastutil.ints.IntList
;
import
it.unimi.dsi.fastutil.ints.IntList
;
@ResourceType
(
name
=
"AvatarExcelConfigData.json"
,
loadPriority
=
LoadPriority
.
LOW
)
@ResourceType
(
name
=
"AvatarExcelConfigData.json"
,
loadPriority
=
LoadPriority
.
LOW
)
public
class
AvatarData
extends
G
enshin
Resource
{
public
class
AvatarData
extends
G
ame
Resource
{
private
String
name
;
private
String
name
;
private
String
IconName
;
private
String
IconName
;
...
@@ -178,7 +178,7 @@ public class AvatarData extends GenshinResource {
...
@@ -178,7 +178,7 @@ public class AvatarData extends GenshinResource {
if
(
growCurve
==
null
)
{
if
(
growCurve
==
null
)
{
return
1
f
;
return
1
f
;
}
}
AvatarCurveData
curveData
=
G
enshin
Data
.
getAvatarCurveDataMap
().
get
(
level
);
AvatarCurveData
curveData
=
G
ame
Data
.
getAvatarCurveDataMap
().
get
(
level
);
if
(
curveData
==
null
)
{
if
(
curveData
==
null
)
{
return
1
f
;
return
1
f
;
}
}
...
@@ -211,24 +211,24 @@ public class AvatarData extends GenshinResource {
...
@@ -211,24 +211,24 @@ public class AvatarData extends GenshinResource {
@Override
@Override
public
void
onLoad
()
{
public
void
onLoad
()
{
this
.
skillDepot
=
G
enshin
Data
.
getAvatarSkillDepotDataMap
().
get
(
this
.
SkillDepotId
);
this
.
skillDepot
=
G
ame
Data
.
getAvatarSkillDepotDataMap
().
get
(
this
.
SkillDepotId
);
// Get fetters from G
enshin
Data
// Get fetters from G
ame
Data
this
.
fetters
=
G
enshin
Data
.
getFetterDataEntries
().
get
(
this
.
Id
);
this
.
fetters
=
G
ame
Data
.
getFetterDataEntries
().
get
(
this
.
Id
);
if
(
G
enshin
Data
.
getFetterCharacterCardDataMap
().
get
(
this
.
Id
)
!=
null
)
{
if
(
G
ame
Data
.
getFetterCharacterCardDataMap
().
get
(
this
.
Id
)
!=
null
)
{
this
.
nameCardRewardId
=
G
enshin
Data
.
getFetterCharacterCardDataMap
().
get
(
this
.
Id
).
getRewardId
();
this
.
nameCardRewardId
=
G
ame
Data
.
getFetterCharacterCardDataMap
().
get
(
this
.
Id
).
getRewardId
();
}
}
if
(
G
enshin
Data
.
getRewardDataMap
().
get
(
this
.
nameCardRewardId
)
!=
null
)
{
if
(
G
ame
Data
.
getRewardDataMap
().
get
(
this
.
nameCardRewardId
)
!=
null
)
{
this
.
nameCardId
=
G
enshin
Data
.
getRewardDataMap
().
get
(
this
.
nameCardRewardId
).
getRewardItemList
().
get
(
0
).
getItemId
();
this
.
nameCardId
=
G
ame
Data
.
getRewardDataMap
().
get
(
this
.
nameCardRewardId
).
getRewardItemList
().
get
(
0
).
getItemId
();
}
}
int
size
=
G
enshin
Data
.
getAvatarCurveDataMap
().
size
();
int
size
=
G
ame
Data
.
getAvatarCurveDataMap
().
size
();
this
.
hpGrowthCurve
=
new
float
[
size
];
this
.
hpGrowthCurve
=
new
float
[
size
];
this
.
attackGrowthCurve
=
new
float
[
size
];
this
.
attackGrowthCurve
=
new
float
[
size
];
this
.
defenseGrowthCurve
=
new
float
[
size
];
this
.
defenseGrowthCurve
=
new
float
[
size
];
for
(
AvatarCurveData
curveData
:
G
enshin
Data
.
getAvatarCurveDataMap
().
values
())
{
for
(
AvatarCurveData
curveData
:
G
ame
Data
.
getAvatarCurveDataMap
().
values
())
{
int
level
=
curveData
.
getLevel
()
-
1
;
int
level
=
curveData
.
getLevel
()
-
1
;
for
(
PropGrowCurve
growCurve
:
this
.
PropGrowCurves
)
{
for
(
PropGrowCurve
growCurve
:
this
.
PropGrowCurves
)
{
FightProperty
prop
=
FightProperty
.
getPropByName
(
growCurve
.
getType
());
FightProperty
prop
=
FightProperty
.
getPropByName
(
growCurve
.
getType
());
...
@@ -260,7 +260,7 @@ public class AvatarData extends GenshinResource {
...
@@ -260,7 +260,7 @@ public class AvatarData extends GenshinResource {
if
(
split
.
length
>
0
)
{
if
(
split
.
length
>
0
)
{
this
.
name
=
split
[
split
.
length
-
1
];
this
.
name
=
split
[
split
.
length
-
1
];
AbilityEmbryoEntry
info
=
G
enshin
Data
.
getAbilityEmbryoInfo
().
get
(
this
.
name
);
AbilityEmbryoEntry
info
=
G
ame
Data
.
getAbilityEmbryoInfo
().
get
(
this
.
name
);
if
(
info
!=
null
)
{
if
(
info
!=
null
)
{
this
.
abilities
=
new
IntArrayList
(
info
.
getAbilities
().
length
);
this
.
abilities
=
new
IntArrayList
(
info
.
getAbilities
().
length
);
for
(
String
ability
:
info
.
getAbilities
())
{
for
(
String
ability
:
info
.
getAbilities
())
{
...
...
src/main/java/emu/grasscutter/data/def/AvatarFetterLevelData.java
View file @
d32f706c
package
emu.grasscutter.data.def
;
package
emu.grasscutter.data.def
;
import
emu.grasscutter.data.G
enshin
Resource
;
import
emu.grasscutter.data.G
ame
Resource
;
import
emu.grasscutter.data.ResourceType
;
import
emu.grasscutter.data.ResourceType
;
@ResourceType
(
name
=
"AvatarFettersLevelExcelConfigData.json"
)
@ResourceType
(
name
=
"AvatarFettersLevelExcelConfigData.json"
)
public
class
AvatarFetterLevelData
extends
G
enshin
Resource
{
public
class
AvatarFetterLevelData
extends
G
ame
Resource
{
private
int
FetterLevel
;
private
int
FetterLevel
;
private
int
NeedExp
;
private
int
NeedExp
;
...
...
src/main/java/emu/grasscutter/data/def/AvatarFlycloakData.java
View file @
d32f706c
package
emu.grasscutter.data.def
;
package
emu.grasscutter.data.def
;
import
emu.grasscutter.data.G
enshin
Resource
;
import
emu.grasscutter.data.G
ame
Resource
;
import
emu.grasscutter.data.ResourceType
;
import
emu.grasscutter.data.ResourceType
;
@ResourceType
(
name
=
"AvatarFlycloakExcelConfigData.json"
)
@ResourceType
(
name
=
"AvatarFlycloakExcelConfigData.json"
)
public
class
AvatarFlycloakData
extends
G
enshin
Resource
{
public
class
AvatarFlycloakData
extends
G
ame
Resource
{
private
int
FlycloakId
;
private
int
FlycloakId
;
private
long
NameTextMapHash
;
private
long
NameTextMapHash
;
...
...
src/main/java/emu/grasscutter/data/def/AvatarLevelData.java
View file @
d32f706c
package
emu.grasscutter.data.def
;
package
emu.grasscutter.data.def
;
import
emu.grasscutter.data.G
enshin
Resource
;
import
emu.grasscutter.data.G
ame
Resource
;
import
emu.grasscutter.data.ResourceType
;
import
emu.grasscutter.data.ResourceType
;
@ResourceType
(
name
=
"AvatarLevelExcelConfigData.json"
)
@ResourceType
(
name
=
"AvatarLevelExcelConfigData.json"
)
public
class
AvatarLevelData
extends
G
enshin
Resource
{
public
class
AvatarLevelData
extends
G
ame
Resource
{
private
int
Level
;
private
int
Level
;
private
int
Exp
;
private
int
Exp
;
...
...
src/main/java/emu/grasscutter/data/def/AvatarPromoteData.java
View file @
d32f706c
package
emu.grasscutter.data.def
;
package
emu.grasscutter.data.def
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
emu.grasscutter.data.G
enshin
Resource
;
import
emu.grasscutter.data.G
ame
Resource
;
import
emu.grasscutter.data.ResourceType
;
import
emu.grasscutter.data.ResourceType
;
import
emu.grasscutter.data.common.FightPropData
;
import
emu.grasscutter.data.common.FightPropData
;
import
emu.grasscutter.data.common.ItemParamData
;
import
emu.grasscutter.data.common.ItemParamData
;
@ResourceType
(
name
=
"AvatarPromoteExcelConfigData.json"
)
@ResourceType
(
name
=
"AvatarPromoteExcelConfigData.json"
)
public
class
AvatarPromoteData
extends
G
enshin
Resource
{
public
class
AvatarPromoteData
extends
G
ame
Resource
{
private
int
AvatarPromoteId
;
private
int
AvatarPromoteId
;
private
int
PromoteLevel
;
private
int
PromoteLevel
;
...
...
src/main/java/emu/grasscutter/data/def/AvatarSkillData.java
View file @
d32f706c
...
@@ -2,12 +2,12 @@ package emu.grasscutter.data.def;
...
@@ -2,12 +2,12 @@ package emu.grasscutter.data.def;
import
java.util.List
;
import
java.util.List
;
import
emu.grasscutter.data.G
enshin
Resource
;
import
emu.grasscutter.data.G
ame
Resource
;
import
emu.grasscutter.data.ResourceType
;
import
emu.grasscutter.data.ResourceType
;
import
emu.grasscutter.data.ResourceType.LoadPriority
;
import
emu.grasscutter.data.ResourceType.LoadPriority
;
@ResourceType
(
name
=
"AvatarSkillExcelConfigData.json"
,
loadPriority
=
LoadPriority
.
HIGHEST
)
@ResourceType
(
name
=
"AvatarSkillExcelConfigData.json"
,
loadPriority
=
LoadPriority
.
HIGHEST
)
public
class
AvatarSkillData
extends
G
enshin
Resource
{
public
class
AvatarSkillData
extends
G
ame
Resource
{
private
int
Id
;
private
int
Id
;
private
float
CdTime
;
private
float
CdTime
;
private
int
CostElemVal
;
private
int
CostElemVal
;
...
...
src/main/java/emu/grasscutter/data/def/AvatarSkillDepotData.java
View file @
d32f706c
...
@@ -2,8 +2,8 @@ package emu.grasscutter.data.def;
...
@@ -2,8 +2,8 @@ package emu.grasscutter.data.def;
import
java.util.List
;
import
java.util.List
;
import
emu.grasscutter.data.G
enshin
Data
;
import
emu.grasscutter.data.G
ame
Data
;
import
emu.grasscutter.data.G
enshin
Resource
;
import
emu.grasscutter.data.G
ame
Resource
;
import
emu.grasscutter.data.ResourceType
;
import
emu.grasscutter.data.ResourceType
;
import
emu.grasscutter.data.ResourceType.LoadPriority
;
import
emu.grasscutter.data.ResourceType.LoadPriority
;
import
emu.grasscutter.data.custom.AbilityEmbryoEntry
;
import
emu.grasscutter.data.custom.AbilityEmbryoEntry
;
...
@@ -13,7 +13,7 @@ import it.unimi.dsi.fastutil.ints.IntArrayList;
...
@@ -13,7 +13,7 @@ import it.unimi.dsi.fastutil.ints.IntArrayList;
import
it.unimi.dsi.fastutil.ints.IntList
;
import
it.unimi.dsi.fastutil.ints.IntList
;
@ResourceType
(
name
=
"AvatarSkillDepotExcelConfigData.json"
,
loadPriority
=
LoadPriority
.
HIGH
)
@ResourceType
(
name
=
"AvatarSkillDepotExcelConfigData.json"
,
loadPriority
=
LoadPriority
.
HIGH
)
public
class
AvatarSkillDepotData
extends
G
enshin
Resource
{
public
class
AvatarSkillDepotData
extends
G
ame
Resource
{
private
int
Id
;
private
int
Id
;
private
int
EnergySkill
;
private
int
EnergySkill
;
...
@@ -94,7 +94,7 @@ public class AvatarSkillDepotData extends GenshinResource {
...
@@ -94,7 +94,7 @@ public class AvatarSkillDepotData extends GenshinResource {
@Override
@Override
public
void
onLoad
()
{
public
void
onLoad
()
{
this
.
energySkillData
=
G
enshin
Data
.
getAvatarSkillDataMap
().
get
(
this
.
EnergySkill
);
this
.
energySkillData
=
G
ame
Data
.
getAvatarSkillDataMap
().
get
(
this
.
EnergySkill
);
if
(
getEnergySkillData
()
!=
null
)
{
if
(
getEnergySkillData
()
!=
null
)
{
this
.
elementType
=
ElementType
.
getTypeByName
(
getEnergySkillData
().
getCostElemType
());
this
.
elementType
=
ElementType
.
getTypeByName
(
getEnergySkillData
().
getCostElemType
());
}
else
{
}
else
{
...
...
src/main/java/emu/grasscutter/data/def/AvatarTalentData.java
View file @
d32f706c
package
emu.grasscutter.data.def
;
package
emu.grasscutter.data.def
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
emu.grasscutter.data.G
enshin
Resource
;
import
emu.grasscutter.data.G
ame
Resource
;
import
emu.grasscutter.data.ResourceType
;
import
emu.grasscutter.data.ResourceType
;
import
emu.grasscutter.data.ResourceType.LoadPriority
;
import
emu.grasscutter.data.ResourceType.LoadPriority
;
import
emu.grasscutter.data.common.FightPropData
;
import
emu.grasscutter.data.common.FightPropData
;
@ResourceType
(
name
=
"AvatarTalentExcelConfigData.json"
,
loadPriority
=
LoadPriority
.
HIGHEST
)
@ResourceType
(
name
=
"AvatarTalentExcelConfigData.json"
,
loadPriority
=
LoadPriority
.
HIGHEST
)
public
class
AvatarTalentData
extends
G
enshin
Resource
{
public
class
AvatarTalentData
extends
G
ame
Resource
{
private
int
TalentId
;
private
int
TalentId
;
private
int
PrevTalent
;
private
int
PrevTalent
;
private
long
NameTextMapHash
;
private
long
NameTextMapHash
;
...
...
src/main/java/emu/grasscutter/data/def/CombineData.java
0 → 100644
View file @
d32f706c
package
emu.grasscutter.data.def
;
import
emu.grasscutter.data.ResourceType
;
@ResourceType
(
name
=
"CombineExcelConfigData.json"
)
public
class
CombineData
{
}
src/main/java/emu/grasscutter/data/def/EquipAffixData.java
View file @
d32f706c
package
emu.grasscutter.data.def
;
package
emu.grasscutter.data.def
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
emu.grasscutter.data.G
enshin
Resource
;
import
emu.grasscutter.data.G
ame
Resource
;
import
emu.grasscutter.data.ResourceType
;
import
emu.grasscutter.data.ResourceType
;
import
emu.grasscutter.data.common.FightPropData
;
import
emu.grasscutter.data.common.FightPropData
;
@ResourceType
(
name
=
"EquipAffixExcelConfigData.json"
)
@ResourceType
(
name
=
"EquipAffixExcelConfigData.json"
)
public
class
EquipAffixData
extends
G
enshin
Resource
{
public
class
EquipAffixData
extends
G
ame
Resource
{
private
int
AffixId
;
private
int
AffixId
;
private
int
Id
;
private
int
Id
;
...
...
src/main/java/emu/grasscutter/data/def/FetterCharacterCardData.java
View file @
d32f706c
package
emu.grasscutter.data.def
;
package
emu.grasscutter.data.def
;
import
emu.grasscutter.data.G
enshin
Resource
;
import
emu.grasscutter.data.G
ame
Resource
;
import
emu.grasscutter.data.ResourceType
;
import
emu.grasscutter.data.ResourceType
;
import
emu.grasscutter.data.ResourceType.LoadPriority
;
import
emu.grasscutter.data.ResourceType.LoadPriority
;
@ResourceType
(
name
=
"FetterCharacterCardExcelConfigData.json"
,
loadPriority
=
LoadPriority
.
HIGHEST
)
@ResourceType
(
name
=
"FetterCharacterCardExcelConfigData.json"
,
loadPriority
=
LoadPriority
.
HIGHEST
)
public
class
FetterCharacterCardData
extends
G
enshin
Resource
{
public
class
FetterCharacterCardData
extends
G
ame
Resource
{
private
int
AvatarId
;
private
int
AvatarId
;
private
int
RewardId
;
private
int
RewardId
;
...
...
Prev
1
2
3
4
5
6
7
…
16
Next
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