mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 10:17:38 +01:00
Made teleporting between worlds 'smoother'. Thanks Raphfrk!
By: EvilSeph <evilseph@unaligned.org>
This commit is contained in:
parent
8dcebbc6fd
commit
c06f71942e
@ -12,6 +12,7 @@ import net.minecraft.server.Packet54PlayNoteBlock;
|
|||||||
import net.minecraft.server.Packet6SpawnPosition;
|
import net.minecraft.server.Packet6SpawnPosition;
|
||||||
import net.minecraft.server.ServerConfigurationManager;
|
import net.minecraft.server.ServerConfigurationManager;
|
||||||
import net.minecraft.server.WorldServer;
|
import net.minecraft.server.WorldServer;
|
||||||
|
import net.minecraft.server.ChunkCoordIntPair;
|
||||||
import org.bukkit.Achievement;
|
import org.bukkit.Achievement;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -194,6 +195,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
if (teleportSuccess) {
|
if (teleportSuccess) {
|
||||||
manager.server.tracker.trackPlayer(entity);
|
manager.server.tracker.trackPlayer(entity);
|
||||||
manager.server.tracker.untrackEntity(entity);
|
manager.server.tracker.untrackEntity(entity);
|
||||||
|
int cx = (int) location.getBlockX() >> 4;
|
||||||
|
int cz = (int) location.getBlockZ() >> 4;
|
||||||
|
for (int x = -10 ; x <= 10 ; x++ ) {
|
||||||
|
for (int z = -10 ; z <= 10 ; z++ ) {
|
||||||
|
ChunkCoordIntPair chunkPosition = new ChunkCoordIntPair(cx + x, cz + z);
|
||||||
|
if (entity.g.remove(chunkPosition)) {
|
||||||
|
newEntity.g.add(chunkPosition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
oldWorld.manager.removePlayer(entity);
|
oldWorld.manager.removePlayer(entity);
|
||||||
manager.players.remove(entity);
|
manager.players.remove(entity);
|
||||||
oldWorld.removeEntity(entity);
|
oldWorld.removeEntity(entity);
|
||||||
|
Loading…
Reference in New Issue
Block a user