Skip to content

Commit d9d2c41

Browse files
committed
Fix client chunk loading on instant updates (Fixes #15)
1 parent 3859f51 commit d9d2c41

File tree

1 file changed

+6
-1
lines changed
  • bukkit/src/main/java/com/github/games647/changeskin/bukkit/tasks

1 file changed

+6
-1
lines changed

bukkit/src/main/java/com/github/games647/changeskin/bukkit/tasks/SkinUpdater.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.util.logging.Level;
2222

2323
import org.bukkit.Bukkit;
24+
import org.bukkit.Chunk;
2425
import org.bukkit.command.CommandSender;
2526
import org.bukkit.entity.Player;
2627

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

111+
//refresh the chunk
112+
Chunk chunk = receiver.getWorld().getChunkAt(receiver.getLocation());
113+
receiver.getWorld().refreshChunk(chunk.getX(), chunk.getZ());
114+
110115
//prevent the moved too quickly message
111-
receiver.teleport(receiver);
116+
receiver.teleport(receiver.getLocation().clone());
112117

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

0 commit comments

Comments
 (0)