
SyImproveTPS
A high-performance TPS optimization plugin designed specifically for Minecraft Purpur 1.21.1 servers.
SyImproveTPS
A high-performance TPS optimization plugin designed specifically for Minecraft Purpur 1.21.1 servers.
Features
- Real-time TPS Monitoring - Accurately calculate current, average, minimum, and maximum TPS
- Multi-threading Optimization - Fully utilize multi-core CPU, solving the problem of single core underutilization
- Entity Optimization - Intelligently limit entity counts, protect important entities
- Chunk Optimization - Automatically unload chunks with no player activity
- Redstone Optimization - Limit update frequency of pistons and hoppers
- Async Processing - Avoid main thread blocking, prevent server lag
Installation
Requirements
- Server: Purpur 1.21.1
- Java: JDK 21 or higher (Class file version 65.0)
Installation Steps
- Download the latest version of
SyImproveTPS-1.0.0.jar - Place the JAR file in the server's
plugins/directory - Restart the server or run
/reload confirm - Configuration file will be automatically generated at
plugins/SyImproveTPS/config.yml
Configuration
Default Configuration
# Debug mode - enables more verbose logging
debug: false
# TPS monitoring settings
optimization:
# TPS threshold - optimization is triggered when TPS falls below this value
tps-threshold: 18.0
# Entity optimization settings
entity-optimization:
enabled: true
max-entities-per-chunk: 50
max-monsters: 100
max-animals: 150
# Chunk optimization settings
chunk-optimization:
enabled: true
unload-threshold: 300
# Redstone optimization settings
redstone-optimization:
enabled: true
piston-limit-per-tick: 50
hopper-limit-per-tick: 100
max-chunks-per-check: 10
# Check intervals (in ticks)
entity-check-interval: 100
chunk-check-interval: 600
redstone-check-interval: 20
# Multi-threading settings
threading:
pool-size: auto
enable-entity-threads: true
enable-chunk-threads: true
load-balance-interval: 100
Configuration Reference
| Config Option | Default | Description |
|---|---|---|
optimization.tps-threshold | 18.0 | TPS threshold for auto-optimization |
optimization.entity-optimization.max-entities-per-chunk | 50 | Maximum entities per chunk |
optimization.chunk-optimization.unload-threshold | 300 | Seconds before unloading inactive chunks |
optimization.redstone-optimization.max-chunks-per-check | 10 | Max chunks per redstone check |
threading.pool-size | auto | Thread pool size, auto uses all CPU cores |
Commands
| Command | Permission | Description |
|---|---|---|
/syimprovetps | syimprovetps.admin | Display plugin info |
/sitps status | syimprovetps.status | View server TPS and thread status |
/sitps optimize | syimprovetps.optimize | Manually trigger optimization |
/sitps reload | syimprovetps.reload | Reload configuration |
/sitps help | - | Display help |
Command Aliases
/sitps- Main command/tpsfix- Quick command
Permissions
| Permission | Default | Description |
|---|---|---|
syimprovetps.admin | OP | Admin permission |
syimprovetps.status | OP | View status permission |
syimprovetps.optimize | OP | Execute optimization permission |
syimprovetps.reload | OP | Reload configuration permission |
Performance Optimization Principles
1. TPS Monitoring
- Records execution time every tick
- Calculates average TPS every second
- Automatically triggers optimization when TPS is low
2. Multi-threading
- Entity processing thread pool
- Chunk processing thread pool
- Work-stealing algorithm (ForkJoinPool)
- Load balancing
3. Entity Optimization
- Limits entities per chunk
- Protects players, villagers, and tamed animals
- Prioritizes removal of items and monsters
4. Chunk Optimization
- Tracks chunk access time
- Automatically unloads inactive chunks
- Protects chunks with important entities
5. Redstone Optimization
- Async detection of redstone devices
- Limits chunks checked per iteration
- Prevents main thread blocking
FAQ
Q: Will this plugin cause server lag?
A: No. All operations that could block the main thread have been converted to async execution, including redstone detection and chunk traversal.
Q: How do I adjust thread pool size?
A: Set threading.pool-size in config.yml, recommended to be set to CPU core count or core count - 1.
Q: Why is TPS still low?
A: It may be caused by other plugins or the world itself. Use /sitps status to view detailed information and check for entity overload or chunk loading issues.
Q: Will it delete player structures?
A: No. The plugin only optimizes entities and chunk loading, and does not modify any blocks.
Building
Requirements
- JDK 21
- Maven 3.8+
Build Steps
# Clone repository
git clone https://github.com/yourusername/SyImproveTPS.git
cd SyImproveTPS
# Build
mvn clean package
# Output
# target/SyImproveTPS-1.0.0.jar
Tech Stack
- Java 21 - Modern Java features
- Maven - Build tool
- Paper API - Minecraft server API
- Concurrent Utilities - Concurrent processing
Note: This plugin is designed for Purpur 1.21.1 and may not work properly on other versions. Please backup your server data before use.
