Jump to content

Recommended Posts

Posted

I've been looking through the vanilla code, but I'm not finding how you get the respawn location.  Or if it's easier, how would you use the vanilla respawn system to place the player upon re-entering the overworld from a custom dimension? (doing this inside my dimension's Teleporter class)  I couldn't find where this is done on exiting the credits screen in the vanilla code.

Posted

ChunkCoordinates cc = player.getBedLocation(player.dimension);
if (cc != null) {
cc = EntityPlayer.verifyRespawnCoordinates(player.worldObj, cc, player.isSpawnForced(player.dimension));
}
if (cc == null) {
cc = player.worldObj.getSpawnPoint();
}

That is the meat of the code adapted from ServerConfigurationManager#respawnPlayer.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.