Перейти к содержимому
Mineforgian

BetterStructures-FAWE

Based on the improved branch of MagmaGuy/BetterStructures, made deep adaptations and performance optimizations for Paper + FastAsyncWorldEdit (FAWE).

Загрузки
365
Подписчики
3
Обновлён
24 февраля 2026 г.
Лицензия
GPL-3.0-or-later

Опубликован 6 февраля 2026 г.

BetterStructures-FAWE

中文

A performance-focused fork of MagmaGuy/BetterStructures, deeply adapted for the Paper + FastAsyncWorldEdit (FAWE) + Terra ecosystem.

Original plugin: GitHub | Modrinth


Key Differences from Upstream

1. FAWE Async Pasting (Zero Main-Thread Blocking)

The original plugin uses WorkloadRunnable to place blocks on the main thread in frame-split batches, which still causes TPS drops for large structures. This fork migrates all block pasting to FAWE asynchronous EditSession:

  • Normal blocks, NBT blocks (spawners, dispensers, etc.), and bedrock replacement are all handled on FAWE async threads
  • The WorkloadRunnable frame-splitting system and NMS fast paths have been removed
  • Entity spawning and chest filling are deferred back to the main thread after FAWE completes
  • The percentageOfTickUsedForPasting config option is now obsolete

Dependency change: Hard dependency changed from WorldEdit to FastAsyncWorldEdit. The plugin will automatically disable itself if FAWE is not detected on startup.

2. Terra / FAWE Compatibility

Resolves chunk state issues when using async world generators like Terra with FAWE:

  • Added ChunkValidationUtil: samples multiple positions to detect whether a chunk is fully generated, preventing structures from being placed on empty chunks
  • Uses Paper API getChunkAtAsync for async chunk loading, with PluginChunkTicket to keep chunks loaded during pasting
  • All world block access operations ensure chunks are loaded into memory first

3. PersistentDataContainer Chunk Marking

The original plugin relies on ChunkLoadEvent.isNewChunk() to identify new chunks, but after a server restart, previously generated but unmarked chunks get scanned again. This fork uses Bukkit PersistentDataContainer to persistently mark chunks:

  • Processed chunks are tagged with betterstructures:chunk_processed
  • No duplicate scanning of already-processed chunks after restart

4. Structure Location Persistence

Added StructureLocationManager and StructureLocationData to persist all generated structure locations to YAML files:

  • Each world is stored independently under structure_locations/
  • Records structure coordinates, type, schematic name, and bounding box dimensions
  • In-memory cache with automatic dirty-data saving every minute
  • Provides the data foundation for the mob tracking system

5. Mob Tracking & Respawn System

Added MobTrackingManager and MobSpawnConfig for tracking and respawning mobs within structures:

  • Records mob spawn configurations (position, type) for each structure
  • Supports Vanilla / EliteMobs / MythicMobs mob types
  • Spatial index (world-chunk) for fast nearby structure lookups
  • Triggers mob respawn checks when players approach
  • Fires StructureClearedEvent when all mobs in a structure are killed

6. Chinese Localization

All user-facing logs, command feedback, and menu text have been translated to Chinese across 27 files.


Requirements

Component Requirement
Minecraft 1.14+ (1.21+ recommended)
Server Paper (or forks like Purpur)
Java 21+
FastAsyncWorldEdit Required (vanilla WorldEdit is not supported)

Optional Dependencies

  • EliteMobs - Custom bosses
  • MythicMobs - Custom mobs
  • WorldGuard - Region protection
  • Terra / Terralith / Iris / TerraformGenerator - Custom world generation

License

GPL-3.0, same as upstream.

Credits

Ченджлог

2.1.2-FAWE.8Релиз1.21.9, 1.21.10, 1.21.11 · 24 февраля 2026 г.

Changed

  • 成功后标记语义: chunk_processed 语义调整为“仅在结构粘贴成功后写入”。扫描失败或粘贴失败不再写入标记,失败区块可在后续加载时重试;已成功区块仍保持幂等跳过。
  • Terra 兼容校验收敛: validateChunkBeforePaste 现在在粘贴前逐区块执行 isChunkFullyGenerated,任一校验失败即终止本次粘贴并返回失败信号。
  • 扫描一致性: TerrainAdequacy 对未加载区块改为保守失败,避免与 Topology 的未加载处理语义冲突。
  • 末地容错校验策略: 在 THE_END 维度,结构粘贴前区块校验改为按比例判定,只有当不合格区块达到 >= 2/3 时才放弃粘贴,避免一票否决导致末地生成率过低。
  • 区块生成判定调整: 末地优先使用 chunk.isGenerated() 作为生成完成判据,不再依赖 air_only/void_air 启发式对末地岛屿地形做硬拦截。
  • 默认生成间距调整: 默认距离参数改为 distanceSurface=15distanceShallow=20distanceDeep=20distanceSky=25distanceLiquid=40
  • 调试日志统一门控: 自然生成与粘贴链路中的 SKIP_PROCESSEDSCAN_FAILEDPASTE_FAILEDPASTE_SUCCESS_MARKED 以及相关调试日志统一接入 debug 开关门控。

Added

  • 可观测性日志事件: 新增/统一 SKIP_PROCESSEDSCAN_FAILEDPASTE_FAILEDPASTE_SUCCESS_MARKED 四类调试日志,覆盖自然生成关键路径。
  • Developer message 开关: 新增 debug.developerMessages 配置项(默认 false)。关闭时不再输出 [BetterStructures] Developer message 日志。
  • 热切换命令: 新增 /bs debug 命令,可在运行中快速切换 debug.developerMessages,无需执行 /bs reload
2.1.2-FAWE.7Релиз1.21.9, 1.21.10, 1.21.11 · 19 февраля 2026 г.

Added

  • 原版替换概率: 新增 mythicMobsOverride.vanillaReplaceChance 配置项(0-100),控制功能一(原版生物替换)的触发概率。默认 100(必定替换)。重生时同样适用概率判断,未通过则生成原版生物。不影响功能二(EM Boss 替换)。
2.1.2-FAWE.6Релиз1.21.9, 1.21.10, 1.21.11 · 18 февраля 2026 г.

Added

  • 实体类型白名单: 新增 mythicMobsOverride.entityTypeWhitelist.enabled 开关和 mythicMobsOverride.entityTypeWhitelist.types 列表。开启后,功能一(原版生物替换)仅替换白名单中指定的原版实体类型(如 ZOMBIE、SKELETON、CREEPER),其他类型保持原样。默认关闭,不影响功能二(EM Boss 替换)。
2.1.2-FAWE.5Релиз1.21.9, 1.21.10, 1.21.11 · 18 февраля 2026 г.

Added

  • 全局怪物黑名单: 新增 mythicMobsOverride.mobBlacklist 配置项,黑名单内的 MythicMobs 在功能一(原版生物替换)和功能二(EliteMobs Boss 替换)中均被跳过,不会被选为替换对象。
2.1.2-FAWE.4Релиз1.21.9, 1.21.10, 1.21.11 · 17 февраля 2026 г.

Added

  • MythicMobs 覆盖系统: 新增 MythicMobs 集成功能,当结构放置时自动将原版生物和 EliteMobs Boss 替换为 MythicMobs 等价生物。
    • 原版生物([spawn] 告示牌)可自动替换为具有相同基础类型的 MythicMobs 生物(如所有 Type: ZOMBIE 的 MM 生物替换原版僵尸)。
    • EliteMobs Boss([elitemobs] 告示牌)可替换为配置列表中的随机 MythicMobs Boss。
    • 新增 MobType 枚举值 VANILLA_MM_OVERRIDE(重生时重新随机选择)和 ELITEMOBS_MM_OVERRIDE(不重生)。
    • 插件启动时自动构建类型映射缓存,查询所有已注册 MythicMobs 并按 Bukkit EntityType 分组。
    • 新增配置项:mythicMobsOverride.enabledmythicMobsOverride.replaceVanillaMobsmythicMobsOverride.replaceEliteMobsBossesmythicMobsOverride.mythicBossList
    • 默认关闭,需手动启用并安装 MythicMobs 插件。
  • Boss 结构标记: 结构数据新增 bossStructure 字段,自动检测包含 EliteMobs 刷怪点或 MythicMobs Boss 的结构,并持久化存储。/bs info 命令现显示 Boss 结构状态。
