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
fa9d703d
Commit
fa9d703d
authored
Apr 27, 2022
by
BaiSugar
Committed by
GitHub
Apr 27, 2022
Browse files
Merge branch 'Grasscutters:development' into development
parents
6a5d97a3
d1fc8c1f
Changes
279
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/data/def/ReliquaryAffixData.java
View file @
fa9d703d
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.game.props.FightProperty
;
@ResourceType
(
name
=
"ReliquaryAffixExcelConfigData.json"
)
public
class
ReliquaryAffixData
extends
G
enshin
Resource
{
public
class
ReliquaryAffixData
extends
G
ame
Resource
{
private
int
Id
;
private
int
DepotId
;
...
...
src/main/java/emu/grasscutter/data/def/ReliquaryLevelData.java
View file @
fa9d703d
...
...
@@ -2,14 +2,14 @@ package emu.grasscutter.data.def;
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.game.props.FightProperty
;
import
it.unimi.dsi.fastutil.ints.Int2ObjectMap
;
import
it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap
;
@ResourceType
(
name
=
"ReliquaryLevelExcelConfigData.json"
)
public
class
ReliquaryLevelData
extends
G
enshin
Resource
{
public
class
ReliquaryLevelData
extends
G
ame
Resource
{
private
int
id
;
private
Int2ObjectMap
<
Float
>
propMap
;
...
...
src/main/java/emu/grasscutter/data/def/ReliquaryMainPropData.java
View file @
fa9d703d
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.game.props.FightProperty
;
@ResourceType
(
name
=
"ReliquaryMainPropExcelConfigData.json"
)
public
class
ReliquaryMainPropData
extends
G
enshin
Resource
{
public
class
ReliquaryMainPropData
extends
G
ame
Resource
{
private
int
Id
;
private
int
PropDepotId
;
...
...
src/main/java/emu/grasscutter/data/def/ReliquarySetData.java
View file @
fa9d703d
package
emu.grasscutter.data.def
;
import
emu.grasscutter.data.G
enshin
Resource
;
import
emu.grasscutter.data.G
ame
Resource
;
import
emu.grasscutter.data.ResourceType
;
@ResourceType
(
name
=
"ReliquarySetExcelConfigData.json"
)
public
class
ReliquarySetData
extends
G
enshin
Resource
{
public
class
ReliquarySetData
extends
G
ame
Resource
{
private
int
SetId
;
private
int
[]
SetNeedNum
;
private
int
EquipAffixId
;
...
...
src/main/java/emu/grasscutter/data/def/RewardData.java
View file @
fa9d703d
...
...
@@ -2,12 +2,12 @@ package emu.grasscutter.data.def;
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.common.RewardItemData
;
@ResourceType
(
name
=
"RewardExcelConfigData.json"
)
public
class
RewardData
extends
G
enshin
Resource
{
public
class
RewardData
extends
G
ame
Resource
{
public
int
RewardId
;
public
List
<
RewardItemData
>
RewardItemList
;
...
...
src/main/java/emu/grasscutter/data/def/SceneData.java
View file @
fa9d703d
package
emu.grasscutter.data.def
;
import
emu.grasscutter.data.G
enshin
Data
;
import
emu.grasscutter.data.G
enshin
Resource
;
import
emu.grasscutter.data.G
ame
Data
;
import
emu.grasscutter.data.G
ame
Resource
;
import
emu.grasscutter.data.ResourceType
;
import
emu.grasscutter.game.props.SceneType
;
@ResourceType
(
name
=
"SceneExcelConfigData.json"
)
public
class
SceneData
extends
G
enshin
Resource
{
public
class
SceneData
extends
G
ame
Resource
{
private
int
Id
;
private
SceneType
SceneType
;
private
String
ScriptData
;
...
...
src/main/java/emu/grasscutter/data/def/WeaponCurveData.java
View file @
fa9d703d
...
...
@@ -4,12 +4,12 @@ import java.util.HashMap;
import
java.util.Map
;
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.common.CurveInfo
;
@ResourceType
(
name
=
"WeaponCurveExcelConfigData.json"
)
public
class
WeaponCurveData
extends
G
enshin
Resource
{
public
class
WeaponCurveData
extends
G
ame
Resource
{
private
int
Level
;
private
CurveInfo
[]
CurveInfos
;
...
...
src/main/java/emu/grasscutter/data/def/WeaponLevelData.java
View file @
fa9d703d
package
emu.grasscutter.data.def
;
import
emu.grasscutter.data.G
enshin
Resource
;
import
emu.grasscutter.data.G
ame
Resource
;
import
emu.grasscutter.data.ResourceType
;
@ResourceType
(
name
=
"WeaponLevelExcelConfigData.json"
)
public
class
WeaponLevelData
extends
G
enshin
Resource
{
public
class
WeaponLevelData
extends
G
ame
Resource
{
private
int
Level
;
private
int
[]
RequiredExps
;
...
...
src/main/java/emu/grasscutter/data/def/WeaponPromoteData.java
View file @
fa9d703d
package
emu.grasscutter.data.def
;
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.common.FightPropData
;
import
emu.grasscutter.data.common.ItemParamData
;
@ResourceType
(
name
=
"WeaponPromoteExcelConfigData.json"
)
public
class
WeaponPromoteData
extends
G
enshin
Resource
{
public
class
WeaponPromoteData
extends
G
ame
Resource
{
private
int
WeaponPromoteId
;
private
int
PromoteLevel
;
...
...
src/main/java/emu/grasscutter/data/def/WorldLevelData.java
View file @
fa9d703d
package
emu.grasscutter.data.def
;
import
emu.grasscutter.data.G
enshin
Resource
;
import
emu.grasscutter.data.G
ame
Resource
;
import
emu.grasscutter.data.ResourceType
;
@ResourceType
(
name
=
"WorldLevelExcelConfigData.json"
)
public
class
WorldLevelData
extends
G
enshin
Resource
{
public
class
WorldLevelData
extends
G
ame
Resource
{
private
int
Level
;
private
int
MonsterLevel
;
...
...
src/main/java/emu/grasscutter/database/DatabaseHelper.java
View file @
fa9d703d
...
...
@@ -4,12 +4,12 @@ import java.util.List;
import
com.mongodb.client.result.DeleteResult
;
import
dev.morphia.query.experimental.filters.Filters
;
import
emu.grasscutter.G
enshin
Constants
;
import
emu.grasscutter.G
ame
Constants
;
import
emu.grasscutter.game.Account
;
import
emu.grasscutter.game.GenshinPlayer
;
import
emu.grasscutter.game.avatar.GenshinAvatar
;
import
emu.grasscutter.game.avatar.Avatar
;
import
emu.grasscutter.game.friends.Friendship
;
import
emu.grasscutter.game.inventory.GenshinItem
;
import
emu.grasscutter.game.inventory.GameItem
;
import
emu.grasscutter.game.player.Player
;
public
final
class
DatabaseHelper
{
public
static
Account
createAccount
(
String
username
)
{
...
...
@@ -26,7 +26,7 @@ public final class DatabaseHelper {
// Make sure there are no id collisions
if
(
reservedId
>
0
)
{
// Cannot make account with the same uid as the server console
if
(
reservedId
==
G
enshin
Constants
.
SERVER_CONSOLE_UID
)
{
if
(
reservedId
==
G
ame
Constants
.
SERVER_CONSOLE_UID
)
{
return
null
;
}
exists
=
DatabaseHelper
.
getAccountByPlayerId
(
reservedId
);
...
...
@@ -90,15 +90,19 @@ public final class DatabaseHelper {
return
DatabaseManager
.
getDatastore
().
find
(
Account
.
class
).
filter
(
Filters
.
eq
(
"username"
,
username
)).
delete
().
getDeletedCount
()
>
0
;
}
public
static
GenshinPlayer
getPlayerById
(
int
id
)
{
return
DatabaseManager
.
getDatastore
().
find
(
GenshinPlayer
.
class
).
filter
(
Filters
.
eq
(
"_id"
,
id
)).
first
();
public
static
List
<
Player
>
getAllPlayers
()
{
return
DatabaseManager
.
getDatastore
().
find
(
Player
.
class
).
stream
().
toList
();
}
public
static
Player
getPlayerById
(
int
id
)
{
return
DatabaseManager
.
getDatastore
().
find
(
Player
.
class
).
filter
(
Filters
.
eq
(
"_id"
,
id
)).
first
();
}
public
static
boolean
checkPlayerExists
(
int
id
)
{
return
DatabaseManager
.
getDatastore
().
find
(
Genshin
Player
.
class
).
filter
(
Filters
.
eq
(
"_id"
,
id
)).
first
()
!=
null
;
return
DatabaseManager
.
getDatastore
().
find
(
Player
.
class
).
filter
(
Filters
.
eq
(
"_id"
,
id
)).
first
()
!=
null
;
}
public
static
synchronized
Genshin
Player
createPlayer
(
Genshin
Player
character
,
int
reservedId
)
{
public
static
synchronized
Player
createPlayer
(
Player
character
,
int
reservedId
)
{
// Check if reserved id
int
id
;
if
(
reservedId
>
0
&&
!
checkPlayerExists
(
reservedId
))
{
...
...
@@ -123,42 +127,42 @@ public final class DatabaseHelper {
id
=
reservedId
;
}
else
{
do
{
id
=
DatabaseManager
.
getNextId
(
Genshin
Player
.
class
);
id
=
DatabaseManager
.
getNextId
(
Player
.
class
);
}
while
(
checkPlayerExists
(
id
));
}
return
id
;
}
public
static
void
savePlayer
(
Genshin
Player
character
)
{
public
static
void
savePlayer
(
Player
character
)
{
DatabaseManager
.
getDatastore
().
save
(
character
);
}
public
static
void
saveAvatar
(
Genshin
Avatar
avatar
)
{
public
static
void
saveAvatar
(
Avatar
avatar
)
{
DatabaseManager
.
getDatastore
().
save
(
avatar
);
}
public
static
List
<
Genshin
Avatar
>
getAvatars
(
Genshin
Player
player
)
{
return
DatabaseManager
.
getDatastore
().
find
(
Genshin
Avatar
.
class
).
filter
(
Filters
.
eq
(
"ownerId"
,
player
.
getUid
())).
stream
().
toList
();
public
static
List
<
Avatar
>
getAvatars
(
Player
player
)
{
return
DatabaseManager
.
getDatastore
().
find
(
Avatar
.
class
).
filter
(
Filters
.
eq
(
"ownerId"
,
player
.
getUid
())).
stream
().
toList
();
}
public
static
void
saveItem
(
G
enshin
Item
item
)
{
public
static
void
saveItem
(
G
ame
Item
item
)
{
DatabaseManager
.
getDatastore
().
save
(
item
);
}
public
static
boolean
deleteItem
(
G
enshin
Item
item
)
{
public
static
boolean
deleteItem
(
G
ame
Item
item
)
{
DeleteResult
result
=
DatabaseManager
.
getDatastore
().
delete
(
item
);
return
result
.
wasAcknowledged
();
}
public
static
List
<
G
enshin
Item
>
getInventoryItems
(
Genshin
Player
player
)
{
return
DatabaseManager
.
getDatastore
().
find
(
G
enshin
Item
.
class
).
filter
(
Filters
.
eq
(
"ownerId"
,
player
.
getUid
())).
stream
().
toList
();
public
static
List
<
G
ame
Item
>
getInventoryItems
(
Player
player
)
{
return
DatabaseManager
.
getDatastore
().
find
(
G
ame
Item
.
class
).
filter
(
Filters
.
eq
(
"ownerId"
,
player
.
getUid
())).
stream
().
toList
();
}
public
static
List
<
Friendship
>
getFriends
(
Genshin
Player
player
)
{
public
static
List
<
Friendship
>
getFriends
(
Player
player
)
{
return
DatabaseManager
.
getDatastore
().
find
(
Friendship
.
class
).
filter
(
Filters
.
eq
(
"ownerId"
,
player
.
getUid
())).
stream
().
toList
();
}
public
static
List
<
Friendship
>
getReverseFriends
(
Genshin
Player
player
)
{
public
static
List
<
Friendship
>
getReverseFriends
(
Player
player
)
{
return
DatabaseManager
.
getDatastore
().
find
(
Friendship
.
class
).
filter
(
Filters
.
eq
(
"friendId"
,
player
.
getUid
())).
stream
().
toList
();
}
...
...
src/main/java/emu/grasscutter/database/DatabaseManager.java
View file @
fa9d703d
...
...
@@ -13,10 +13,10 @@ import dev.morphia.mapping.MapperOptions;
import
dev.morphia.query.experimental.filters.Filters
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.game.Account
;
import
emu.grasscutter.game.GenshinPlayer
;
import
emu.grasscutter.game.avatar.GenshinAvatar
;
import
emu.grasscutter.game.avatar.Avatar
;
import
emu.grasscutter.game.friends.Friendship
;
import
emu.grasscutter.game.inventory.GenshinItem
;
import
emu.grasscutter.game.inventory.GameItem
;
import
emu.grasscutter.game.player.Player
;
public
final
class
DatabaseManager
{
...
...
@@ -27,7 +27,7 @@ public final class DatabaseManager {
private
static
Datastore
dispatchDatastore
;
private
static
final
Class
<?>[]
mappedClasses
=
new
Class
<?>[]
{
DatabaseCounter
.
class
,
Account
.
class
,
Genshin
Player
.
class
,
Genshin
Avatar
.
class
,
G
enshin
Item
.
class
,
Friendship
.
class
DatabaseCounter
.
class
,
Account
.
class
,
Player
.
class
,
Avatar
.
class
,
G
ame
Item
.
class
,
Friendship
.
class
};
public
static
Datastore
getDatastore
()
{
...
...
src/main/java/emu/grasscutter/game/CoopRequest.java
View file @
fa9d703d
package
emu.grasscutter.game
;
import
emu.grasscutter.game.player.Player
;
public
class
CoopRequest
{
private
final
Genshin
Player
requester
;
private
final
Player
requester
;
private
final
long
requestTime
;
private
final
long
expireTime
;
public
CoopRequest
(
Genshin
Player
requester
)
{
public
CoopRequest
(
Player
requester
)
{
this
.
requester
=
requester
;
this
.
requestTime
=
System
.
currentTimeMillis
();
this
.
expireTime
=
this
.
requestTime
+
10000
;
}
public
Genshin
Player
getRequester
()
{
public
Player
getRequester
()
{
return
requester
;
}
...
...
src/main/java/emu/grasscutter/game/avatar/
Genshin
Avatar.java
→
src/main/java/emu/grasscutter/game/avatar/Avatar.java
View file @
fa9d703d
...
...
@@ -16,7 +16,7 @@ import dev.morphia.annotations.PostLoad;
import
dev.morphia.annotations.PrePersist
;
import
dev.morphia.annotations.Transient
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.data.G
enshin
Data
;
import
emu.grasscutter.data.G
ame
Data
;
import
emu.grasscutter.data.common.FightPropData
;
import
emu.grasscutter.data.custom.OpenConfigEntry
;
import
emu.grasscutter.data.def.AvatarData
;
...
...
@@ -35,10 +35,10 @@ import emu.grasscutter.data.def.WeaponPromoteData;
import
emu.grasscutter.data.def.ItemData.WeaponProperty
;
import
emu.grasscutter.data.def.ProudSkillData
;
import
emu.grasscutter.database.DatabaseHelper
;
import
emu.grasscutter.game.GenshinPlayer
;
import
emu.grasscutter.game.entity.EntityAvatar
;
import
emu.grasscutter.game.inventory.EquipType
;
import
emu.grasscutter.game.inventory.GenshinItem
;
import
emu.grasscutter.game.inventory.GameItem
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.game.props.ElementType
;
import
emu.grasscutter.game.props.EntityIdType
;
import
emu.grasscutter.game.props.FetterState
;
...
...
@@ -57,11 +57,11 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import
it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap
;
@Entity
(
value
=
"avatars"
,
useDiscriminator
=
false
)
public
class
Genshin
Avatar
{
public
class
Avatar
{
@Id
private
ObjectId
id
;
@Indexed
private
int
ownerId
;
// Id of player that this avatar belongs to
@Transient
private
Genshin
Player
owner
;
@Transient
private
Player
owner
;
@Transient
private
AvatarData
data
;
@Transient
private
long
guid
;
// Player unique id
private
int
avatarId
;
// Id of avatar
...
...
@@ -73,7 +73,7 @@ public class GenshinAvatar {
private
int
satiationPenalty
;
// ?
private
float
currentHp
;
@Transient
private
final
Int2ObjectMap
<
G
enshin
Item
>
equips
;
@Transient
private
final
Int2ObjectMap
<
G
ame
Item
>
equips
;
@Transient
private
final
Int2FloatOpenHashMap
fightProp
;
@Transient
private
Set
<
String
>
extraAbilityEmbryos
;
...
...
@@ -96,21 +96,21 @@ public class GenshinAvatar {
private
int
nameCardRewardId
;
private
int
nameCardId
;
public
Genshin
Avatar
()
{
public
Avatar
()
{
// Morhpia only!
this
.
equips
=
new
Int2ObjectOpenHashMap
<>();
this
.
fightProp
=
new
Int2FloatOpenHashMap
();
this
.
extraAbilityEmbryos
=
new
HashSet
<>();
this
.
proudSkillBonusMap
=
new
HashMap
<>();
this
.
fetters
=
new
ArrayList
<>();
// TODO Move to
genshin
avatar
this
.
fetters
=
new
ArrayList
<>();
// TODO Move to avatar
}
// On creation
public
Genshin
Avatar
(
int
avatarId
)
{
this
(
G
enshin
Data
.
getAvatarDataMap
().
get
(
avatarId
));
public
Avatar
(
int
avatarId
)
{
this
(
G
ame
Data
.
getAvatarDataMap
().
get
(
avatarId
));
}
public
Genshin
Avatar
(
AvatarData
data
)
{
public
Avatar
(
AvatarData
data
)
{
this
();
this
.
avatarId
=
data
.
getId
();
this
.
nameCardRewardId
=
data
.
getNameCardRewardId
();
...
...
@@ -143,7 +143,7 @@ public class GenshinAvatar {
this
.
onLoad
();
}
public
Genshin
Player
getPlayer
()
{
public
Player
getPlayer
()
{
return
this
.
owner
;
}
...
...
@@ -163,10 +163,10 @@ public class GenshinAvatar {
return
ownerId
;
}
public
void
setOwner
(
Genshin
Player
player
)
{
public
void
setOwner
(
Player
player
)
{
this
.
owner
=
player
;
this
.
ownerId
=
player
.
getUid
();
this
.
guid
=
player
.
getNextG
enshin
Guid
();
this
.
guid
=
player
.
getNextG
ame
Guid
();
}
public
int
getSatiation
()
{
...
...
@@ -229,19 +229,19 @@ public class GenshinAvatar {
this
.
promoteLevel
=
promoteLevel
;
}
public
Int2ObjectMap
<
G
enshin
Item
>
getEquips
()
{
public
Int2ObjectMap
<
G
ame
Item
>
getEquips
()
{
return
equips
;
}
public
G
enshin
Item
getEquipBySlot
(
EquipType
slot
)
{
public
G
ame
Item
getEquipBySlot
(
EquipType
slot
)
{
return
this
.
getEquips
().
get
(
slot
.
getValue
());
}
private
G
enshin
Item
getEquipBySlot
(
int
slotId
)
{
private
G
ame
Item
getEquipBySlot
(
int
slotId
)
{
return
this
.
getEquips
().
get
(
slotId
);
}
public
G
enshin
Item
getWeapon
()
{
public
G
ame
Item
getWeapon
()
{
return
this
.
getEquipBySlot
(
EquipType
.
EQUIP_WEAPON
);
}
...
...
@@ -270,7 +270,7 @@ public class GenshinAvatar {
}
if
(
openData
.
getNeedAvatarPromoteLevel
()
<=
this
.
getPromoteLevel
())
{
int
proudSkillId
=
(
openData
.
getProudSkillGroupId
()
*
100
)
+
1
;
if
(
G
enshin
Data
.
getProudSkillDataMap
().
containsKey
(
proudSkillId
))
{
if
(
G
ame
Data
.
getProudSkillDataMap
().
containsKey
(
proudSkillId
))
{
this
.
getProudSkillList
().
add
(
proudSkillId
);
}
}
...
...
@@ -385,7 +385,7 @@ public class GenshinAvatar {
return
bornTime
;
}
public
boolean
equipItem
(
G
enshin
Item
item
,
boolean
shouldRecalc
)
{
public
boolean
equipItem
(
G
ame
Item
item
,
boolean
shouldRecalc
)
{
EquipType
itemEquipType
=
item
.
getItemData
().
getEquipType
();
if
(
itemEquipType
==
EquipType
.
EQUIP_NONE
)
{
return
false
;
...
...
@@ -416,7 +416,7 @@ public class GenshinAvatar {
}
public
boolean
unequipItem
(
EquipType
slot
)
{
G
enshin
Item
item
=
getEquips
().
remove
(
slot
.
getValue
());
G
ame
Item
item
=
getEquips
().
remove
(
slot
.
getValue
());
if
(
item
!=
null
)
{
item
.
setEquipCharacter
(
0
);
...
...
@@ -434,7 +434,7 @@ public class GenshinAvatar {
public
void
recalcStats
(
boolean
forceSendAbilityChange
)
{
// Setup
AvatarData
data
=
this
.
getAvatarData
();
AvatarPromoteData
promoteData
=
G
enshin
Data
.
getAvatarPromoteData
(
data
.
getAvatarPromoteId
(),
this
.
getPromoteLevel
());
AvatarPromoteData
promoteData
=
G
ame
Data
.
getAvatarPromoteData
(
data
.
getAvatarPromoteId
(),
this
.
getPromoteLevel
());
Int2IntOpenHashMap
setMap
=
new
Int2IntOpenHashMap
();
// Extra ability embryos
...
...
@@ -476,21 +476,21 @@ public class GenshinAvatar {
// Artifacts
for
(
int
slotId
=
1
;
slotId
<=
5
;
slotId
++)
{
// Get artifact
G
enshin
Item
equip
=
this
.
getEquipBySlot
(
slotId
);
G
ame
Item
equip
=
this
.
getEquipBySlot
(
slotId
);
if
(
equip
==
null
)
{
continue
;
}
// Artifact main stat
ReliquaryMainPropData
mainPropData
=
G
enshin
Data
.
getReliquaryMainPropDataMap
().
get
(
equip
.
getMainPropId
());
ReliquaryMainPropData
mainPropData
=
G
ame
Data
.
getReliquaryMainPropDataMap
().
get
(
equip
.
getMainPropId
());
if
(
mainPropData
!=
null
)
{
ReliquaryLevelData
levelData
=
G
enshin
Data
.
getRelicLevelData
(
equip
.
getItemData
().
getRankLevel
(),
equip
.
getLevel
());
ReliquaryLevelData
levelData
=
G
ame
Data
.
getRelicLevelData
(
equip
.
getItemData
().
getRankLevel
(),
equip
.
getLevel
());
if
(
levelData
!=
null
)
{
this
.
addFightProperty
(
mainPropData
.
getFightProp
(),
levelData
.
getPropValue
(
mainPropData
.
getFightProp
()));
}
}
// Artifact sub stats
for
(
int
appendPropId
:
equip
.
getAppendPropIdList
())
{
ReliquaryAffixData
affixData
=
G
enshin
Data
.
getReliquaryAffixDataMap
().
get
(
appendPropId
);
ReliquaryAffixData
affixData
=
G
ame
Data
.
getReliquaryAffixDataMap
().
get
(
appendPropId
);
if
(
affixData
!=
null
)
{
this
.
addFightProperty
(
affixData
.
getFightProp
(),
affixData
.
getPropValue
());
}
...
...
@@ -503,7 +503,7 @@ public class GenshinAvatar {
// Set stuff
for
(
Int2IntOpenHashMap
.
Entry
e
:
setMap
.
int2IntEntrySet
())
{
ReliquarySetData
setData
=
G
enshin
Data
.
getReliquarySetDataMap
().
get
(
e
.
getIntKey
());
ReliquarySetData
setData
=
G
ame
Data
.
getReliquarySetDataMap
().
get
(
e
.
getIntKey
());
if
(
setData
==
null
)
{
continue
;
}
...
...
@@ -516,7 +516,7 @@ public class GenshinAvatar {
if
(
amount
>=
setData
.
getSetNeedNum
()[
setIndex
])
{
int
affixId
=
(
setData
.
getEquipAffixId
()
*
10
)
+
setIndex
;
EquipAffixData
affix
=
G
enshin
Data
.
getEquipAffixDataMap
().
get
(
affixId
);
EquipAffixData
affix
=
G
ame
Data
.
getEquipAffixDataMap
().
get
(
affixId
);
if
(
affix
==
null
)
{
continue
;
}
...
...
@@ -535,17 +535,17 @@ public class GenshinAvatar {
}
// Weapon
G
enshin
Item
weapon
=
this
.
getWeapon
();
G
ame
Item
weapon
=
this
.
getWeapon
();
if
(
weapon
!=
null
)
{
// Add stats
WeaponCurveData
curveData
=
G
enshin
Data
.
getWeaponCurveDataMap
().
get
(
weapon
.
getLevel
());
WeaponCurveData
curveData
=
G
ame
Data
.
getWeaponCurveDataMap
().
get
(
weapon
.
getLevel
());
if
(
curveData
!=
null
)
{
for
(
WeaponProperty
weaponProperty
:
weapon
.
getItemData
().
getWeaponProperties
())
{
this
.
addFightProperty
(
weaponProperty
.
getFightProp
(),
weaponProperty
.
getInitValue
()
*
curveData
.
getMultByProp
(
weaponProperty
.
getType
()));
}
}
// Weapon promotion stats
WeaponPromoteData
wepPromoteData
=
G
enshin
Data
.
getWeaponPromoteData
(
weapon
.
getItemData
().
getWeaponPromoteId
(),
weapon
.
getPromoteLevel
());
WeaponPromoteData
wepPromoteData
=
G
ame
Data
.
getWeaponPromoteData
(
weapon
.
getItemData
().
getWeaponPromoteId
(),
weapon
.
getPromoteLevel
());
if
(
wepPromoteData
!=
null
)
{
for
(
FightPropData
prop
:
wepPromoteData
.
getAddProps
())
{
if
(
prop
.
getValue
()
==
0
f
||
prop
.
getProp
()
==
null
)
{
...
...
@@ -563,7 +563,7 @@ public class GenshinAvatar {
}
// Calculate affix id
int
affixId
=
(
af
*
10
)
+
weapon
.
getRefinement
();
EquipAffixData
affix
=
G
enshin
Data
.
getEquipAffixDataMap
().
get
(
affixId
);
EquipAffixData
affix
=
G
ame
Data
.
getEquipAffixDataMap
().
get
(
affixId
);
if
(
affix
==
null
)
{
continue
;
}
...
...
@@ -580,7 +580,7 @@ public class GenshinAvatar {
}
// Add proud skills and unlock them if needed
AvatarSkillDepotData
skillDepot
=
G
enshin
Data
.
getAvatarSkillDepotDataMap
().
get
(
this
.
getSkillDepotId
());
AvatarSkillDepotData
skillDepot
=
G
ame
Data
.
getAvatarSkillDepotDataMap
().
get
(
this
.
getSkillDepotId
());
this
.
getProudSkillList
().
clear
();
for
(
InherentProudSkillOpens
openData
:
skillDepot
.
getInherentProudSkillOpens
())
{
if
(
openData
.
getProudSkillGroupId
()
==
0
)
{
...
...
@@ -588,7 +588,7 @@ public class GenshinAvatar {
}
if
(
openData
.
getNeedAvatarPromoteLevel
()
<=
this
.
getPromoteLevel
())
{
int
proudSkillId
=
(
openData
.
getProudSkillGroupId
()
*
100
)
+
1
;
if
(
G
enshin
Data
.
getProudSkillDataMap
().
containsKey
(
proudSkillId
))
{
if
(
G
ame
Data
.
getProudSkillDataMap
().
containsKey
(
proudSkillId
))
{
this
.
getProudSkillList
().
add
(
proudSkillId
);
}
}
...
...
@@ -596,7 +596,7 @@ public class GenshinAvatar {
// Proud skills
for
(
int
proudSkillId
:
this
.
getProudSkillList
())
{
ProudSkillData
proudSkillData
=
G
enshin
Data
.
getProudSkillDataMap
().
get
(
proudSkillId
);
ProudSkillData
proudSkillData
=
G
ame
Data
.
getProudSkillDataMap
().
get
(
proudSkillId
);
if
(
proudSkillData
==
null
)
{
continue
;
}
...
...
@@ -613,7 +613,7 @@ public class GenshinAvatar {
// Constellations
if
(
this
.
getTalentIdList
().
size
()
>
0
)
{
for
(
int
talentId
:
this
.
getTalentIdList
())
{
AvatarTalentData
avatarTalentData
=
G
enshin
Data
.
getAvatarTalentDataMap
().
get
(
talentId
);
AvatarTalentData
avatarTalentData
=
G
ame
Data
.
getAvatarTalentDataMap
().
get
(
talentId
);
if
(
avatarTalentData
==
null
)
{
return
;
}
...
...
@@ -657,7 +657,7 @@ public class GenshinAvatar {
return
;
}
OpenConfigEntry
entry
=
G
enshin
Data
.
getOpenConfigEntries
().
get
(
openConfig
);
OpenConfigEntry
entry
=
G
ame
Data
.
getOpenConfigEntries
().
get
(
openConfig
);
if
(
entry
==
null
)
{
if
(
forceAdd
)
{
// Add config string to ability skill list anyways
...
...
@@ -684,14 +684,14 @@ public class GenshinAvatar {
if
(
this
.
getTalentIdList
().
size
()
>
0
)
{
for
(
int
talentId
:
this
.
getTalentIdList
())
{
AvatarTalentData
avatarTalentData
=
G
enshin
Data
.
getAvatarTalentDataMap
().
get
(
talentId
);
AvatarTalentData
avatarTalentData
=
G
ame
Data
.
getAvatarTalentDataMap
().
get
(
talentId
);
if
(
avatarTalentData
==
null
||
avatarTalentData
.
getOpenConfig
()
==
null
||
avatarTalentData
.
getOpenConfig
().
length
()
==
0
)
{
continue
;
}
// Get open config to find which skill should be boosted
OpenConfigEntry
entry
=
G
enshin
Data
.
getOpenConfigEntries
().
get
(
avatarTalentData
.
getOpenConfig
());
OpenConfigEntry
entry
=
G
ame
Data
.
getOpenConfigEntries
().
get
(
avatarTalentData
.
getOpenConfig
());
if
(
entry
==
null
)
{
continue
;
}
...
...
@@ -712,7 +712,7 @@ public class GenshinAvatar {
}
// Get proud skill group id
AvatarSkillData
skillData
=
G
enshin
Data
.
getAvatarSkillDataMap
().
get
(
skillId
);
AvatarSkillData
skillData
=
G
ame
Data
.
getAvatarSkillDataMap
().
get
(
skillId
);
if
(
skillData
==
null
)
{
continue
;
...
...
@@ -785,7 +785,7 @@ public class GenshinAvatar {
.
setWearingFlycloakId
(
this
.
getFlyCloak
())
.
setCostumeId
(
this
.
getCostume
());
for
(
G
enshin
Item
item
:
this
.
getEquips
().
values
())
{
for
(
G
ame
Item
item
:
this
.
getEquips
().
values
())
{
avatarInfo
.
addEquipGuidList
(
item
.
getGuid
());
}
...
...
src/main/java/emu/grasscutter/game/avatar/AvatarProfileData.java
View file @
fa9d703d
...
...
@@ -7,7 +7,7 @@ public class AvatarProfileData {
private
int
avatarId
;
private
int
level
;
public
AvatarProfileData
(
Genshin
Avatar
avatar
)
{
public
AvatarProfileData
(
Avatar
avatar
)
{
this
.
update
(
avatar
);
}
...
...
@@ -19,7 +19,7 @@ public class AvatarProfileData {
return
level
;
}
public
void
update
(
Genshin
Avatar
avatar
)
{
public
void
update
(
Avatar
avatar
)
{
this
.
avatarId
=
avatar
.
getAvatarId
();
this
.
level
=
avatar
.
getLevel
();
}
...
...
src/main/java/emu/grasscutter/game/avatar/AvatarStorage.java
View file @
fa9d703d
...
...
@@ -3,12 +3,12 @@ package emu.grasscutter.game.avatar;
import
java.util.Iterator
;
import
java.util.List
;
import
emu.grasscutter.data.G
enshin
Data
;
import
emu.grasscutter.data.G
ame
Data
;
import
emu.grasscutter.data.def.AvatarData
;
import
emu.grasscutter.database.DatabaseHelper
;
import
emu.grasscutter.game.GenshinPlayer
;
import
emu.grasscutter.game.entity.EntityAvatar
;
import
emu.grasscutter.game.inventory.GenshinItem
;
import
emu.grasscutter.game.inventory.GameItem
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.server.packet.send.PacketAvatarChangeCostumeNotify
;
import
emu.grasscutter.server.packet.send.PacketAvatarFlycloakChangeNotify
;
import
it.unimi.dsi.fastutil.ints.Int2ObjectMap
;
...
...
@@ -16,22 +16,22 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import
it.unimi.dsi.fastutil.longs.Long2ObjectMap
;
import
it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap
;
public
class
AvatarStorage
implements
Iterable
<
Genshin
Avatar
>
{
private
final
Genshin
Player
player
;
private
final
Int2ObjectMap
<
Genshin
Avatar
>
avatars
;
private
final
Long2ObjectMap
<
Genshin
Avatar
>
avatarsGuid
;
public
class
AvatarStorage
implements
Iterable
<
Avatar
>
{
private
final
Player
player
;
private
final
Int2ObjectMap
<
Avatar
>
avatars
;
private
final
Long2ObjectMap
<
Avatar
>
avatarsGuid
;
public
AvatarStorage
(
Genshin
Player
player
)
{
public
AvatarStorage
(
Player
player
)
{
this
.
player
=
player
;
this
.
avatars
=
new
Int2ObjectOpenHashMap
<>();
this
.
avatarsGuid
=
new
Long2ObjectOpenHashMap
<>();
}
public
Genshin
Player
getPlayer
()
{
public
Player
getPlayer
()
{
return
player
;
}
public
Int2ObjectMap
<
Genshin
Avatar
>
getAvatars
()
{
public
Int2ObjectMap
<
Avatar
>
getAvatars
()
{
return
avatars
;
}
...
...
@@ -39,11 +39,11 @@ public class AvatarStorage implements Iterable<GenshinAvatar> {
return
this
.
avatars
.
size
();
}
public
Genshin
Avatar
getAvatarById
(
int
id
)
{
public
Avatar
getAvatarById
(
int
id
)
{
return
getAvatars
().
get
(
id
);
}
public
Genshin
Avatar
getAvatarByGuid
(
long
id
)
{
public
Avatar
getAvatarByGuid
(
long
id
)
{
return
avatarsGuid
.
get
(
id
);
}
...
...
@@ -51,7 +51,7 @@ public class AvatarStorage implements Iterable<GenshinAvatar> {
return
getAvatars
().
containsKey
(
id
);
}
public
boolean
addAvatar
(
Genshin
Avatar
avatar
)
{
public
boolean
addAvatar
(
Avatar
avatar
)
{
if
(
avatar
.
getAvatarData
()
==
null
||
this
.
hasAvatar
(
avatar
.
getAvatarId
()))
{
return
false
;
}
...
...
@@ -68,14 +68,14 @@ public class AvatarStorage implements Iterable<GenshinAvatar> {
return
true
;
}
public
void
addStartingWeapon
(
Genshin
Avatar
avatar
)
{
public
void
addStartingWeapon
(
Avatar
avatar
)
{
// Make sure avatar owner is this player
if
(
avatar
.
getPlayer
()
!=
this
.
getPlayer
())
{
return
;
}
// Create weapon
G
enshin
Item
weapon
=
new
G
enshin
Item
(
avatar
.
getAvatarData
().
getInitialWeapon
());
G
ame
Item
weapon
=
new
G
ame
Item
(
avatar
.
getAvatarData
().
getInitialWeapon
());
if
(
weapon
.
getItemData
()
!=
null
)
{
this
.
getPlayer
().
getInventory
().
addItem
(
weapon
);
...
...
@@ -85,7 +85,7 @@ public class AvatarStorage implements Iterable<GenshinAvatar> {
}
public
boolean
wearFlycloak
(
long
avatarGuid
,
int
flycloakId
)
{
Genshin
Avatar
avatar
=
this
.
getAvatarByGuid
(
avatarGuid
);
Avatar
avatar
=
this
.
getAvatarByGuid
(
avatarGuid
);
if
(
avatar
==
null
||
!
getPlayer
().
getFlyCloakList
().
contains
(
flycloakId
))
{
return
false
;
...
...
@@ -101,7 +101,7 @@ public class AvatarStorage implements Iterable<GenshinAvatar> {
}
public
boolean
changeCostume
(
long
avatarGuid
,
int
costumeId
)
{
Genshin
Avatar
avatar
=
this
.
getAvatarByGuid
(
avatarGuid
);
Avatar
avatar
=
this
.
getAvatarByGuid
(
avatarGuid
);
if
(
avatar
==
null
)
{
return
false
;
...
...
@@ -130,15 +130,15 @@ public class AvatarStorage implements Iterable<GenshinAvatar> {
}
public
void
loadFromDatabase
()
{
List
<
Genshin
Avatar
>
avatars
=
DatabaseHelper
.
getAvatars
(
getPlayer
());
List
<
Avatar
>
avatars
=
DatabaseHelper
.
getAvatars
(
getPlayer
());
for
(
Genshin
Avatar
avatar
:
avatars
)
{
for
(
Avatar
avatar
:
avatars
)
{
// Should never happen
if
(
avatar
.
getObjectId
()
==
null
)
{
continue
;
}
AvatarData
avatarData
=
G
enshin
Data
.
getAvatarDataMap
().
get
(
avatar
.
getAvatarId
());
AvatarData
avatarData
=
G
ame
Data
.
getAvatarDataMap
().
get
(
avatar
.
getAvatarId
());
if
(
avatarData
==
null
)
{
continue
;
}
...
...
@@ -157,7 +157,7 @@ public class AvatarStorage implements Iterable<GenshinAvatar> {
}
public
void
postLoad
()
{
for
(
Genshin
Avatar
avatar
:
this
)
{
for
(
Avatar
avatar
:
this
)
{
// Weapon check
if
(
avatar
.
getWeapon
()
==
null
)
{
this
.
addStartingWeapon
(
avatar
);
...
...
@@ -168,7 +168,7 @@ public class AvatarStorage implements Iterable<GenshinAvatar> {
}
@Override
public
Iterator
<
Genshin
Avatar
>
iterator
()
{
public
Iterator
<
Avatar
>
iterator
()
{
return
getAvatars
().
values
().
iterator
();
}
}
src/main/java/emu/grasscutter/game/entity/EntityAvatar.java
View file @
fa9d703d
package
emu.grasscutter.game.entity
;
import
emu.grasscutter.G
enshin
Constants
;
import
emu.grasscutter.data.G
enshin
Data
;
import
emu.grasscutter.G
ame
Constants
;
import
emu.grasscutter.data.G
ame
Data
;
import
emu.grasscutter.data.def.AvatarData
;
import
emu.grasscutter.data.def.AvatarSkillDepotData
;
import
emu.grasscutter.game.GenshinPlayer
;
import
emu.grasscutter.game.GenshinScene
;
import
emu.grasscutter.game.World
;
import
emu.grasscutter.game.avatar.GenshinAvatar
;
import
emu.grasscutter.game.avatar.Avatar
;
import
emu.grasscutter.game.inventory.EquipType
;
import
emu.grasscutter.game.inventory.GenshinItem
;
import
emu.grasscutter.game.inventory.GameItem
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.game.props.EntityIdType
;
import
emu.grasscutter.game.props.FightProperty
;
import
emu.grasscutter.game.props.PlayerProperty
;
import
emu.grasscutter.game.world.Scene
;
import
emu.grasscutter.game.world.World
;
import
emu.grasscutter.net.proto.AbilityControlBlockOuterClass.AbilityControlBlock
;
import
emu.grasscutter.net.proto.AbilityEmbryoOuterClass.AbilityEmbryo
;
import
emu.grasscutter.net.proto.AbilitySyncStateInfoOuterClass.AbilitySyncStateInfo
;
...
...
@@ -34,29 +34,29 @@ import emu.grasscutter.utils.Utils;
import
it.unimi.dsi.fastutil.ints.Int2FloatMap
;
import
it.unimi.dsi.fastutil.ints.Int2FloatOpenHashMap
;
public
class
EntityAvatar
extends
G
enshin
Entity
{
private
final
Genshin
Avatar
avatar
;
public
class
EntityAvatar
extends
G
ame
Entity
{
private
final
Avatar
avatar
;
private
PlayerDieType
killedType
;
private
int
killedBy
;
public
EntityAvatar
(
Genshin
Scene
scene
,
Genshin
Avatar
avatar
)
{
public
EntityAvatar
(
Scene
scene
,
Avatar
avatar
)
{
super
(
scene
);
this
.
avatar
=
avatar
;
this
.
id
=
getScene
().
getWorld
().
getNextEntityId
(
EntityIdType
.
AVATAR
);
G
enshin
Item
weapon
=
this
.
getAvatar
().
getWeapon
();
G
ame
Item
weapon
=
this
.
getAvatar
().
getWeapon
();
if
(
weapon
!=
null
)
{
weapon
.
setWeaponEntityId
(
getScene
().
getWorld
().
getNextEntityId
(
EntityIdType
.
WEAPON
));
}
}
public
EntityAvatar
(
Genshin
Avatar
avatar
)
{
public
EntityAvatar
(
Avatar
avatar
)
{
super
(
null
);
this
.
avatar
=
avatar
;
}
public
Genshin
Player
getPlayer
()
{
public
Player
getPlayer
()
{
return
avatar
.
getPlayer
();
}
...
...
@@ -70,7 +70,7 @@ public class EntityAvatar extends GenshinEntity {
return
getPlayer
().
getRotation
();
}
public
Genshin
Avatar
getAvatar
()
{
public
Avatar
getAvatar
()
{
return
avatar
;
}
...
...
@@ -122,7 +122,7 @@ public class EntityAvatar extends GenshinEntity {
.
setCostumeId
(
this
.
getAvatar
().
getCostume
())
.
setBornTime
(
this
.
getAvatar
().
getBornTime
());
for
(
G
enshin
Item
item
:
avatar
.
getEquips
().
values
())
{
for
(
G
ame
Item
item
:
avatar
.
getEquips
().
values
())
{
if
(
item
.
getItemData
().
getEquipType
()
==
EquipType
.
EQUIP_WEAPON
)
{
avatarInfo
.
setWeapon
(
item
.
createSceneWeaponInfo
());
}
else
{
...
...
@@ -187,17 +187,17 @@ public class EntityAvatar extends GenshinEntity {
AbilityEmbryo
emb
=
AbilityEmbryo
.
newBuilder
()
.
setAbilityId
(++
embryoId
)
.
setAbilityNameHash
(
id
)
.
setAbilityOverrideNameHash
(
G
enshin
Constants
.
DEFAULT_ABILITY_NAME
)
.
setAbilityOverrideNameHash
(
G
ame
Constants
.
DEFAULT_ABILITY_NAME
)
.
build
();
abilityControlBlock
.
addAbilityEmbryoList
(
emb
);
}
}
// Add default abilities
for
(
int
id
:
G
enshin
Constants
.
DEFAULT_ABILITY_HASHES
)
{
for
(
int
id
:
G
ame
Constants
.
DEFAULT_ABILITY_HASHES
)
{
AbilityEmbryo
emb
=
AbilityEmbryo
.
newBuilder
()
.
setAbilityId
(++
embryoId
)
.
setAbilityNameHash
(
id
)
.
setAbilityOverrideNameHash
(
G
enshin
Constants
.
DEFAULT_ABILITY_NAME
)
.
setAbilityOverrideNameHash
(
G
ame
Constants
.
DEFAULT_ABILITY_NAME
)
.
build
();
abilityControlBlock
.
addAbilityEmbryoList
(
emb
);
}
...
...
@@ -206,18 +206,18 @@ public class EntityAvatar extends GenshinEntity {
AbilityEmbryo
emb
=
AbilityEmbryo
.
newBuilder
()
.
setAbilityId
(++
embryoId
)
.
setAbilityNameHash
(
id
)
.
setAbilityOverrideNameHash
(
G
enshin
Constants
.
DEFAULT_ABILITY_NAME
)
.
setAbilityOverrideNameHash
(
G
ame
Constants
.
DEFAULT_ABILITY_NAME
)
.
build
();
abilityControlBlock
.
addAbilityEmbryoList
(
emb
);
}
// Add skill depot abilities
AvatarSkillDepotData
skillDepot
=
G
enshin
Data
.
getAvatarSkillDepotDataMap
().
get
(
this
.
getAvatar
().
getSkillDepotId
());
AvatarSkillDepotData
skillDepot
=
G
ame
Data
.
getAvatarSkillDepotDataMap
().
get
(
this
.
getAvatar
().
getSkillDepotId
());
if
(
skillDepot
!=
null
&&
skillDepot
.
getAbilities
()
!=
null
)
{
for
(
int
id
:
skillDepot
.
getAbilities
())
{
AbilityEmbryo
emb
=
AbilityEmbryo
.
newBuilder
()
.
setAbilityId
(++
embryoId
)
.
setAbilityNameHash
(
id
)
.
setAbilityOverrideNameHash
(
G
enshin
Constants
.
DEFAULT_ABILITY_NAME
)
.
setAbilityOverrideNameHash
(
G
ame
Constants
.
DEFAULT_ABILITY_NAME
)
.
build
();
abilityControlBlock
.
addAbilityEmbryoList
(
emb
);
}
...
...
@@ -228,7 +228,7 @@ public class EntityAvatar extends GenshinEntity {
AbilityEmbryo
emb
=
AbilityEmbryo
.
newBuilder
()
.
setAbilityId
(++
embryoId
)
.
setAbilityNameHash
(
Utils
.
abilityHash
(
skill
))
.
setAbilityOverrideNameHash
(
G
enshin
Constants
.
DEFAULT_ABILITY_NAME
)
.
setAbilityOverrideNameHash
(
G
ame
Constants
.
DEFAULT_ABILITY_NAME
)
.
build
();
abilityControlBlock
.
addAbilityEmbryoList
(
emb
);
}
...
...
src/main/java/emu/grasscutter/game/entity/EntityClientGadget.java
View file @
fa9d703d
package
emu.grasscutter.game.entity
;
import
emu.grasscutter.game.GenshinPlayer
;
import
emu.grasscutter.game.GenshinScene
;
import
emu.grasscutter.game.World
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.game.props.PlayerProperty
;
import
emu.grasscutter.game.world.Scene
;
import
emu.grasscutter.game.world.World
;
import
emu.grasscutter.net.proto.AbilitySyncStateInfoOuterClass.AbilitySyncStateInfo
;
import
emu.grasscutter.net.proto.AnimatorParameterValueInfoPairOuterClass.AnimatorParameterValueInfoPair
;
import
emu.grasscutter.net.proto.ClientGadgetInfoOuterClass
;
...
...
@@ -24,7 +24,7 @@ import emu.grasscutter.utils.ProtoHelper;
import
it.unimi.dsi.fastutil.ints.Int2FloatOpenHashMap
;
public
class
EntityClientGadget
extends
EntityGadget
{
private
final
Genshin
Player
owner
;
private
final
Player
owner
;
private
final
Position
pos
;
private
final
Position
rot
;
...
...
@@ -36,7 +36,7 @@ public class EntityClientGadget extends EntityGadget {
private
int
targetEntityId
;
private
boolean
asyncLoad
;
public
EntityClientGadget
(
Genshin
Scene
scene
,
Genshin
Player
player
,
EvtCreateGadgetNotify
notify
)
{
public
EntityClientGadget
(
Scene
scene
,
Player
player
,
EvtCreateGadgetNotify
notify
)
{
super
(
scene
);
this
.
owner
=
player
;
this
.
id
=
notify
.
getEntityId
();
...
...
@@ -55,7 +55,7 @@ public class EntityClientGadget extends EntityGadget {
return
configId
;
}
public
Genshin
Player
getOwner
()
{
public
Player
getOwner
()
{
return
owner
;
}
...
...
src/main/java/emu/grasscutter/game/entity/EntityGadget.java
View file @
fa9d703d
package
emu.grasscutter.game.entity
;
import
emu.grasscutter.game.
Genshin
Scene
;
import
emu.grasscutter.game.World
;
import
emu.grasscutter.game.
world.
Scene
;
import
emu.grasscutter.game.
world.
World
;
public
abstract
class
EntityGadget
extends
G
enshin
Entity
{
public
abstract
class
EntityGadget
extends
G
ame
Entity
{
public
EntityGadget
(
Genshin
Scene
scene
)
{
public
EntityGadget
(
Scene
scene
)
{
super
(
scene
);
}
...
...
src/main/java/emu/grasscutter/game/entity/EntityItem.java
View file @
fa9d703d
package
emu.grasscutter.game.entity
;
import
emu.grasscutter.data.def.ItemData
;
import
emu.grasscutter.game.GenshinPlayer
;
import
emu.grasscutter.game.GenshinScene
;
import
emu.grasscutter.game.World
;
import
emu.grasscutter.game.inventory.GenshinItem
;
import
emu.grasscutter.game.inventory.GameItem
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.game.props.EntityIdType
;
import
emu.grasscutter.game.props.PlayerProperty
;
import
emu.grasscutter.game.world.Scene
;
import
emu.grasscutter.game.world.World
;
import
emu.grasscutter.net.proto.AbilitySyncStateInfoOuterClass.AbilitySyncStateInfo
;
import
emu.grasscutter.net.proto.AnimatorParameterValueInfoPairOuterClass.AnimatorParameterValueInfoPair
;
import
emu.grasscutter.net.proto.EntityAuthorityInfoOuterClass.EntityAuthorityInfo
;
...
...
@@ -28,16 +28,16 @@ public class EntityItem extends EntityGadget {
private
final
Position
pos
;
private
final
Position
rot
;
private
final
G
enshin
Item
item
;
private
final
G
ame
Item
item
;
private
final
long
guid
;
public
EntityItem
(
Genshin
Scene
scene
,
Genshin
Player
player
,
ItemData
itemData
,
Position
pos
,
int
count
)
{
public
EntityItem
(
Scene
scene
,
Player
player
,
ItemData
itemData
,
Position
pos
,
int
count
)
{
super
(
scene
);
this
.
id
=
getScene
().
getWorld
().
getNextEntityId
(
EntityIdType
.
GADGET
);
this
.
pos
=
new
Position
(
pos
);
this
.
rot
=
new
Position
();
this
.
guid
=
player
.
getNextG
enshin
Guid
();
this
.
item
=
new
G
enshin
Item
(
itemData
,
count
);
this
.
guid
=
player
.
getNextG
ame
Guid
();
this
.
item
=
new
G
ame
Item
(
itemData
,
count
);
}
@Override
...
...
@@ -45,7 +45,7 @@ public class EntityItem extends EntityGadget {
return
this
.
id
;
}
private
G
enshin
Item
getItem
()
{
private
G
ame
Item
getItem
()
{
return
this
.
item
;
}
...
...
Prev
1
2
3
4
5
6
7
8
…
14
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