Jump to content

Recommended Posts

Posted

I want to teleport a player far away from his position.The problem is that if there are structures i don't know how detect them.

How can I prepare the destination area so that i can check if there are air blocks to put player in or search for nearby acceptable destination?

 

Thx.

Posted

To make it more clear...

I use this loop to load destination area:

 

for (int i = -radius; i <= radius; i++) {

    for (int j = -radius; j <= radius; j++) {

        worldserver.getChunkProvider().provideChunk((posX >> 4) + i, (posZ >> 4) + j);

    }

}

 

Then i use worldserver.getBlockState(pos1).getMaterial().blocksMovement() to see if a block is acceptable.

But if there is a structure the block result free as if the structure is not loaded.  

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.