mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-28 02:13:51 +00:00
fix dimension travel throu teleport
This commit is contained in:
parent
599d504f55
commit
ebb7b2abfd
3 changed files with 20 additions and 3 deletions
|
|
@ -260,7 +260,22 @@ void __cdecl NativeTeleportEntity(int entityId, int dimId, double x, double y, d
|
|||
auto player = FindPlayer(entityId);
|
||||
if (player && player->connection)
|
||||
{
|
||||
player->connection->teleport(x, y, z, player->yRot, player->xRot);
|
||||
double outX = x, outY = y, outZ = z;
|
||||
bool cancelled = FirePlayerTeleport(entityId,
|
||||
player->x, player->y, player->z, player->dimension,
|
||||
x, y, z, dimId,
|
||||
2 /* PLUGIN */,
|
||||
&outX, &outY, &outZ
|
||||
);
|
||||
|
||||
if (!cancelled)
|
||||
{
|
||||
if (dimId != player->dimension)
|
||||
{
|
||||
MinecraftServer::getInstance()->getPlayers()->toggleDimension(player, dimId);
|
||||
}
|
||||
player->connection->teleport(outX, outY, outZ, player->yRot, player->xRot);
|
||||
}
|
||||
return;
|
||||
}
|
||||
ServerLevel *level = GetLevel(dimId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue