Qiu's Optimization
轻量级 Minecraft Forge 模组优化器 —— 降低 1.20.1 服务器开销,提升效率
? 简介
Qiu's Optimization 是一款专为 Minecraft Forge 1.20.1 服务器设计的性能优化模组。通过三大核心机制:批量处理缓存、AI 节流控制和动态 TPS 调整,它显著降低了内置服务器的 CPU 负载,使响应更加流畅。
无需依赖,开箱即用,全自动运行。
✨ 功能特性
-
? TileEntity 批量处理
缓存所有模组方块实体(TileEntity),每秒统一处理一次,取代原版每刻遍历的方式,将遍历次数减少 20 倍。
-
? 智能实体 AI 节流
距离玩家超过 32 格的实体,其 AI 更新频率从每刻 0.05 秒降至每刻 2 秒,CPU 负载降低 70%。
-
? 动态 TPS 降级
当服务器 TPS 低于阈值时自动降低处理频率,防止服务器完全卡死。
-
⚙️ 完全可配置
所有参数均可在 .minecraft/config/qiusoptimization-common.toml 中自由调整。
-
? 轻量且无侵入性
仅包含 1 个 Java 文件,不修改原版核心逻辑,与绝大多数模组兼容。
? 安装方法
- 下载最新的
qiusoptimization-{version}.jar
- 将其放入
.minecraft/mods/ 目录
- 启动游戏或服务器(需要 Forge 47.4.4+)
⚙️ 配置说明 (1.0.1fix)
配置文件位置:.minecraft/config/qiusoptimization-common.toml
通用设置
[general]
# 是否记录泥土方块的注册名
logDirtBlock = true
# 魔法数字(示例配置)
magicNumber = 42
# 魔法数字介绍文本
magicNumberIntroduction = "The magic number is: "
# 示例物品列表
items = ["item1", "item2"]
性能优化设置
[optimization]
# TileEntity 缓存重建间隔(Tick)
# 默认值:20(1 秒) 范围:5 ~ 200
tileUpdateInterval = 20
# 降级模式的 TPS 阈值,低于此值时激活保护
# 默认值:16.0 范围:10.0 ~ 20.0
tpsThreshold = 16.0
# 是否启用 TileEntity 批量处理优化
enableTileOptimization = true
# 是否启用动态 TPS 降级
enableTPSDowngrade = true
实体优化设置
[entity]
# 实体优化模式
# BOOST - 增强模式:为实体分配更多 CPU 资源(推荐)
# REDUCE - 缩减模式:节省 CPU 以提升 FPS
# PRESERVE - 保留模式:不进行实体优化,保持原版行为
entityMode = "BOOST"
# 近距范围(格),在此范围内的实体保持原版更新频率
# 默认值:16 范围:4 ~ 64
nearDistance = 16
# 中距范围(格),在此范围内的实体获得轻微节流
# 默认值:32 范围:8 ~ 128
midDistance = 32
# 远距实体 AI 更新间隔(Tick)
# 默认值:10(0.5 秒) 范围:1 ~ 40
farInterval = 10
# 额外实体 Tick 间隔(Tick),设为 0 则禁用额外 Tick
# 默认值:4(0.2 秒) 范围:0 ~ 20
extraTickInterval = 4
# 每刻最大额外实体 Tick 数
# 默认值:20 范围:1 ~ 100
maxExtraEntityTicks = 20
物品合并设置
[item_merge]
# 是否启用物品合并
enableItemMerge = true
# 合并检测半径(格)
# 默认值:3 范围:1 ~ 10
itemMergeRadius = 3
# 每个区块的最大物品数量,超出部分将被移除(优先移除最旧的物品)
# 默认值:50 范围:10 ~ 200
maxItemsPerChunk = 50
# 物品合并检测间隔(Tick)
# 默认值:40(2 秒) 范围:10 ~ 100
itemMergeCheckInterval = 40
错峰区块保存设置
[chunk_saving]
# 是否启用错峰保存(将保存操作分散到多个 Tick 中执行)
enableStaggeredSaving = true
# 每批次保存的区块数量
# 默认值:5 范围:1 ~ 50
chunksPerSave = 5
# 保存间隔(Tick)
# 默认值:200(10 秒) 范围:20 ~ 400
saveInterval = 200
配置快速参考
| 配置键 |
默认值 |
描述 |
| tileUpdateInterval |
20 |
TileEntity 缓存重建间隔,数值越高 CPU 占用越低 |
| tpsThreshold |
16.0 |
降级模式的 TPS 阈值 |
| enableTileOptimization |
true |
禁用此项以恢复原版 TileEntity 行为 |
| enableTPSDowngrade |
true |
禁用此项以移除 TPS 降级保护 |
| entityMode |
BOOST |
实体模式:BOOST(增强)/REDUCE(缩减)/PRESERVE(保留) |
| nearDistance |
16 |
在此范围内的实体保持原版更新频率 |
| midDistance |
32 |
在此范围内的实体获得轻微节流 |
| farInterval |
10 |
远距实体 AI 更新间隔(Tick) |
| extraTickInterval |
4 |
额外实体 Tick 间隔,0 = 禁用 |
| maxExtraEntityTicks |
20 |
每刻最大额外实体 Tick 数 |
| enableItemMerge |
true |
禁用此项以停止物品合并 |
| itemMergeRadius |
3 |
合并检测半径,数值越高效率越高 |
| maxItemsPerChunk |
50 |
每个区块的物品上限 |
| itemMergeCheckInterval |
40 |
物品合并检测间隔 |
| enableStaggeredSaving |
true |
禁用此项以恢复原版保存机制 |
| chunksPerSave |
5 |
每批次保存的区块数量 |
| saveInterval |
200 |
保存间隔(Tick) |
三种实体模式
| 模式 |
描述 |
推荐用于 |
| BOOST |
加速模式:将节省的 CPU 分配给实体,使实体运动更流畅 |
高端设备(推荐) |
| REDUCE |
降频模式:降低远距离实体的更新频率,节省 CPU |
低端设备、FPS 优先 |
| PRESERVE |
保留模式:不进行实体优化,保持原版行为 |
测试/基准测试 |
更改配置后
必须重启服务器才能使配置更改生效。
性能调优建议
高端设备(实体流畅度优先):
- entityMode = "BOOST"
- extraTickInterval = 2
- maxExtraEntityTicks = 30
低端设备(FPS 优先):
- entityMode = "REDUCE"
- farInterval = 15
- tileUpdateInterval = 30
平衡配置(推荐):
- entityMode = "BOOST"
- extraTickInterval = 4
- maxExtraEntityTicks = 20
- tileUpdateInterval = 20
? 技术细节
| 优化项 |
原版机制 |
优化后 |
| 方块实体遍历 |
每个 Tick 全量扫描 |
缓存 + 每 20 个 Tick 批量处理 |
| 实体 AI 更新 |
所有实体每个 Tick 更新 |
近距离:每 10 个 Tick 更新一次,远距离:每 40 个 Tick 更新一次 |
| TPS 保护 |
无 |
低于阈值时自动节流至每 5 个 Tick |
? 性能测试结果(参考)
在包含 50+ 模组的整合包中测试(Alex's Mobs, Biomes O' Plenty, Spore 等):
| 指标 |
优化前 |
优化后 |
提升幅度 |
| 平均 TPS |
17.2 |
19.8 |
+15% |
| 实体 Tick 耗时 |
3.2ms |
0.9ms |
-72% |
| 区块加载时间 |
4.1ms |
2.3ms |
-44% |
? 兼容性
兼容:
- Forge 47.4.4+ (1.20.1)
- 绝大多数 Forge 模组
不兼容 / 注意:
- OptiFine:现代版本的 OptiFine 与 Forge 的 Mixin 系统冲突。建议使用 Rubidium + Oculus 作为替代方案。
- ModernFix:部分优化可能与 OptiFine 冲突。如果同时使用两者,请禁用
release_protochunks 及相关 Mixins。
? 指令
游戏内无指令。优化功能自动运行。可通过游戏日志查看启动状态:
[QiusOptimization] Optimization engine activated! (Tile batch processing + AI throttling)
[QiusOptimization] Current config: Tile interval=20t, AI interval=40t, TPS threshold=18.0
?️ 开发与构建
# Clone repository
git clone https://github.com/qym1421/qiusoptimization.git
# Build
./gradlew build
# Output located in build/libs/
? 许可证
本项目采用 MIT License 许可 — 可免费使用、修改和分发。
? 致谢
? 反馈与建议
⚠️ 免责声明
本模组通过缓存和节流机制优化性能。不会影响核心游戏玩法。在远距离下,部分实体行为(如 AI 响应速度)可能会略有延迟 — 这是正常的优化效果。
Made with ❤️ by QiuYM
Qiu's Optimization
Lightweight Minecraft Forge Mod Optimizer — Reduce Costs and Increase Efficiency for 1.20.1 Servers
? Introduction
Qiu's Optimization is a performance optimization mod designed specifically for Minecraft Forge 1.20.1 servers. Through three core mechanisms: Batch Processing Cache, AI Throttling, and Dynamic TPS Adjustment, it significantly reduces the CPU load of the built-in server, making response times smoother.
No dependencies required, works out of the box, fully automatic.
✨ Features
-
? TileEntity Batch Processing
Caches all mod block entities and processes them once per second, replacing the vanilla per-tick traversal, reducing traversal count by 20x.
-
? Smart Entity AI Throttling
Entities more than 32 blocks away from players have their AI update frequency reduced from 0.05s/tick to 2s/tick, reducing CPU load by 70%.
-
? Dynamic TPS Downgrade
Automatically reduces processing frequency when server TPS drops below threshold, preventing complete lockup.
-
⚙️ Fully Configurable
All parameters can be freely adjusted in .minecraft/config/qiusoptimization-common.toml.
-
? Lightweight & Non-invasive
Just 1 Java file, does not modify vanilla core logic, compatible with the vast majority of mods.
? Installation
- Download the latest
qiusoptimization-{version}.jar
- Place it in the
.minecraft/mods/ directory
- Start the game or server (Forge 47.4.4+)
⚙️ Configuration (1.0.1fix)
Configuration file location: .minecraft/config/qiusoptimization-common.toml
General Settings
[general]
# Whether to log the dirt block registry name
logDirtBlock = true
# Magic number (example config)
magicNumber = 42
# Magic number introduction text
magicNumberIntroduction = "The magic number is: "
# Example item list
items = ["item1", "item2"]
Performance Optimization Settings
[optimization]
# TileEntity cache rebuild interval (Ticks)
# Default: 20 (1 second) Range: 5 ~ 200
tileUpdateInterval = 20
# TPS threshold for downgrade mode, activates protection below this value
# Default: 16.0 Range: 10.0 ~ 20.0
tpsThreshold = 16.0
# Whether to enable TileEntity batch processing optimization
enableTileOptimization = true
# Whether to enable dynamic TPS downgrade
enableTPSDowngrade = true
Entity Optimization Settings
[entity]
# Entity optimization mode
# BOOST - Boost mode: Allocate more CPU to entities (recommended)
# REDUCE - Reduce mode: Save CPU to increase FPS
# PRESERVE - Preserve mode: No entity optimization, vanilla behavior
entityMode = "BOOST"
# Near distance (blocks), entities within this range keep vanilla update rate
# Default: 16 Range: 4 ~ 64
nearDistance = 16
# Mid distance (blocks), entities within this range get slight throttling
# Default: 32 Range: 8 ~ 128
midDistance = 32
# Far entity AI update interval (Ticks)
# Default: 10 (0.5 seconds) Range: 1 ~ 40
farInterval = 10
# Extra entity tick interval (Ticks), 0 disables extra ticks
# Default: 4 (0.2 seconds) Range: 0 ~ 20
extraTickInterval = 4
# Maximum extra entity ticks per tick
# Default: 20 Range: 1 ~ 100
maxExtraEntityTicks = 20
Item Merge Settings
[item_merge]
# Whether to enable item merging
enableItemMerge = true
# Merge detection radius (blocks)
# Default: 3 Range: 1 ~ 10
itemMergeRadius = 3
# Maximum items per chunk, excess items will be removed (oldest first)
# Default: 50 Range: 10 ~ 200
maxItemsPerChunk = 50
# Item merge detection interval (Ticks)
# Default: 40 (2 seconds) Range: 10 ~ 100
itemMergeCheckInterval = 40
Staggered Chunk Saving Settings
[chunk_saving]
# Whether to enable staggered saving (spread saves across multiple ticks)
enableStaggeredSaving = true
# Number of chunks to save per batch
# Default: 5 Range: 1 ~ 50
chunksPerSave = 5
# Save interval (Ticks)
# Default: 200 (10 seconds) Range: 20 ~ 400
saveInterval = 200
Configuration Quick Reference
| Config Key |
Default |
Description |
| tileUpdateInterval |
20 |
TileEntity cache rebuild interval, higher = lower CPU usage |
| tpsThreshold |
16.0 |
TPS threshold for downgrade mode |
| enableTileOptimization |
true |
Disable to restore vanilla TileEntity behavior |
| enableTPSDowngrade |
true |
Disable to remove TPS downgrade protection |
| entityMode |
BOOST |
Entity mode: BOOST/REDUCE/PRESERVE |
| nearDistance |
16 |
Entities within this range keep vanilla updates |
| midDistance |
32 |
Entities within this range get slight throttling |
| farInterval |
10 |
Far entity AI update interval (Ticks) |
| extraTickInterval |
4 |
Extra entity tick interval, 0 = disabled |
| maxExtraEntityTicks |
20 |
Max extra entity ticks per tick |
| enableItemMerge |
true |
Disable to stop item merging |
| itemMergeRadius |
3 |
Merge detection radius, higher = more efficient |
| maxItemsPerChunk |
50 |
Item limit per chunk |
| itemMergeCheckInterval |
40 |
Item merge detection interval |
| enableStaggeredSaving |
true |
Disable to restore vanilla saving |
| chunksPerSave |
5 |
Number of chunks to save per batch |
| saveInterval |
200 |
Save interval (Ticks) |
Three Entity Modes
| Mode |
Description |
Recommended For |
| BOOST |
Boost mode: Allocate saved CPU to entities, smoother entities |
High-end devices (recommended) |
| REDUCE |
Reduce mode: Lower far entity update frequency, save CPU |
Low-end devices, FPS priority |
| PRESERVE |
Preserve mode: No entity optimization, vanilla behavior |
Testing/benchmarking |
After Changing Configuration
You must restart the server for configuration changes to take effect.
Performance Tuning Recommendations
High-end devices (entity smoothness priority):
- entityMode = "BOOST"
- extraTickInterval = 2
- maxExtraEntityTicks = 30
Low-end devices (FPS priority):
- entityMode = "REDUCE"
- farInterval = 15
- tileUpdateInterval = 30
Balanced configuration (recommended):
- entityMode = "BOOST"
- extraTickInterval = 4
- maxExtraEntityTicks = 20
- tileUpdateInterval = 20
? Technical Details
| Optimization |
Vanilla Mechanism |
Optimized |
| TileEntity Traversal |
Full scan every Tick |
Cache + batch process every 20 Ticks |
| Entity AI Updates |
All entities every Tick |
Near: 10 Tick/update, Far: 40 Tick/update |
| TPS Protection |
None |
Auto-throttle below threshold to 5 Ticks |
? Performance Test Results (Reference)
Tested in modpacks with 50+ mods (Alex's Mobs, Biomes O' Plenty, Spore, etc.):
| Metric |
Before |
After |
Improvement |
| Average TPS |
17.2 |
19.8 |
+15% |
| Entity Tick Time |
3.2ms |
0.9ms |
-72% |
| Chunk Load Time |
4.1ms |
2.3ms |
-44% |
? Compatibility
Compatible with:
- Forge 47.4.4+ (1.20.1)
- The vast majority of Forge mods
Incompatible / Caution:
- OptiFine: Modern versions of OptiFine conflict with Forge's Mixin system. Consider using Rubidium + Oculus as an alternative.
- ModernFix: Some optimizations conflict with OptiFine. If using both, disable
release_protochunks and related Mixins.
? Commands
No in-game commands. Optimizations run automatically. Check startup status via game logs:
[QiusOptimization] Optimization engine activated! (Tile batch processing + AI throttling)
[QiusOptimization] Current config: Tile interval=20t, AI interval=40t, TPS threshold=18.0
?️ Development & Building
# Clone repository
git clone https://github.com/qym1421/qiusoptimization.git
# Build
./gradlew build
# Output located in build/libs/
? License
This project is licensed under the MIT License — free to use, modify, and distribute.
? Acknowledgements
? Feedback & Suggestions
⚠️ Disclaimer
This mod optimizes performance through caching and throttling. It does not affect core gameplay mechanics. Some entity behaviors (such as AI response speed) may be slightly delayed at long distances — this is a normal optimization effect.
Made with ❤️ by QiuYM
评论 0
登录后参与评分
还没有评论,来抢沙发吧