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
41ec2316
Commit
41ec2316
authored
Jul 24, 2022
by
KingRainbow44
Browse files
Attempt to fix the `teleport` command.
parent
818bfb8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/command/commands/TeleportCommand.java
View file @
41ec2316
...
@@ -55,10 +55,15 @@ public final class TeleportCommand implements CommandHandler {
...
@@ -55,10 +55,15 @@ public final class TeleportCommand implements CommandHandler {
Position
target_pos
=
new
Position
(
x
,
y
,
z
);
Position
target_pos
=
new
Position
(
x
,
y
,
z
);
PlayerTeleportEvent
event
=
new
PlayerTeleportEvent
(
targetPlayer
,
PlayerTeleportEvent
.
TeleportType
.
COMMAND
,
PlayerTeleportEvent
event
=
new
PlayerTeleportEvent
(
targetPlayer
,
PlayerTeleportEvent
.
TeleportType
.
COMMAND
,
targetPlayer
.
getPos
(),
target_pos
);
targetPlayer
.
getPos
ition
(),
target_pos
);
event
.
call
();
event
.
call
();
boolean
result
=
!
event
.
isCanceled
()
||
targetPlayer
.
getWorld
().
transferPlayerToScene
(
targetPlayer
,
sceneId
,
event
.
getDestination
());
// Return if event was cancelled.
if
(
event
.
isCanceled
())
{
return
;
}
boolean
result
=
targetPlayer
.
getWorld
().
transferPlayerToScene
(
targetPlayer
,
sceneId
,
event
.
getDestination
());
if
(!
result
)
{
if
(!
result
)
{
CommandHandler
.
sendMessage
(
sender
,
translate
(
sender
,
"commands.teleport.exists_error"
));
CommandHandler
.
sendMessage
(
sender
,
translate
(
sender
,
"commands.teleport.exists_error"
));
}
else
{
}
else
{
...
...
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