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
e9f5d984
Commit
e9f5d984
authored
Sep 16, 2022
by
github-actions
Browse files
Fix whitespace [skip actions]
parent
08f36195
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/entity/EntityGadget.java
View file @
e9f5d984
...
...
@@ -53,7 +53,7 @@ public class EntityGadget extends EntityBaseGadget {
public
EntityGadget
(
Scene
scene
,
int
gadgetId
,
Position
pos
,
Position
rot
)
{
super
(
scene
);
this
.
data
=
GameData
.
getGadgetDataMap
().
get
(
gadgetId
);
if
(
data
!=
null
&&
data
.
getJsonName
()!=
null
)
{
if
(
data
!=
null
&&
data
.
getJsonName
()!=
null
)
{
this
.
configGadget
=
GameData
.
getGadgetConfigData
().
get
(
data
.
getJsonName
());
}
this
.
id
=
getScene
().
getWorld
().
getNextEntityId
(
EntityIdType
.
GADGET
);
...
...
src/main/java/emu/grasscutter/game/entity/EntityMonster.java
View file @
e9f5d984
...
...
@@ -293,7 +293,7 @@ public class EntityMonster extends GameEntity {
monsterInfo
.
addWeaponList
(
weaponInfo
);
}
if
(
this
.
aiId
!=-
1
){
if
(
this
.
aiId
!=-
1
)
{
monsterInfo
.
setAiConfigId
(
aiId
);
}
...
...
src/main/java/emu/grasscutter/game/player/TeamManager.java
View file @
e9f5d984
...
...
@@ -626,10 +626,10 @@ public class TeamManager extends BasePlayerDataManager {
}
// Teleport player and set player position
try
{
try
{
this
.
getPlayer
().
sendPacket
(
new
PacketPlayerEnterSceneNotify
(
this
.
getPlayer
(),
EnterType
.
ENTER_TYPE_SELF
,
EnterReason
.
Revival
,
player
.
getSceneId
(),
getRespawnPosition
()));
player
.
getPosition
().
set
(
getRespawnPosition
());
}
catch
(
Exception
e
){
}
catch
(
Exception
e
)
{
this
.
getPlayer
().
sendPacket
(
new
PacketPlayerEnterSceneNotify
(
this
.
getPlayer
(),
EnterType
.
ENTER_TYPE_SELF
,
EnterReason
.
Revival
,
3
,
GameConstants
.
START_POSITION
));
player
.
getPosition
().
set
(
GameConstants
.
START_POSITION
);
// If something goes wrong, the resurrection is here
}
...
...
src/main/java/emu/grasscutter/game/props/EntityType.java
View file @
e9f5d984
...
...
@@ -8,60 +8,60 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import
it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap
;
public
enum
EntityType
{
None
(
0
),
Avatar
(
1
),
Monster
(
2
),
Bullet
(
3
),
AttackPhyisicalUnit
(
4
),
AOE
(
5
),
Camera
(
6
),
EnviroArea
(
7
),
Equip
(
8
),
MonsterEquip
(
9
),
Grass
(
10
),
Level
(
11
),
NPC
(
12
),
TransPointFirst
(
13
),
TransPointFirstGadget
(
14
),
TransPointSecond
(
15
),
TransPointSecondGadget
(
16
),
DropItem
(
17
),
Field
(
18
),
Gadget
(
19
),
Water
(
20
),
GatherPoint
(
21
),
GatherObject
(
22
),
AirflowField
(
23
),
SpeedupField
(
24
),
Gear
(
25
),
Chest
(
26
),
EnergyBall
(
27
),
ElemCrystal
(
28
),
Timeline
(
29
),
Worktop
(
30
),
Team
(
31
),
Platform
(
32
),
AmberWind
(
33
),
EnvAnimal
(
34
),
SealGadget
(
35
),
Tree
(
36
),
Bush
(
37
),
QuestGadget
(
38
),
Lightning
(
39
),
RewardPoint
(
40
),
RewardStatue
(
41
),
MPLevel
(
42
),
WindSeed
(
43
),
MpPlayRewardPoint
(
44
),
ViewPoint
(
45
),
RemoteAvatar
(
46
),
GeneralRewardPoint
(
47
),
PlayTeam
(
48
),
OfferingGadget
(
49
),
EyePoint
(
50
),
MiracleRing
(
51
),
Foundation
(
52
),
WidgetGadget
(
53
),
None
(
0
),
Avatar
(
1
),
Monster
(
2
),
Bullet
(
3
),
AttackPhyisicalUnit
(
4
),
AOE
(
5
),
Camera
(
6
),
EnviroArea
(
7
),
Equip
(
8
),
MonsterEquip
(
9
),
Grass
(
10
),
Level
(
11
),
NPC
(
12
),
TransPointFirst
(
13
),
TransPointFirstGadget
(
14
),
TransPointSecond
(
15
),
TransPointSecondGadget
(
16
),
DropItem
(
17
),
Field
(
18
),
Gadget
(
19
),
Water
(
20
),
GatherPoint
(
21
),
GatherObject
(
22
),
AirflowField
(
23
),
SpeedupField
(
24
),
Gear
(
25
),
Chest
(
26
),
EnergyBall
(
27
),
ElemCrystal
(
28
),
Timeline
(
29
),
Worktop
(
30
),
Team
(
31
),
Platform
(
32
),
AmberWind
(
33
),
EnvAnimal
(
34
),
SealGadget
(
35
),
Tree
(
36
),
Bush
(
37
),
QuestGadget
(
38
),
Lightning
(
39
),
RewardPoint
(
40
),
RewardStatue
(
41
),
MPLevel
(
42
),
WindSeed
(
43
),
MpPlayRewardPoint
(
44
),
ViewPoint
(
45
),
RemoteAvatar
(
46
),
GeneralRewardPoint
(
47
),
PlayTeam
(
48
),
OfferingGadget
(
49
),
EyePoint
(
50
),
MiracleRing
(
51
),
Foundation
(
52
),
WidgetGadget
(
53
),
Vehicle
(
54
),
SubEquip
(
55
),
FishRod
(
56
),
...
...
@@ -75,32 +75,32 @@ public enum EntityType {
Screen
(
64
),
EchoShell
(
65
),
UIInteractGadget
(
66
),
PlaceHolder
(
99
);
PlaceHolder
(
99
);
private
final
int
value
;
private
static
final
Int2ObjectMap
<
EntityType
>
map
=
new
Int2ObjectOpenHashMap
<>();
private
static
final
Map
<
String
,
EntityType
>
stringMap
=
new
HashMap
<>();
private
final
int
value
;
private
static
final
Int2ObjectMap
<
EntityType
>
map
=
new
Int2ObjectOpenHashMap
<>();
private
static
final
Map
<
String
,
EntityType
>
stringMap
=
new
HashMap
<>();
static
{
Stream
.
of
(
values
()).
forEach
(
e
->
{
map
.
put
(
e
.
getValue
(),
e
);
stringMap
.
put
(
e
.
name
(),
e
);
});
}
static
{
Stream
.
of
(
values
()).
forEach
(
e
->
{
map
.
put
(
e
.
getValue
(),
e
);
stringMap
.
put
(
e
.
name
(),
e
);
});
}
private
EntityType
(
int
value
)
{
this
.
value
=
value
;
}
private
EntityType
(
int
value
)
{
this
.
value
=
value
;
}
public
int
getValue
()
{
return
value
;
}
public
int
getValue
()
{
return
value
;
}
public
static
EntityType
getTypeByValue
(
int
value
)
{
return
map
.
getOrDefault
(
value
,
None
);
}
public
static
EntityType
getTypeByValue
(
int
value
)
{
return
map
.
getOrDefault
(
value
,
None
);
}
public
static
EntityType
getTypeByName
(
String
name
)
{
return
stringMap
.
getOrDefault
(
name
,
None
);
}
public
static
EntityType
getTypeByName
(
String
name
)
{
return
stringMap
.
getOrDefault
(
name
,
None
);
}
}
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