2.1.2-FAWE.3Релиз1.21.9, 1.21.10, 1.21.11 · 15 февраля 2026 г.

Added

  • 结构信息查询命令: 新增 /bs info 命令,玩家站在已生成的结构范围内时可查看该结构的详细信息,包括建筑模板名称、结构类型、坐标、范围、怪物状态、创建时间等。
2.1.2-FAWE.2Релиз1.21.9, 1.21.10, 1.21.11 · 8 февраля 2026 г.

Changed

  • Async terrain scanning (P0): Moved runScanners() in NewChunkLoadEvent from synchronous runTaskLater to runTaskAsynchronously. All terrain fitness scanning (Topology.scan(), TerrainAdequacy.scan(), getBlock(), getHighestBlockAt()) now runs off the main thread, eliminating TPS impact during chunk exploration. markChunkProcessed() is dispatched back to the main thread for safe PersistentDataContainer writes.
  • Thread-safe paste dispatch (P0): FitAnything.paste() now detects whether it is called from the main thread or an async thread, and automatically schedules BuildPlaceEvent and Schematic.pasteSchematic() to the main thread when needed.
  • Parallel SchematicContainer initialization (P1): SchematicContainer creation (triple-nested clipboard scanning for chests, signs, spawns) now runs via parallelStream() during startup, with synchronized protection on the shared schematics multimap.
  • Async config file saving (P2): New AsyncConfigSaver utility snapshots FileConfiguration via saveToString() on the calling thread, then writes to disk asynchronously. Applied to SchematicConfigField.toggleEnabled() and ModulesConfigFields.validateClones().
  • Non-blocking WFC debug paste (P3): Replaced Thread.sleep(50) in WFCNode.debugPaste() with runTaskLater(1L), eliminating async thread blocking during WFC debug visualization.
  • dungeonScanner dispatched to main thread: WFCGenerator constructor is not async-safe (BossBar, non-thread-safe HashSet), so dungeonScanner is now explicitly scheduled back to the main thread from the async scan pipeline.

Fixed

  • dungeonScanner IndexOutOfBoundsException: Fixed pre-existing bug where ThreadLocalRandom.nextInt() used ModuleGeneratorsConfig.getModuleGenerators().size() as the upper bound instead of the filtered validatedGenerators.size(), causing potential IndexOutOfBoundsException when some generators are filtered out by world/environment checks.
2.1.2Релиз1.21.9, 1.21.10, 1.21.11 · 6 февраля 2026 г.

Based on upstream BetterStructures 2.1.2. All changes below are relative to the original release.

Fixed

PersistentDataContainer for chunk tracking: Replaced isNewChunk flag with PersistentDataContainer to reliably track processed chunks, preventing duplicate structure placement on server restart.
Cross-chunk structure placement: Fixed 5x5 transparent chunk holes by verifying chunk generation before world block access in createPasteBlocks() and assignPedestalMaterial(), ensuring all surrounding chunks are loaded before pasting.

Changed

Async block pasting via FAWE: Migrated block pasting from the WorkloadRunnable frame-splitting system to FAWE asynchronous EditSession, completely eliminating main thread blocking.
    Hard dependency changed from WorldEdit to FastAsyncWorldEdit in plugin.yml.
    FAWE is detected on startup; plugin disables itself if FAWE is not present.
    Removed WorkloadRunnable system; all blocks (including NBT) are now pasted through a single FAWE async EditSession.
    Bedrock checking uses editSession.getBlock() asynchronously.
    Entity spawning and chest filling are deferred to the main thread after async paste completion.
    Removed deprecated createSingleBlockClipboard method from WorldEditUtils.
Parallelized schematic loading: Schematic and module file loading now uses parallelStream(), significantly reducing plugin startup time. Timing logs added for diagnostics.

Added

Chinese localization: Full Chinese language support throughout the codebase.
README: Added project README.

Notes

The config option percentageOfTickUsedForPasting is now obsolete due to the fully async architecture.

Комментарии

Загружаем…