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
ab6aa961
Commit
ab6aa961
authored
May 14, 2022
by
Yazawazi
Committed by
Melledy
May 13, 2022
Browse files
fix(serenitea pot): teleport & read born pos from lua
parent
95a06212
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/world/World.java
View file @
ab6aa961
...
@@ -268,6 +268,11 @@ public class World implements Iterable<Player> {
...
@@ -268,6 +268,11 @@ public class World implements Iterable<Player> {
}
else
if
(
oldScene
==
newScene
)
{
}
else
if
(
oldScene
==
newScene
)
{
enterType
=
EnterType
.
ENTER_GOTO
;
enterType
=
EnterType
.
ENTER_GOTO
;
}
}
// Home
if
(
2001
<=
newScene
.
getId
()
&&
newScene
.
getId
()
<=
2004
)
{
enterType
=
EnterType
.
ENTER_SELF_HOME
;
}
// Teleport packet
// Teleport packet
player
.
sendPacket
(
new
PacketPlayerEnterSceneNotify
(
player
,
enterType
,
enterReason
,
sceneId
,
pos
));
player
.
sendPacket
(
new
PacketPlayerEnterSceneNotify
(
player
,
enterType
,
enterReason
,
sceneId
,
pos
));
...
...
src/main/java/emu/grasscutter/server/packet/recv/HandlerTryEnterHomeReq.java
View file @
ab6aa961
package
emu.grasscutter.server.packet.recv
;
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.data.GameData
;
import
emu.grasscutter.game.world.Scene
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.TryEnterHomeReqOuterClass
;
import
emu.grasscutter.net.proto.TryEnterHomeReqOuterClass
;
import
emu.grasscutter.scripts.data.SceneConfig
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.packet.send.PacketTryEnterHomeRsp
;
import
emu.grasscutter.server.packet.send.PacketTryEnterHomeRsp
;
import
emu.grasscutter.utils.Position
;
import
emu.grasscutter.utils.Position
;
...
@@ -23,44 +25,16 @@ public class HandlerTryEnterHomeReq extends PacketHandler {
...
@@ -23,44 +25,16 @@ public class HandlerTryEnterHomeReq extends PacketHandler {
return
;
return
;
}
}
// Hardcoded for now
int
realmId
=
2000
+
session
.
getPlayer
().
getCurrentRealmId
();
switch
(
session
.
getPlayer
().
getCurrentRealmId
())
{
case
1
:
session
.
getPlayer
().
getWorld
().
transferPlayerToScene
(
session
.
getPlayer
(),
2001
,
new
Position
(
839
,
319
,
137
)
);
break
;
case
2
:
Scene
scene
=
session
.
getPlayer
().
getWorld
().
getSceneById
(
realmId
);
session
.
getPlayer
().
getWorld
().
transferPlayerToScene
(
Position
pos
=
scene
.
getScriptManager
().
getConfig
().
born_pos
;
session
.
getPlayer
(),
2002
,
new
Position
(
605
,
444
,
554
)
);
break
;
case
3
:
session
.
getPlayer
().
getWorld
().
transferPlayerToScene
(
session
.
getPlayer
().
getWorld
().
transferPlayerToScene
(
session
.
getPlayer
(),
session
.
getPlayer
(),
realmId
,
2003
,
pos
new
Position
(
511
,
229
,
605
)
);
);
break
;
case
4
:
session
.
getPlayer
().
getWorld
().
transferPlayerToScene
(
session
.
getPlayer
(),
2004
,
new
Position
(
239
,
187
,
536
)
);
break
;
default
:
session
.
send
(
new
PacketTryEnterHomeRsp
());
return
;
}
session
.
send
(
new
PacketTryEnterHomeRsp
(
req
.
getTargetUid
()));
session
.
send
(
new
PacketTryEnterHomeRsp
(
req
.
getTargetUid
()));
...
...
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