Skip to content

Commit

Permalink
Fix client chunk loading on instant updates (Fixes #15)
Browse files Browse the repository at this point in the history
  • Loading branch information
games647 committed Jun 10, 2016
1 parent 3859f51 commit d9d2c41
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.logging.Level;

import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

Expand Down Expand Up @@ -107,8 +108,12 @@ private void sendUpdateSelf(WrappedGameProfile gameProfile) throws FieldAccessEx
//notify the client that it should update the own skin
protocolManager.sendServerPacket(receiver, respawn);

//refresh the chunk
Chunk chunk = receiver.getWorld().getChunkAt(receiver.getLocation());
receiver.getWorld().refreshChunk(chunk.getX(), chunk.getZ());

//prevent the moved too quickly message
receiver.teleport(receiver);
receiver.teleport(receiver.getLocation().clone());

//send the current inventory - otherwise player would have an empty inventory
receiver.updateInventory();
Expand Down

0 comments on commit d9d2c41

Please sign in to comment.