Jump to content

[solved] Chunks don't load while teleporting to a location


pitman-87

Recommended Posts

Hey guys,

 

I have some issues with my TF2 teleporter mod, and I have no idea why that happens since 1.4.2 ( otherwise I wouldn ask here :) )

 

1. Sometimes (SMP and SSP) when a player gets teleported to a location, the chunks won't load anymore.

The player glitches around in the air (in creative mode it's possible to fly around).

After that happens, nothing gets loaded anymore (entities stay on their place, squids are floating in midair, no new chunk updates).

I know you wanna see some code, but I'm not sure if its relevant and if this is a bug of Forge or Minecraft or I missed something (maybe the server needs a call to pre-load some chunks since MC 1.4.2 or something)

Everything I'm doing is sending the server a teleport request (sending a packet with coordinates) and the server sets the new player location with:

player.setPositionAndUpdate(tp1.xCoord + 0.5F, tp1.yCoord + 0.3F, tp1.zCoord + 0.5F);

 

My position after teleport:

 

width=800 height=449http://www.abload.de/img/2012-11-14_20.39.17xnp0p.png[/img]

 

I still can fly around but no new chunk-updates:

 

width=800 height=449http://www.abload.de/img/2012-11-14_20.40.37yro1y.png[/img]

 

 

2.

 

I'm not sure if that issue exists since 1.4.2 or before.

When I'm using a portal to the nether I spawn sometimes inside some blocks under or beside the nether portal (both ways).

I have absolutely no idea why this is related to my teleporter mod, but many users reported that to me (and it happened to me sometimes too).

 

I appreciate your help :)

 

-pit

 

Link to comment
Share on other sites

You need to force update the area before sending the player there. Though it kills my mod download to help you take a look at my code

https://github.com/DarkGuardsman/GSM-TP/blob/master/src/common/aTele/Main/BlockTP.java

you need this to cause the chunks to load

world.markBlockAsNeedsUpdate(i, j + b, k);

Link to comment
Share on other sites

You need to force update the area before sending the player there. Though it kills my mod download to help you take a look at my code

https://github.com/DarkGuardsman/GSM-TP/blob/master/src/common/aTele/Main/BlockTP.java

you need this to cause the chunks to load

world.markBlockAsNeedsUpdate(i, j + b, k);

 

I tried it, but it don't help :(

Even force chunkloading don't help and sometimes it happens with the /tp x y z command too.

 

I quess I figured it out and the force chunkloading itself on startup was a problem.

If I remove it, both issues are gone.

 

Link to comment
Share on other sites

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.