Commit graph

2 commits

Author SHA1 Message Date
bb2e47a917 Add player-spawn config for stuck players and limit teleport height
- Add PlayerSpawnConfig for separate spawn location when players are stuck in blocks
- Add PlayerSpawnConfigLoader for YAML parsing
- Update MineConfig with playerSpawn section and getSpawnForStuckPlayer() helper
- Update ConfigLoader to include playerSpawn configuration
- Update MineFileManager to preserve playerSpawn when saving
- Update MineResetHandler.teleportPlayers() to use player-spawn location
- Update defaults.yml with player-spawn documentation

- Limit findSafeTeleportLocation() to max 3 blocks upward search
  - Priority: same level nearby, then up (max 3), then down, then diagonal
  - Prevents teleporting players too high in the air

If player-spawn is not configured, falls back to teleport.location for backward compatibility.
2026-05-31 23:03:40 +02:00
061246511b Fix ghost blocks and add safe teleport
- Add BlockUpdateUtil for sending block update packets to clients
  - sendBlockUpdate() - update single block for visible players
  - sendRegionUpdate() - batch update for cuboid regions
  - sendLocationsUpdate() - efficient update for specific positions
  - refreshChunks() - full chunk resync if needed
  - findSafeTeleportLocation() - prevents player suffocation

- Update BukkitBlockSetter to send block updates after placement
  - Prevents ghost blocks when setting many blocks quickly
  - Uses main thread for packet sending after async block placement

- Update MineResetHandler.teleportPlayers() to use safe teleport
  - Finds safe location near configured teleport destination
  - Prevents players from spawning inside blocks

Ghost blocks occur when server sets blocks without notifying clients,
causing invisible blocks or desync. Fixed by explicit packet updates.
2026-05-31 22:56:38 +02:00