LastLocation 是一款轻量、安全且现代的 Paper 插件,用于存储玩家的最后登出位置,并允许他们通过 /lastlocation 传送回该地点。
专为 Paper 1.20.10+ / 1.21+ 设计,基于 JDK 21 构建,专注于性能、安全性和数据完整性。
✨ 核心功能
? 最后登出位置
- 仅存储登出时的位置
- ❌ 不存储死亡位置
- 支持服务器重启/关闭
- 默认使用文件存储(每位玩家一个
.yml 文件)
- 兼容 SQLite / MySQL
⏱️ 在线 X 秒后保存
- 玩家在线达到 X 秒后才会保存登出位置
- 完全可配置
- 一旦保存生效,玩家会收到一条游戏内消息
- 支持 Essentials 风格的颜色代码 (
&)
示例:
save:
min-online-seconds: 10
ready-message: "&a您的登出位置现在正在被保存。"
? 安全传送系统
永远不会将玩家传送到危险方块中,例如:
岩浆 ?
仙人掌 ?
细雪 ❄️
传送门方块 ?
以及其他配置的危险区域
检查项包括:
脚部和头部可通过
玩家下方有实心地面
附近无危险方块
限制性能开销(每次传送的最大检查次数)
? 救援 / 防窒息系统
如果玩家意外陷入危险:
插件会自动在 ±10 格范围内搜索安全位置
当玩家受到窒息伤害时触发救援
在使用 /lastlocation 后的短时间内保持救援状态
⚔️ PvP / PvE 战斗冷却
玩家在战斗中时,/lastlocation 命令将被禁用
战斗状态包括:
PvP
PvE
投射物
其他插件取消的伤害事件
冷却机制行为:
每当玩家造成伤害或被击中时重置
战斗期间不会频繁发送消息
仅在玩家尝试使用命令时显示提示
示例:
combat:
cooldown-seconds: 15
? 自动数据迁移(无数据丢失)
自动从以下位置迁移数据:
旧的 locations.yml
旧的 plugins/LastLocation/Data/*.yml
同时支持 data/(小写)
自动生成备份
迁移操作仅运行一次
控制台输出清晰的摘要:
成功迁移的玩家数量
跳过的条目(缺少世界、无效 UUID、缺少数据)
? 更新时自动重建配置
检测到新插件版本安装时
自动执行以下操作:
备份旧配置文件
使用新默认值重建配置
保留所有现有值
无需手动重置配置
? 存储与性能
文件存储(默认):
每位玩家一个 .yml 文件
懒加载
极低的内存占用
兼容:
SQLite
MySQL
尽可能使用异步 IO
设置严格的性能上限以防止卡顿
? 命令
| 命令 |
描述 |
| /lastlocation |
传送至你的最后登出位置 |
| /lastlocation reload |
重载配置(仅限管理员) |
? 权限
lastlocation.use:
default: true
lastlocation.admin:
default: op
⚙️ 兼容性
✅ Paper 1.20.10+
✅ Paper 1.21.x
✅ Java / JDK 21
❌ 未在 Spigot / Bukkit 上测试
? 安装
将 LastLocation-x.x.x.jar 放入服务器的 /plugins 文件夹
启动或重启服务器
完成!?
❤️ 设计理念
安全第一
避免意外传送
最小化内存占用
更新时无数据丢失
开箱即用的生产级默认设置
LastLocation is a lightweight, safe, and modern Paper plugin that stores a player’s last logout location and allows them to teleport back to it using /lastlocation.
Designed for Paper 1.20.10+ / 1.21+, built with JDK 21, and focused on performance, safety, and data integrity.
✨ Core Features
? Last Logout Location
- Stores only the logout location
- ❌ Does NOT store death locations
- Supports server restart / shutdown
- Default FILE storage (one
.yml per player)
- Ready for SQLite / MySQL
⏱️ Save After X Seconds Online
- Logout location is saved only after a player has been online for X seconds
- Fully configurable
- Player receives an in-game message once saving becomes active
- Supports Essentials-style color codes (
&)
Example:
save:
min-online-seconds: 10
ready-message: "&aYour logout location is now being saved."
? Safe Teleport System
Never teleports players into dangerous blocks such as:
Lava ?
Cactus ?
Powder Snow ❄️
Portal blocks ?
Other configured hazards
Checks:
Feet & head are passable
Solid ground below the player
No dangerous blocks nearby
Performance capped (max checks per teleport)
? Rescue / Anti-Suffocation System
If a player somehow still ends up in danger:
The plugin automatically searches for a safe location within ±10 blocks
Rescue triggers on suffocation damage
Rescue is active for a short time after using /lastlocation
⚔️ PvP / PvE Combat Cooldown
/lastlocation is blocked while the player is in combat
Combat includes:
PvP
PvE
Projectiles
Damage events that are cancelled by other plugins
Cooldown behavior:
Resets every time the player hits or gets hit
No spam messages while in combat
Message is shown only when the command is used
Example:
combat:
cooldown-seconds: 15
? Automatic Data Migration (No Data Loss)
Automatically migrates data from:
Old locations.yml
Old plugins/LastLocation/Data/*.yml
Also supports data/ (lowercase)
Creates automatic backups
Migration runs only once
Clear console summary:
Successfully migrated players
Skipped entries (missing world, invalid UUID, missing data)
? Automatic Config Rebuild on Updates
Detects when a new plugin version is installed
Automatically:
Backs up the old config
Rebuilds the config using new defaults
Preserves all existing values
No manual config reset required
? Storage & Performance
FILE storage (default):
One .yml file per player
Lazy loading
Very low RAM usage
Ready for:
SQLite
MySQL
Async IO where possible
Hard performance caps to prevent lag
? Commands
Command Description
/lastlocation Teleport to your last logout location
/lastlocation reload Reload the config (admin only)
? Permissions
lastlocation.use:
default: true
lastlocation.admin:
default: op
⚙️ Compatibility
✅ Paper 1.20.10+
✅ Paper 1.21.x
✅ Java / JDK 21
❌ Not tested on Spigot / Bukkit
? Installation
Place LastLocation-x.x.x.jar into your /plugins folder
Start or restart the server
Done! ?
❤️ Design Philosophy
Safety first
Never unexpected teleports
Minimal RAM usage
No data loss on updates
Production-ready defaults
评论 0
登录后参与评分
还没有评论,来抢沙发吧