ChunkDeleter
适用于 Paper/Folia 服务器的先进区块清理插件,可自动删除玩家超过指定时间未进入的区块。
功能特性
? 高级调度
- Folia 支持:完全兼容 Folia 的线程化区域调度器
- Paper/Spigot 支持:在 Paper/Spigot 服务器上回退至标准调度器
- 线程安全:所有操作均使用适当的调度器以确保线程安全
- PerfoBooster 集成:自动检测并与 PerfoBooster 插件进行优化协同
?️ 智能保护系统
- 出生点保护:保护世界出生点周围的区块
- 玩家保护:保护在线玩家附近的区块
- 结构保护:保护包含重要结构的区块(如传送门、信标等)
- 实体方块保护:保护包含存储方块、熔炉等重要方块的区块
- 建筑检测:识别玩家建造的结构并加以保护
⚙️ 灵活配置
- CamelCase 配置:现代、简洁的配置格式
- 可配置的时间限制:设置区块必须闲置多久才会被删除
- 宽限期:采用两阶段删除机制,先标记再经过宽限期后删除
- 世界特定设置:可为特定世界启用或禁用该功能
- 性能调优:可调整批次大小和处理限制
? 基础追踪与日志记录
- SQLite 数据库:高效的区块访问追踪
- 文件日志:详细的区块删除日志保存至
logs/latest.txt
- 坐标日志:精确追踪区块和方块坐标
- 统计数据:提供扫描、删除和保护区块的详细统计信息
- 实时监控:实时追踪区块访问情况
?️ 易于管理
- 游戏内命令:提供完整的命令界面进行管理
- 日志管理:在游戏中查看、尾部和清除日志文件
- 权限系统:细粒度的权限控制
- 热重载:无需重启即可重新加载配置
- 手动清理:手动触发清理周期
- 自动优化:一键安装 PerfoBooster
安装方法
- 下载 ChunkDeleter JAR 文件
- 将其放入服务器的
plugins 文件夹中
- 重启服务器
- 在
plugins/ChunkDeleter/config.yml 中配置插件
- (可选)使用
/chunkdeleter optimize 安装 PerfoBooster 以获得更佳性能
命令
核心命令
/chunkdeleter help - 显示帮助信息
/chunkdeleter reload - 重新加载插件配置
/chunkdeleter stats - 显示区块统计信息
/chunkdeleter clean - 手动触发清理
/chunkdeleter toggle - 启用/禁用区块删除
/chunkdeleter info - 显示插件信息
高级命令
/chunkdeleter optimize - 下载并安装 PerfoBooster 插件
/chunkdeleter logs - 查看日志文件信息
/chunkdeleter logs tail [lines] - 显示最近的日志条目(1-50 行)
/chunkdeleter logs clear - 清除日志文件
/chunkdeleter debug - 切换调试模式(仅限管理员)
别名:/cd, /chunkdel
权限
chunkdeleter.* - 访问所有功能(默认:op)
chunkdeleter.admin - 完整的管理员访问权限
chunkdeleter.reload - 允许重新加载配置
chunkdeleter.stats - 查看统计信息
chunkdeleter.clean - 触发手动清理
chunkdeleter.toggle - 启用/禁用插件
chunkdeleter.optimize - 下载 PerfoBooster 插件
chunkdeleter.logs - 查看和管理日志文件
配置
插件使用现代 camelCase 配置格式。配置文件包含以下内容:
# 启用/禁用插件
enabled: true
# 区块删除设置
chunkDeletion:
timeBeforeDeletion: 30 # 区块有资格被删除前的分钟数
maxChunksPerCycle: 50 # 每个周期处理的最大区块数
cleanupInterval: 300 # 清理间隔(秒)
immediateDeletion: false # 启用立即删除或使用宽限期
gracePeriod: 5 # 标记区块的宽限期(分钟)
# 世界设置
worlds:
enabledWorlds: [] # 要启用的特定世界(为空 = 所有世界)
disabledWorlds: # 要排除的世界
- "world_nether"
- "world_the_end"
spawnProtectionRadius: 10 # 出生点周围受保护的区块半径
# 保护设置
protection:
protectPlayerChunks: true # 保护玩家附近的区块
playerProtectionRadius: 3 # 玩家保护半径(区块数)
protectStructures: true # 保护包含结构的区块
protectTileEntities: true # 保护包含存储/功能方块的区块
minTileEntities: 1 # 保护区块所需的最少实体方块数
# 性能设置
performance:
asyncScanning: true # 使用异步处理
maxProcessingTimePerTick: 10 # 每刻最大处理时间(毫秒)
batchSize: 25 # 操作的批次大小
# 日志设置
logging:
logDeletions: true # 将区块删除记录到控制台
logStatistics: true # 定期记录统计信息
statisticsInterval: 60 # 统计信息间隔(分钟)
debug: false # 启用调试日志
# 数据库设置
database:
type: SQLITE # 数据库类型(SQLITE, MYSQL 或 MEMORY)
sqliteFile: "chunkdata.db" # SQLite 文件名
mysql: # MySQL 设置(如果使用 MYSQL)
host: "localhost"
port: 3306
database: "chunkdeleter"
username: "username"
password: "password"
日志系统
ChunkDeleter 包含一个基本的日志系统,用于追踪所有区块删除操作:
日志文件位置
- 路径:
logs/latest.txt(位于服务器根目录)
- 格式:带详细坐标信息的带时间戳条目
- 线程安全:支持并发访问和高性能服务器
日志记录格式
[2024-01-15 14:30:25] CHUNK_DELETED: World=world, ChunkCoords=[15,11], BlockRange=[240,176] to [255,191], Info=Automatic cleanup
[2024-01-15 14:31:02] Manual cleanup triggered by admin
[2024-01-15 14:35:10] Cleanup cycle: Processed 45, Deleted 12, Protected 33 chunks
日志管理命令
/chunkdeleter logs - 查看日志文件信息和统计信息
/chunkdeleter logs tail 20 - 显示最后 20 条日志条目
/chunkdeleter logs clear - 清空日志文件(仅限管理员)
PerfoBooster 集成
ChunkDeleter 会自动检测并与 PerfoBooster 集成,以实现最佳性能:
自动检测
- 版本兼容性:检查是否运行 Minecraft 1.20.1 并支持 RegionScheduler
- 服务器兼容性:验证 Paper/Folia/Purpur 服务器软件
- 安装警告:如果推荐安装 PerfoBooster 但未安装,将显示警告
简易安装
- 一键安装:使用
/chunkdeleter optimize 自动下载并安装 PerfoBooster
- 版本管理:始终下载最新兼容版本
- 安全检查:防止在不兼容的服务器上安装
性能优势
当在兼容的服务器上安装 PerfoBooster 时:
- 区块操作期间减少服务器卡顿
- 优化红石和实体处理
- 提升大规模区块清理操作的效率
工作原理
- 区块追踪:插件通过移动和传送事件追踪玩家进入区块的时间
- 数据库存储:访问时间存储在 SQLite 数据库中以确保持久化
- 定期清理:可配置的清理周期会检查旧区块
- 保护检查:多种保护系统防止重要区块被删除
- 安全删除:区块会被安全卸载并从追踪列表中移除
- 基础日志记录:所有操作均记录详细的坐标和时间戳
性能注意事项
- 异步处理:大多数操作在异步线程中运行,以避免服务器卡顿
- 批量处理:区块按可配置的批次进行处理
- 高效数据库:SQLite 配合优化的查询和索引
- 智能缓存:频繁访问的区块会在内存中缓存
- Folia 优化:使用区域调度器以获得最佳的 Folia 性能
- PerfoBooster 集成:与 PerfoBooster 插件结合可进一步提升性能
兼容性
- Minecraft:1.20(PerfoBooster 需要 1.20.1)
- 服务器软件:Paper, Folia, Purpur, Spigot
- Java:17
- 可选依赖:PerfoBooster(可自动安装)
支持
如需支持,请加入 Discord:
ChunkDeleter
Advanced chunk cleaner plugin for Paper/Folia servers that automatically deletes chunks that haven't been entered by players for a specified amount of time.
Features
? Advanced Scheduling
- Folia Support: Fully compatible with Folia's threaded region scheduler
- Paper/Spigot Support: Falls back to standard scheduler for Paper/Spigot servers
- Thread-Safe: All operations use appropriate schedulers for thread safety
- PerfoBooster Integration: Automatic detection and optimization with PerfoBooster plugin
?️ Smart Protection System
- Spawn Protection: Protects chunks around world spawn points
- Player Protection: Protects chunks near online players
- Structure Protection: Protects chunks containing important structures (portals, beacons, etc.)
- Tile Entity Protection: Protects chunks with storage blocks, furnaces, and other important blocks
- Build Detection: Recognizes player-built structures and protects them
⚙️ Flexible Configuration
- CamelCase Configuration: Modern, clean configuration format
- Configurable Time Limits: Set how long chunks must be unused before deletion
- Grace Period: Two-phase deletion with marking and grace period
- World-Specific Settings: Enable/disable for specific worlds
- Performance Tuning: Adjustable batch sizes and processing limits
? Basic Tracking & Logging
- SQLite Database: Efficient chunk access tracking
- File Logging: Detailed chunk deletion logs saved to
logs/latest.txt
- Coordinate Logging: Precise chunk and block coordinate tracking
- Statistics: Detailed statistics on scanned, deleted, and protected chunks
- Real-time Monitoring: Track chunk access in real-time
?️ Easy Management
- In-Game Commands: Full command interface for management
- Log Management: View, tail, and clear log files in-game
- Permission System: Granular permission control
- Hot Reload: Reload configuration without restart
- Manual Cleanup: Trigger cleanup cycles manually
- Auto-Optimization: One-click PerfoBooster installation
Installation
- Download the ChunkDeleter JAR file
- Place it in your server's
plugins folder
- Restart your server
- Configure the plugin in
plugins/ChunkDeleter/config.yml
- (Optional) Use
/chunkdeleter optimize to install PerfoBooster for enhanced performance
Commands
Core Commands
/chunkdeleter help - Show help information
/chunkdeleter reload - Reload plugin configuration
/chunkdeleter stats - Show chunk statistics
/chunkdeleter clean - Manually trigger cleanup
/chunkdeleter toggle - Enable/disable chunk deletion
/chunkdeleter info - Show plugin information
Advanced Commands
/chunkdeleter optimize - Download and install PerfoBooster plugin
/chunkdeleter logs - View log file information
/chunkdeleter logs tail [lines] - Show recent log entries (1-50 lines)
/chunkdeleter logs clear - Clear the log file
/chunkdeleter debug - Toggle debug mode (admin only)
Aliases: /cd, /chunkdel
Permissions
chunkdeleter.* - Access to all features (default: op)
chunkdeleter.admin - Full administrative access
chunkdeleter.reload - Permission to reload config
chunkdeleter.stats - View statistics
chunkdeleter.clean - Trigger manual cleanup
chunkdeleter.toggle - Enable/disable plugin
chunkdeleter.optimize - Download PerfoBooster plugin
chunkdeleter.logs - View and manage log files
Configuration
The plugin uses a modern camelCase configuration format. The config file includes:
# Enable/disable the plugin
enabled: true
# Chunk deletion settings
chunkDeletion:
timeBeforeDeletion: 30 # Minutes before chunk is eligible for deletion
maxChunksPerCycle: 50 # Maximum chunks to process per cycle
cleanupInterval: 300 # Cleanup interval in seconds
immediateDeletion: false # Enable immediate deletion or use grace period
gracePeriod: 5 # Grace period in minutes for marked chunks
# World settings
worlds:
enabledWorlds: [] # Specific worlds to enable (empty = all worlds)
disabledWorlds: # Worlds to exclude
- "world_nether"
- "world_the_end"
spawnProtectionRadius: 10 # Chunk radius around spawn to protect
# Protection settings
protection:
protectPlayerChunks: true # Protect chunks near players
playerProtectionRadius: 3 # Player protection radius in chunks
protectStructures: true # Protect chunks with structures
protectTileEntities: true # Protect chunks with storage/functional blocks
minTileEntities: 1 # Minimum tile entities to protect chunk
# Performance settings
performance:
asyncScanning: true # Use async processing
maxProcessingTimePerTick: 10 # Max processing time per tick (ms)
batchSize: 25 # Batch size for operations
# Logging settings
logging:
logDeletions: true # Log chunk deletions to console
logStatistics: true # Log statistics periodically
statisticsInterval: 60 # Statistics interval in minutes
debug: false # Enable debug logging
# Database settings
database:
type: SQLITE # Database type (SQLITE, MYSQL, or MEMORY)
sqliteFile: "chunkdata.db" # SQLite file name
mysql: # MySQL settings (if using MYSQL)
host: "localhost"
port: 3306
database: "chunkdeleter"
username: "username"
password: "password"
Logging System
ChunkDeleter includes a basic logging system that tracks all chunk deletions:
Log File Location
- Path:
logs/latest.txt (in your server root directory)
- Format: Timestamped entries with detailed coordinate information
- Thread-Safe: Safe for concurrent access and high-performance servers
Log Entry Format
[2024-01-15 14:30:25] CHUNK_DELETED: World=world, ChunkCoords=[15,11], BlockRange=[240,176] to [255,191], Info=Automatic cleanup
[2024-01-15 14:31:02] Manual cleanup triggered by admin
[2024-01-15 14:35:10] Cleanup cycle: Processed 45, Deleted 12, Protected 33 chunks
Log Management Commands
/chunkdeleter logs - View log file information and statistics
/chunkdeleter logs tail 20 - Show the last 20 log entries
/chunkdeleter logs clear - Clear the log file (admin only)
PerfoBooster Integration
ChunkDeleter automatically detects and integrates with PerfoBooster for optimal performance:
Automatic Detection
- Version Compatibility: Checks for Minecraft 1.20.1 with RegionScheduler support
- Server Compatibility: Validates Paper/Folia/Purpur server software
- Installation Warnings: Shows warnings if PerfoBooster is recommended but not installed
Easy Installation
- One-Click Install: Use
/chunkdeleter optimize to automatically download and install PerfoBooster
- Version Management: Always downloads the latest compatible version
- Safety Checks: Prevents installation on incompatible servers
Performance Benefits
When PerfoBooster is installed on compatible servers:
- Reduced server lag during chunk operations
- Optimized redstone and entity processing
- Enhanced performance for large-scale chunk cleanup operations
How It Works
- Chunk Tracking: The plugin tracks when players enter chunks using move and teleport events
- Database Storage: Access times are stored in a SQLite database for persistence
- Regular Cleanup: Configurable cleanup cycles check for old chunks
- Protection Checks: Multiple protection systems prevent important chunks from deletion
- Safe Deletion: Chunks are safely unloaded and removed from tracking
- Basic Logging: All operations are logged with detailed coordinates and timestamps
Performance Considerations
- Async Processing: Most operations run asynchronously to avoid server lag
- Batch Processing: Chunks are processed in configurable batches
- Efficient Database: SQLite with optimized queries and indexing
- Smart Caching: Frequently accessed chunks are cached in memory
- Folia Optimization: Uses region schedulers for optimal Folia performance
- PerfoBooster Integration: Enhanced performance with PerfoBooster plugin
Compatibility
- Minecraft: 1.20 (PerfoBooster requires 1.20.1)
- Server Software: Paper, Folia, Purpur, Spigot
- Java: 17
- Optional Dependencies: PerfoBooster (auto-installable)
Support
For support, join discord:
评论 0
登录后参与评分
还没有评论,来抢沙发吧