Links
Tags
Creators
Details
Licensed MIT
Published 2 months ago
Updated 2 days ago
All versions
v0.5.3-26.x
Release
WeGui v0.5.3-26.xlast month 6
Compatibility
Minecraft: Java Edition
26.2
Platform
Fabric
Supported environments
Client-side
Required content
Changes
v0.5.3 更新内容
性能优化
- 修复 copy 大型建筑后严重卡顿的问题(v0.5.1 引入的回归)
- 根因:v0.5.1 移除节流后,每 tick 都调用 getClipboardBlocks(O(n) 遍历剪贴板)+ hashCode(O(n)),大型建筑下每秒上亿次操作
优化方案
- 用 holder 引用比较代替 getClipboardBlocks + hashCode(O(1) 代替 O(n))
- WE 每次 //copy 创建新的 ClipboardHolder 实例,== 比较即可判断内容是否变化
- 只有引用变化时才调用 getClipboardBlocks 重建 schematic
- origin 变化时用 placement.setOrigin() 而非重建 schematic(O(1) 代替 O(n))
- FIXED 模式滚轮移动、FOLLOW_PLAYER 模式玩家移动时,直接更新 placement 位置
- 不再重新读取剪贴板和重建 schematic
性能对比
| 场景 | v0.5.1/v0.5.2 | v0.5.3 |
|---|---|---|
| 大型建筑 //copy 后每 tick | O(n) getClipboardBlocks + O(n) hashCode | O(1) holder 引用比较 |
| FIXED 滚轮移动预览 | O(n) 重建 schematic | O(1) setOrigin |
| FOLLOW_PLAYER 玩家移动 | O(n) 重建 schematic | O(1) setOrigin |
| //copy、//flip、//rotate | O(n) | O(n)(不变,但只触发一次) |
说明
- 预览图跟随延迟与 v0.5.1 一致(无延迟),但不再卡顿
- 两分支(26.x 与 1.21.11)同步发布
Optional dependencies
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:M28QtA4l:ykYEh6g4"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:M28QtA4l:ykYEh6g4"
}




