Skip to content

Celestial Forging Anvil to 26.1 锻星砧移植到26.1#3810

Draft
WhereisFff wants to merge 50 commits into
Anvil-Dev:dev/1.21/1.6from
WhereisFff:dev/26.1/1.6
Draft

Celestial Forging Anvil to 26.1 锻星砧移植到26.1#3810
WhereisFff wants to merge 50 commits into
Anvil-Dev:dev/1.21/1.6from
WhereisFff:dev/26.1/1.6

Conversation

@WhereisFff

Copy link
Copy Markdown
Contributor

只是能启动了,慢慢修(

QiuShui1012 and others added 30 commits May 21, 2026 03:13
* feat(multiphase): add merciless enchantments to required entries and processing

* chore: datagen

* refactor(recipe): update produce and consume handling in cauldron recipes

* refactor(recipe): update fluid production logic in cauldron recipes

* feat(fish_tank): add Powder Snow Fluid, add Fish Tank block and entities with usable functions and storaging

* fix(fish_tank): improve item handling in FishTankBlock and FishTankBlockEntity

* refactor(recipe):  Refactor HasCauldron 重构炼药锅条件 (Anvil-Dev#3441)

* refactor(fish_tank): enhance fluid handling and validation in FishTank and WrapUtils

* refactor(fish_tank): enhance fluid handling and validation in FishTank and WrapUtils

* refactor(recipe): add cauldron block validation in HasCauldron logic

* chore: Update Java version to 25 and dependencies for compatibility

* chore: update anvillib version to 2.0.0+snapshot.330

* refactor: update import statements to use com.mojang.logging.annotations for MethodsReturnNonnullByDefault

* refactor(advancements): update triggers to use HolderGetter for entity and item types

* refactor(recipe): update RegistrumRecipeProvider imports and enhance recipe handling

* refactor(item): reorganize item classes into tool package and add nullability annotations

* refactor: standardize float literals to uppercase 'F' and update import annotations

* feat(texture): add advanced_comparator_indicator.png

* refactor: replace ResourceLocation with Identifier for fluid handling

* feat: add new item handler classes and refactor existing ones for resource management

* fix: fix the wrong foojay version in gradle 9.x

* fix: fix some of compile errors (approximately 5200 remaining)

* feat(renderer): implement fluid handling and rendering for FishTank and FluidHandler components

* refactor: update useItemOn method to use InteractionResult and adjust imports for cauldron blocks

* refactor: remove unused Util imports and simplify interaction result handling in block classes

* refactor: streamline block entity rendering by introducing BlockEntityRendererSupport and updating render state handling

* refactor: enhance block entity rendering and state management for cauldron and mob blocks

* refactor: enhance rendering and state management for ascending block and cauldron outlet entities

* refactor: replace deprecated methods with updated alternatives for level height and random number generation

* refactor: remove unused imports and streamline code structure across multiple recipe and entity classes

* refactor: remove deprecated @contract annotations and update recipe classes to use new item stack templates

* refactor: update recipe serializers to use new ModRecipeSerializers and enhance recipe handling

* refactor: update item handling and recipe builders to use ItemStackTemplate for improved consistency

* refactor: update import statements to use the new advancements.criterion package for consistency

* refactor: update Gradle configuration for improved readability and performance

* refactor: simplify anvil result creation by removing unused parameters and improving method names

* refactor: update blockstate handling to use lambda expressions for improved readability and performance

* refactor: refactor model datagen

* refactor: update entity rendering and state management for improved clarity and performance

* Add AbstractArrowAccessor interface for Mixin access to AbstractArrow properties

* refactor: change Level type to ServerLevel in AnvilEvent and related classes

* feat: add consume effects for item properties and improve lambda usage in various classes

* feat: implement extensible block entity system with new interfaces and handlers

* refactor: update imports and method signatures for improved clarity and consistency

* refactor: update RenderType imports and replace GuiGraphics with GuiGraphicsExtractor in multiple files

* refactor: reorder and update imports for consistency across multiple classes

* refactor: rename BlockEntityRendererSupport to FeatureRendererSupport and update usages across multiple files

* refactor: update method signatures and variable names for consistency in GUI rendering classes

* refactor: replace PacketDistributor with ClientPacketDistributor in multiple screen classes

* refactor: update EmberSmithingMenu to use RecipesRecord for recipe management and clean up unused code

* refactor: remove unused RenderPipelines.GUI_OPAQUE_TEXTURED_BACKGROUND references and update method signatures for consistency

* refactor: migrate blocks to 1.26.1

* refactor: migrate entities to 1.26.1

* refactor: migrate entities to 1.26.1

* refactor: migrate events to 1.26.1 and cleanup blocks package

* refactor: replace org.jetbrains.annotations.Nullable with org.jspecify.annotations.Nullable and update method signatures for consistency

* refactor: rename package structure for block and function to item.armor and item.food respectively

* refactor: remove unused overrides from item JSON files and simplify method signatures in MagnetItem

* refactor: update event handling methods and improve code consistency in various classes

* refactor: update interaction result handling to use InteractionResult instead of InteractionResultHolder

* refactor: remove unused imports across multiple classes for cleaner code

* refactor: migrate utils to 26.1

* refactor: update entity references and method calls for consistency and clarity

* refactor: streamline ingredient handling and improve code clarity in crafting categories

* refactor: migrate mixins to 26.1

* refactor: migrate buttons to 26.1

* refactor: enhance output handling in FishTankBlockEntity with dedicated output proxy

* fix(fish_tank): correct outputting behaviour of fish tank

* refactor: update item references and improve tooltip handling for consumables

* refactor: update loot function registration and improve item properties handling

* fix: fix checkstyle

* fix: fix checkstyle

* refactor: remove unnecessary @SuppressWarnings annotations and improve method parameter names

* refactor: remove unnecessary @SuppressWarnings annotations and improve method parameter names

* refactor: clean up mixin registrations by removing unused entries

* refactor: migrate some rendering to 26.1

* refactor(hammer): migrate anvil hammer wheel to anvillib-wheel

* refactor(hammer): migrate spectral weapons' rendering to 26.1

* refactor: wahtever

* refactor: migrate tesla tower to 26.1

* refactor: migrate jei integration to 26.1

* refactor: migrate some rendering to 26.1

* refactor: migrate some item rendering to 26.1

* refactor: it compiles

* refactor: it runs

* refactor: fix datagen

* chore: run datagen

* chore: try to make datagen run

* fix: make laser render and bloom

* fix: fix datagen

* fix: fix datagen and parts of gui rendering

* fix: fix parts of gui rendering

* fix: fix jei

* fix: update anvillib version to 2.0.0+snapshot.379

* fix: make cut slabs generate

* fix: make cut slabs generate

* fix: update anvillib version to 2.0.0+snapshot.382

* fix: add accessors for ICacheInputOutputImpl and update recipe templates

* fix: enhance ActiveSilencerBlock shape and improve tooltip handling in GUI

* fix: add horizontalFacingBlock utility for block state generation

* fix: bugs

* fix: many bugs

* fix: many bugs

* fix: try fix checkstyle

* fix: try fix checkstyle

* fix: try fix checkstyle

* fix: try fix checkstyle

* fix: try fix checkstyle

* fix: try fix checkstyle

* fix: try fix checkstyle

* fix: try fix checkstyle

* fix: update annotations to use @NullMarked

* fix: replace javax/jetbrains annotations with jspecify annotations

* fix: remove proxy settings from gradle.properties

* fix: add constructor for Block$ShapePairKey in accesstransformer.cfg

* fix: remove unused public fields from accesstransformer.cfg

* fix: update CI configuration for NeoForge compatibility

* fix: add extra-mods configuration for anvil-lib in CI and pull request workflows

* fix: refactor item and block model generation to use NonNullBiConsumer for improved clarity

* fix(itemhandler): add direct access methods to PollableItemHandler to bypass overrides

* fix(rendering): fix some rendering bugs

* make checkstyle happy

* fix cut flint slab block model

* fix server launch bugs

---------

Co-authored-by: Gugle <administration@ztxy666.cn>
Co-authored-by: QiuShui1012 <150409561+QiuShui1012@users.noreply.github.com>
Co-authored-by: NightFish <101402767+dmzz-yyhyy@users.noreply.github.com>
Co-authored-by: NightFish <hk198580666@outlook.com>
* remove unused ide file

* fix: update Java toolchain version, modify anvil-lib dependency, and refactor voidDecay method

* fix power grid off center wireframe issue

* refactor(fluid): rename fluidtank package to fluid and update related imports

* refactor(block): remove unused methods and imports from SpaceOvercompressorBlock

* feat(fishtank): enhance fish rendering and caching mechanism in FishTankRenderer

* refactor(tooltip): update tooltip handling and event subscription in TooltipEventListener

* refactor(tooltip): update tooltip handling and event subscription in TooltipEventListener

* refactor(tooltip): update tooltip handling and event subscription in TooltipEventListener

---------

Co-authored-by: ZhuRuoLing <jkl-963@live.com>
…体验 (Anvil-Dev#3530)

* style(advancement): reorganize imports and apply code formatting

- Reorder and clean up imports in AdvancementLineHelper and
  ModAdvancementsHandler
- Add missing import for AnvilCraft in ModAdvancementsHandler

* refactor(item): remove ItemMixin and use vanilla CriteriaTriggers

- Delete ItemMixin.java, replacing its functionality with vanilla APIs
- Switch TopazItem from custom ModCriterionTriggers to net.minecraft.advancements.CriteriaTriggers
Clean up category files and remove unused event usage
…-Dev#3538)

* refactor: Update dependency configurations for AnvilLib and JEI

* ci: Add step to read library versions from gradle/libs.versions.toml

* ci: Update library version reading in CI configuration
)

* feat: Enhance block state verification in HammerChangeBlockPacket and add utility methods in StateUtil

* feat: Add HammerChangeBlockEvent and enhance block state verification in HammerChangeBlockPacket

* feat: Enhance HammerChangeBlockEvent and HammerChangeBlockPacket with player interaction checks and state comparison utility
…物品插入逻辑 (Anvil-Dev#3580)

* refactor(recipes): update RecipesRecord to use CLIENTSIDE and SERVERSIDE maps

* fix: correct item insertion condition and code style

- Fix inverted condition in BaseLaserBlockEntity#dropItemAfterBreak
  where the item insertion guard was negated wrongly
- Add braces to single-line if statements in ItemHandlerUtil

* feat(recipe): implement isSpecial method in AbstractProcessRecipe

* chore: make bloom enable for default

---------

Co-authored-by: QiuShui1012 <150409561+QiuShui1012@users.noreply.github.com>
* fix: /playsound crashes client

* fix: /playsound crashes client

* fix: over limit container capacity limit

* refactor(amulet): refactor amulet system

* fix(screen): fix parts of screens

* fix(screen): fix parts of screens

* fix: incorrect translation key

---------

Co-authored-by: ZhuRuoLing <jkl-963@live.com>
* fix: memory leak by DeflectionRingBlockEntity

* fix: unintended chunk load for `anvilcraft multiBlock getMainPartPos` command and network packets

* feat(amulet): add event system for amulet interactions and processing

* refactor(amulet): enhance raffle probability handling and improve definition matching logic

* refactor: update recipe retrieval methods to use level-specific context and improve memory management

---------

Co-authored-by: ZhuRuoLing <jkl-963@live.com>
…nvil-Dev#3624)

* refactor(amulet): rename package and update imports for event handling

* feat(amulet): add ImmuneDamageAmulet and ImmuneEntityAmulet with builder support

* refactor(amulet): streamline immune handling in ImmuneDamageAmulet and ImmuneEntityAmulet builders

* refactor(amulet): improve immune check logic in ImmuneEntityAmulet

* refactor(amulet): simplify return logic in ImmuneEntityAmulet
…nvil-Dev#3627)

* feat(amulet): add builder method to ImmuneEntityAmulet

* fix(screen): fix parts of screens

* chore(javadoc): replace all javadoc into markdown format, and fix chute bugs

* Change cullface (Anvil-Dev#3592)

* Change cullface

* Create pack.png

(cherry picked from commit 69d49fa)

* fix(amulet): correct predicate logic in GiveEffectAmulet and enhance special price updates in VillagerMixin

* refactor(gui): remove unused tooltip components and simplify tooltip handling in various screens

* refactor(anvil): update anvil tiers and key mappings for clarity and consistency

* fix(royalsmithing): update block validation to use ROYAL_SMITHING_TABLE

* feat(enchantments): add new enchantments to amethyst tools and implement DummyHolder for enchantment handling

* fix: fix lots of bugs

---------

Co-authored-by: XeKr <45423407+XeKr@users.noreply.github.com>
…ode framework for the storage system 添加存储系统的方块(无功能),实现存储系统的基础代码框架 (Anvil-Dev#3683)

* feat(category): add new category types and improve category handling

* feat(crate): add crate and large crate definitions with crafting and loot tables

* add asstes of storage stations (Anvil-Dev#3581)

* add asstes of storage stations

* rename hyperdimension_storage_station

* Update sort_by_number_reverse.png

* Update celestial_forging_anvil_amplifier.json

(cherry picked from commit 8680e89)

* Storage system block resources (Anvil-Dev#3569)

* Storage system block resources

* fix st

(cherry picked from commit a5bcf5d)

* feat(storage): add hyperdimension storage station and large crate definitions with model variants

---------

Co-authored-by: XeKr <45423407+XeKr@users.noreply.github.com>
…Anvil-Dev#3710)

* fix(anvil): update anvil tier 0 configuration to use tags instead of specific blocks

* refactor(formatting): improve documentation table formatting in FormattingUtil

* refactor(documentation): update code comments to use backticks for inline code formatting

* fix(serialization): update mod name identifier format in content types mapping
* feat(giantanvil): 增加撼地震波效果及震波弹跳管理

- 新增巨型铁砧震波效果包,实现服务器向客户端广播震波信息
- 引入震波方块弹跳管理器,客户端管理震波弹跳数据
- 实现震波弹跳的两阶段渲染事件监听器,提高渲染表现
- 巨型铁砧着陆时触发震波粒子与音效,支持配置开关与参数调节
- 震波作用范围内生物受到弹跳效果,提升交互反馈
- 移除离散的背包装饰,合并渲染逻辑到护甲渲染器
- 添加相关音效资源与字幕本地化支持
- 优化配置项,添加撼地效果粒子相关开关与参数配置

* refactor(seismic): 优化震波弹跳渲染与管理逻辑

- 移除旧的模型提取缓存机制,改为实时使用 ModelBlockRenderer 进行渲染
- 精简 SeismicBounceRenderEventListener 代码,合并两个订阅事件为单个渲染事件处理
- 修改 SeismicBounceManager 内部字段的访问,改用 this 关键字提高代码一致性
- 调整振幅计算和随机延迟生成逻辑,保证数值更准确稳定
- 修正 BounceData 方法中使用的成员变量访问,避免潜在错误
- 优化渲染时的位移与微扩缩,减少 z-fighting 现象
- 删除不再使用的导入和无用代码,提升代码整洁度

* feat(sound): 新增多种音效及字幕支持

- 添加plasma_jet、burning_heater等多种新音效事件
- 在语言文件中新增对应字幕文本
- 在ModSoundEvents注册新音效并定义其范围类型
- 更新sounds.json配置新增新音效及其关联声音文件
- 完善多语言文件中相关字幕条目以支持新音效显示

* fix(client): 修复震动弹跳渲染事件中的块模型渲染问题

- 在渲染前初始化 blockRenderer 避免空指针异常
- 获取方块模型和随机种子用于精确渲染
- 优化提交自定义几何体时的变量作用域
- 确保非空气且可渲染模型的方块正确渲染

* feat(heater): 添加燃烧加热器区块及实体实现

- 新增燃烧加热器区块 BurningHeaterBlock,带燃烧等级属性和交互逻辑
- 新增相应的区块实体 BurningHeaterBlockEntity,支持燃料消耗和燃烧时间管理
- 燃烧加热器实体实现粒子特效和音效表现,客户端燃烧效果同步
- 在踩踏时对生物造成热伤害,增加自定义伤害类型 heater_burn
- 注册燃烧加热器相关区块、实体、物品和数据组件
- 在加热器信息中添加燃烧加热器的热力产出逻辑
- 使用自定义音效替换巨型铁砧着地音效
- 更新语言文件添加燃烧加热器名称的英美两地版本
- 添加燃烧加热器的方块状态、模型、掉落物和矿镐挖掘标签相关数据文件

* refactor(burningheater): 使用新资源处理系统重构燃烧加热器逻辑

- 替换 ItemStackHandler 为 ItemStacksResourceHandler 来管理物品资源
- 在燃料消耗和插拔中引入事务机制保障操作原子性
- 改进物品插入和提取代码,支持资源数量操作和组件补丁
- 优化燃烧时间计算逻辑,确保燃料正确消耗及剩余物品处理
- 移除不再需要的旧导入和弃用方法,提升代码整洁度和可维护性
- 添加 @NullMarked 注解以增强空值安全检查

* refactor(block): 重构burning_heater方块模型和状态定义

- 删除旧的burning_heater方块状态和模型文件
- 在ModBlocks中为burning_heater方块添加动态多状态模型生成器
- 新增burning_heater三个状态的模型文件,细化不同燃烧等级的外观
- burnig_heater模型采用Blockbench设计,统一增加了光照效果和纹理映射
- 添加烟熏和点燃状态对应的材质覆盖层,增强视觉表现
- 保持方块可用矿镐挖掘属性不变

* feat(anvilcraft): 新增燃烧加热器及其相关功能

- 添加燃烧加热器方块及实体实现燃烧时间同步和燃烧状态管理
- 新增燃烧加热器Jade集成,提供服务器端数据和客户端显示支持
- 实现燃烧加热器的HUD显示工具提示,支持不同燃烧状态和燃烧时间显示
- 增加燃烧加热器燃料消耗的铁砧合成配方结果,用于合成时消耗燃烧时间
- 补充相关语言翻译文本,支持英文和其他语言燃烧加热器内容展示
- 优化燃烧加热器服务器数据包同步,保证客户端显示数据准确
- 添加燃烧加热器相关的注册、工具提示和客户端组件提供者实现

* feat(burning_heater): 优化燃烧加热器燃烧时间同步与界面显示

- 实现客户端燃烧时间本地倒计时估算,减少网络同步频率
- 添加服务器与客户端燃烧时间及燃料物品的专用同步数据处理
- 客户端显示燃料当前种类与数量,增强信息直观性
- 修正燃烧时间格式化函数,统一秒数计算方式
- 增加相关语言文本条目支持燃料显示
- 注册燃烧加热器物品能力,支持物品处理接口
- 优化燃烧状态变更时区块状态更新及邻居通知逻辑
- 在Jade插件中调整燃烧时间格式显示,去除多余参数

* refactor(block): 移除 BurningHeaterBlockEntity 中的同步数据方法

- 删除了用于接收服务端同步数据的 onSync 方法
- 简化了燃烧时间和物品处理逻辑
- 减少了冗余代码,以优化代码结构

* feat(charger): 新增放电器并支持FE充电功能

- 添加DischargerBlock及相关BlockEntity,实现放电功能
- 扩展ChargerBlockEntity支持基于Forge Energy(FE)的物品充电
- 更新交互逻辑,支持充电器和放电器的物品插入与取出
- 同步充电状态及进度到客户端,支持FE充电的客户端显示
- 新增Jade插件支持放电器及充电器的工具提示展示
- 注册FE能量能力适配器至指定武器及平台物品
- 玩家Tick事件中新增对带储能组件物品的自动充能处理
- 更新多处资源注册,添加放电器对应的语言、材质及渲染支持

* refactor(jade): 优化充电器与放电器数据提供器客户端实现,更新能量单位

- 移除服务端UI渲染代码,新增充电器与放电器的客户端数据提供器,实现进度条和能量显示的现代UI组件
- 统一充电器与放电器进度计算逻辑为适当的进度百分比表现,并支持FE充电状态不同显示
- 替换物品实体掉落旧调用为Containers.dropItemStack,保证坐标精度和规范化
- 升级电能存储单位显示,从传统千焦转为更现代化的MFE,并更新对应的语言资源文本
- 扩展EnergyWeaponMakeRecipe及相关配方中的存储能量数量,提升至640MFE,反映新单位调整
- 修正UnitUtil中电力单位格式化逻辑,优化数值截断与格式化输出
- 清理旧版jade提供器中的多余导入及无用代码,提高代码整洁性和可维护性

* fix(jade): 修复充电器和放电器的客户端提供者注册

- 替换了充电器和放电器的服务注册,改为客户端提供者实例
- 修正了Charger和Discharger的导入包路径,确保注册正确
- 保持其他Jade插件代码结构和注册逻辑不变

* fix(block): 修复充电器与放电器的资源提取方法

- 修正 ChargerBlockEntity 和 DischargerBlockEntity 中 extract 方法调用参数
- 处理 extract 方法时考虑槽位禁用状态,避免错误提取
- 使用 resource.toStack() 获取物品堆栈,优化 FE 能量检测逻辑
- 修复充电器中物品处理逻辑,改为设置正确的物品资源和数量

refactor(item): 移除飘升机背包多余的能量提示文本

- 删除飘升机背包界面中剩余能量及飞行时间的组合提示
- 删除相关语言文件中能量提示字符串,保留飞行时间显示
- 修改飘升机背包属性类型为 flight_time,简化数据展示
- 删除代码中对能量单位转换工具的引用和使用

* refactor(charger): 优化充能器和放电器的交互逻辑及物品处理

- 重构ChargerBlock中物品交互逻辑,合并充能器和放电器共用代码
- 移除ChargerBlockEntity和DischargerBlockEntity内不必要的插入和提取方法重写
- 新增停止处理的方法,确保提取物品时能正确中断充电或放电流程
- 修正物品插入逻辑,防止重复插入并确保物品类型有效
- 调整物品提取顺序和播放音效,提升交互体验
- 添加了无物品时右键使用的处理逻辑,支持直接提取物品
- 在数据生成中新增ionocraft_backpack配方,包含存储能量组件
- 更新ModItems注册ionocraft_backpack物品关联的物品组及数据生成方法

* fix(item): 修复背包物品类中的导入顺序和方法格式

- 调整了IonoCraftBackpackItem.java中import语句顺序,去除多余错误导入
- 修改appendHoverText方法的参数换行格式,提升代码可读性
- 修正RegistrumItemRecipeLoader.java中ModComponents导入顺序,保证代码规范

* feat(fe_collector): 添加FE收集器模块及相关资源支持

- 新增FeCollectorBlock及FeCollectorBlockEntity实现FE收集功能
- 注册FE收集器方块实体及渲染器
- 添加FE收集器对应的语言资源(en_us和en_ud)
- 增加FE收集器的物品模型、方块模型及掉落表
- 将FE收集器纳入使用镐子可挖掘的标签中
- 在ModCapabilities中注册FE收集器方块实体的FE能力
- 在客户端注册FE收集器渲染模型
- 统一PowerConverter各规格方块的输入时间常量定义
- 优化PowerConverterBlockEntity能量存储与推送逻辑,支持FE能量接口及网络数据同步
- 调整power_converter_big.json模型细节与分组结构

* feat(models): 优化power_converter系列模型并更新父模型引用

- 为power_converter_middle和power_converter_small模型添加"format_version"字段,优化模型定义
- 调整power_converter_middle中部分元素坐标与纹理UV映射,提升模型细节表现
- 在power_converter_small模型中增加多个细节方块元素及其旋转设置
- 修改power_converter_overload_big、power_converter_overload_middle和power_converter_overload_small模型父对象为对应的power_converter模型
- 删除overload模型中原有元素定义,依赖对应大、中、小型号的基础模型
- 更新模型组设置,优化模型结构层级管理
- 新增中文本地化资源“FE收集器”的方块、物品名称及其物品提示信息

* refactor(feCollector): 重构FE采集器以改进能量处理和状态同步

- 添加lastInputSide以跟踪能量输入方向并管理输入输出侧逻辑
- 优化能量插入和提取方法,限制方向相关操作
- 调整服务端逻辑,根据能量阈值更新producing状态
- 实现多个连接方向的过量能量推送,提升兼容性
- 更新客户端渲染,添加旋转效果以反映能量状态
- 改进方块模型和方块状态定义,支持方向旋转展示
- 清理并规范代码结构,移除未使用导入和参数
- 修正对能量能力获取的调用参数,避免潜在空指针
- 修正语言文件中的FE拼写,保持一致性

* feat(recipe): 添加FE收集器及燃烧加热器的配方并优化能量转换配方

- 新增燃烧加热器的方块粉碎配方,输入为熔炉
- 新增FE收集器的合成配方及相关语言支持
- 优化能量转换器三个阶段的合成和切割配方,改为无序合成提高灵活性
- 调整能量转换器中间与小型转换器的切割产出数量,提升产量
- 删除过时的小转大能量转换器配方及其解锁条件
- 新增配方解锁进度,保证新配方生效与游戏流程兼容

* refactor(power): 优化充电器和配方数据加载逻辑

- 调整充电器槽位遍历顺序并修改提取操作,只有加工槽取出物品会中断加工
- 限制漏斗只从输出槽抽取物品,避免非法抽取
- 改进慢速转移逻辑,输出槽满时维持加工槽物品状态,避免丢失
- 停止加工时同步清空总时间缓存,保证状态一致
- 修改充电器和放电器显示的时间格式,去除多余参数,使显示更准确优雅
- 重构电力转换器和收集器等方块的配方加载,改用ShapelessRecipeBuilder简化并优化解锁条件
- 增加FE收集器配方并调整电力转换器相关配方的堆叠数量及命名规范

* refactor(power): 优化ChargerBlock代码变量声明

- 将resourceIn变量声明为final,提升代码可读性和安全性
- 调整代码格式,保持一致性
- 无功能性改动,仅代码样式优化

* fix(api): 修复代码中的变量访问和格式化逻辑问题

- 纠正了ItemFEStorage中对stack成员变量的访问,使set操作正确调用实例变量
- 在UnitUtil中调整了条件语句块,确保格式化字符串的正确返回
- 修改IonoCraftBackpackHUD中color变量为final,增强代码可读性和安全性
- 优化了GiantAnvilBlock中playSound调用的换行格式,提升代码整洁度
- 调整了GiantAnvilShockEventListener中的导入语句顺序,保证代码规范一致性

* refactor(init): 调整ModHeaterInfos导入顺序

- 将BurningHeaterBlock和BurningHeaterBlockEntity导入移至相关导入区域的合适位置
- 优化代码导入顺序,提升代码规范性与可读性

* feat(teslatower): 新增敌对和中立实体过滤器

- 新增IsHostileFilter用于过滤敌对生物(Monsters)
- 新增IsNeutralFilter用于过滤中立生物
- TeslaFilter注册新过滤器IsHostileFilter和IsNeutralFilter
- 在多语言文件中新增对应的翻译条目
- 优化IsEntityIdFilter改用实体类型注册表查询并支持title显示
- IsPlayerIdFilter实现getTitle返回传入参数
- IsBabyFriendlyFilter修正为使用AgeableMob判断生物是否为幼体
- TeslaTowerBlockEntity实现雷击特效闪烁和播放雷击音效
- 雷击过程中新增事件触发与伤害处理逻辑,增加目标转换逻辑
- 新增白名单默认包含玩家过滤器IsPlayerFilter及实体ID使用命名空间格式
- TeslaTowerRenderer根据游戏时间控制雷击特效渲染显示时长
- TeslaTowerScreen过滤文本中支持根据过滤器title和参数匹配筛选结果
- ModRenderTypes中光照贴图和激光纹理绑定改进
- TeslaTowerBlock调整交互返回值为InteractionResult.TRY_WITH_EMPTY_HAND

* feat(gui): 优化特斯拉塔按钮文本显示

- 添加文本宽度检测与裁剪,防止长文本溢出按钮区域
- 短文本时实现水平居中显示
- 修正特斯拉塔过滤器语言文本的描述,更精准简洁
- 升级中英文资源文件统一过滤器标签显示内容
- 调整过滤器文本的字符方向问题,确保显示正确

* feat(tesla): 添加闪电杆标签及相关渲染和音效支持

- 新增LIGHTNING_RODS方块标签,替代原有硬编码判断
- 在ModRenderPipelines注册新的LIGHTNING渲染管线
- 修改TeslaTowerBlockEntity以使用新标签检测闪电杆
- 修复TeslaTowerBlockEntity中onLightningStrike调用方式,避免类型转换异常
- 更新声音资源,替换原entity.lightning_bolt.thunder事件为anvilcraft特定tesla_tower_strike音效
- 添加数据信息包处理方法,确保客户端数据正确同步

* fix(client): 修正实体类型筛选显示内容

- 将实体筛选列表中的文本从描述ID改为实体类型的键名
- 修复了筛选显示不准确的问题
- 改善筛选界面的信息表达一致性

* fix(tesla-tower): 修复数据同步与白名单状态保存问题

- 优化了 getUpdateTag 方法,确保 lastStrikeTime、targetEntityUUID 和 targetLightningRod 正确序列化
- 使用 putIntArray 保存目标避雷针位置
- 序列化白名单列表,避免数据遗漏
- 调整遍历代码格式,提高可读性
- 添加 setChanged() 调用,确保白名单增删改操作后实体状态被标记更改

---------

Co-authored-by: Pigeon_Nian <adove2005@163.com>
)

* fix(jade): 修复充电器与放电器进度条样式显示问题

- 将充电器进度条样式由透明改为嵌套框样式
- 将放电器进度条样式由透明改为嵌套框样式
- 提升进度条显示的视觉一致性和层次感

* feat(models): 添加离子背包及其耗尽状态的物品模型

- 创建 ionocraft_backpack 物品模型,继承 minecraft:item/generated
- 添加对应的纹理 layer0,路径为 anvilcraft:item/ionocraft_backpack
- 创建 ionocraft_backpack_exhausted 物品模型,继承 minecraft:item/generated
- 添加耗尽状态的纹理 layer0,路径为 anvilcraft:item/ionocraft_backpack_exhausted

* refactor(energy): 优化FE能量存储兼容性与事务一致性

- 使用ItemAccess作为首选模式,实现FE能量的原子交换,提高兼容性
- 增加SnapshotJournal回退模式,保证无上下文时能量状态事务一致
- 修改DischargerBlockEntity中获取EnergyHandler时不传入ItemAccess上下文
- 优化IonoCraftBackpackItem电容器消耗逻辑,避免能量已满时重复消耗
- 调整ModCapabilities的能量能力注册逻辑,统一使用ItemFEStorage.create自动选择模式

* feat(client): 添加飘升机背包飞行排气粒子效果及状态同步

- 新增排气粒子类型 ionocraft_backpack_exhaust,及其粒子提供器和资源描述
- 在客户端注册排气粒子渲染器,控制粒子轻微上升与渐隐效果
- 实现飞行状态同步包 IonoCraftBackpackFlyingPacket,服务端通知客户端玩家飞行状态
- IonoCraftBackpackItem 内追踪并同步玩家飞行状态,避免客户端预测误差
- 客户端事件处理器 IonoCraftBackpackClientHandler 根据同步状态渲染飞行排气粒子,屏蔽第一人称视角自家粒子
- 调整背包模型类名统一为 IonoCraftBackpackModel 并更新相应注册及调用
- 添加配置项 ionoCraftBackpackExhaustParticlesEnabled 允许开启或关闭飘升机背包排气粒子
- 修改飘升机背包装备 JSON 资源,修复纹理相关设置
- 优化 ItemFEStorage 类中的成员访问,统一使用 this 访问成员变量

* refactor(energy): 增加空指针保护和代码健壮性

- 添加对 itemAccess、journal 和 stack 为空的判断以防止空指针异常
- 优化能量插入和提取逻辑,避免无效操作
- 修改快照机制,明确调用上下文的实例方法
- 修正 DischargerBlockEntity 中 sendBlockUpdated 的调用对象
- 增加 preRemoveSideEffects 方法的空检查
- 清理未使用的导入语句,减少冗余代码
- 为 ModModelLayers 中的模型字段添加 Nullable 注解提高可读性

* fix(energy): 修正能量计算中的类型转换错误

- 在计算总能量时将能量值强制转换为long类型
- 确保乘法操作中使用long类型避免溢出
- 修复了基于itemAccess获取能量总量的逻辑错误

* fix(energy): 修正能量计算中的类型转换错误

- 在计算总能量时将能量值强制转换为long类型
- 确保乘法操作中使用long类型避免溢出
- 修复了基于itemAccess获取能量总量的逻辑错误

* refactor(feat): 优化FE充放电逻辑及物品槽限制

- 新增isFeCharged与isFeDischarged状态,标记充放电完成等待移出
- 限制物品只能从输入槽(slot 0)放入,漏斗只能从输出槽(slot 2)抽取
- 使用ItemAccess.forStack替代null参数获取EnergyHandler能力
- 充电和放电完成时重置计时并更新状态标志
- 持久化新增的FE完成状态字段,确保数据一致性

* fix(backpack): 修复背包飞行状态内存泄漏问题

- 添加客户端世界切换时清理飞行玩家集合的逻辑,避免内存泄漏
- 在玩家退出时清理背包飞行状态追踪器
- 监听玩家登出事件,触发背包飞行状态的清理操作

* fix(client): 修正 IonocraftBackpackModel 导入及实例化命名错误

- 修改导入语句中的类名由 IonoCraftBackpackModel 更正为 IonocraftBackpackModel
- 更新静态变量声明中的类名匹配修正后的导入
- 更正模型注册时的层定义方法引用名称
- 修复模型创建方法中实例化类名错误,确保正确生成模型实例

* fix(client): 修正背包模型类名拼写错误

- 将类名从 IonoCraftBackpackModel 修改为 IonocraftBackpackModel
- 修正构造函数名以匹配类名变化
- 保持模型部分引用不变

* feat(tags): 扩展方块标签和元素集合

- 新增栅栏门标签至方块标签集合
- 将炉子、熔炉、烟熏炉、各种箱子、比较器、TNT 和信标等方块元素加入标签集合
- 优化客户端物品渲染逻辑,新增药丸盒渲染支持及状态管理
- 更新英文语言文件,添加新配置项和修正多个物品提示文本
- 对部分提示文本内容进行了修正和补充,包括增加 shift 状态下的详细说明

* refactor(client): 优化 PillSelectorSupport 中的内容访问

- 移除 PillBoxItem 类中未使用的导入
- 在 PillSelectorSupport 中将 contents 改为使用 this.contents 明确引用
- 保持代码风格一致,提升可读性和维护性

* feat(client): 支持过滤器物品的渲染与交互功能

- 新增 FilterSelectorSupport 支持过滤器物品的渲染显示
- ClientEventListener 中添加对 FILTER 物品的渲染调用及状态管理
- FilterItem 移除不必要的 FilterTooltip 相关代码
- FilterMenu 修正货架插槽纵向位移微调为 18 像素
- 实现过滤器物品内容的界面元素布局与渲染细节调整

* Update BlockTagLoader.java

* Update hammer_removable.json

---------

Co-authored-by: Pigeon_Nian <adove2005@163.com>
…ks to the blacklist. 优化26.1的弹跳方块渲染并添加黑名单 (Anvil-Dev#3768)

* feat(client): 优化震波弹跳效果的渲染和方块过滤逻辑

- 添加黑名单方块判断以过滤不适合弹跳效果的附属方块
- 修正弹跳管理器,仅对非黑名单方块进行震波弹跳计算
- 替换震波渲染逻辑,使用原版光照管线的MovingBlockRenderState
- 移除对ModelBlockRenderer的依赖,支持实体、裁剪及透明方块的渲染
- 简化震波渲染事件的代码结构,提高可维护性

* Update SeismicBounceManager.java

---------

Co-authored-by: Pigeon_Nian <adove2005@163.com>
…nvil-Dev#3773)

* fix item collector

* fix potentional bugs

* fix potentional bugs x2
* fix multiblock display

* fix multiblock display x2
- 在 DamageTypeTagLoader 中将 heaterBurn 伤害类型加入 NO_KNOCKBACK 标签
- HeaterBlock 改用自定义 ModDamageTypes.heaterBurn 伤害来源替代 hotFloor
- 更新 no_knockback.json 数据文件,包含 heater_burn 伤害类型
- 修正 hammer_removable.json 文件格式问题,确保 JSON 正确闭合

Co-authored-by: Pigeon_Nian <adove2005@163.com>
Port Temperature, PressureType, WindSpeed, RingType, LiquidCoverage,
CelestialBodyType, CelestialBodyClass from 1.21.1 CFA to
block/entity/celestial/ package. These are pure enums with no
internal CFA dependencies — ported without API changes.

Remove originals from 1.21.1 CFA/ to prevent duplicate class errors.
Port 9 files from 1.21.1 CFA to block/entity/celestial/:
- CelestialBodyData (sealed interface permitting 4 body types)
- RockyPlanetData, GiantPlanetData, StarData (record impls)
- SpecialCelestialBodyData (without fromRecipe - needs Phase 3 recipe)
- CelestialRefactorOption (megastructure refactoring data)
- PlanetaryResourceSet (weighted resource container with NBT)
- PlanetResourceInput, SpecialCelestialBodyInput (recipe inputs)

TempleDemandInput deferred to Phase 3 (depends on TempleDemandRecipe).
Replace old 1.21.1 CompoundTag read methods:
- getString() → getStringOr(key, default)
- getBoolean() → getBooleanOr(key, default)
- getInt() → getIntOr(key, default)
- getFloat() → getFloatOr(key, default)
- getUUID() → getUUID(key).orElse(null)
- Remove contains() checks where get*Or handles missing keys
- ResourceLocation → Identifier (26.1 rename)
- ModelResourceLocation → Identifier (class removed in 26.1)
- tag.putUUID/getUUID → tag.store/read with UUIDUtil.CODEC
- tag.getList(key, type) → tag.getList(key) returns Optional
- tag.contains(key) → tag.getList(key).ifPresent()
Port TempleDemandInput, TempleDemandRecipe, SpecialCelestialBodyRecipe,
PlanetResourceRecipe from 1.21.1 CFA to 26.1.

Changes:
- ResourceLocation → Identifier
- Add SERIALIZER static field to each recipe (26.1 pattern)
- Inline energyToTemperature in SpecialCelestialBodyRecipe
  (CelestialBodyMatcher not yet ported)
- Register PLANET_RESOURCE, SPECIAL_CELESTIAL_BODY, TEMPLE_DEMAND
  types and serializers in ModRecipeTypes/ModRecipeSerializers
- Restore SpecialCelestialBodyData.fromRecipe()

Deferred: PlanetResourceGenerator (complex MC API dependencies)
Changes for TempleDemandRecipe, SpecialCelestialBodyRecipe,
PlanetResourceRecipe:

- getSerializer(): RecipeSerializer<?> → RecipeSerializer<T> (typed)
- getType(): RecipeType<?> → RecipeType<T> (typed)
- assemble(T, HolderLookup.Provider) → assemble(T) (deprecated, single param)
- Remove getResultItem(HolderLookup.Provider)
- Remove canCraftInDimensions(int, int)
- Add placementInfo() → PlacementInfo.NOT_PLACEABLE
- Add recipeBookCategory() → RecipeBookCategories.CRAFTING_MISC
- Add showNotification() → false
In 26.1, RecipeSerializer is an interface instantiated directly:
  new RecipeSerializer<>(CODEC, STREAM_CODEC)

No inner Serializer class is needed. Also adds missing group() method.
Port PlanetResourceGenerator with 26.1 API changes:
- ResourceLocation → Identifier
- lootTable.getRandomItems(params, seed, consumer) — consumer-based API
- BuiltInRegistries.ITEM.getKey() → builtInRegistryHolder().key().location()
- Use AtomicInteger for thread-safe counting in consumer callback

Port 3 recipe data loaders:
- PlanetResourceRecipeLoader, SpecialCelestialBodyRecipeLoader,
  TempleDemandRecipeLoader (ResourceLocation → Identifier)

Fix SpecialCelestialBodyRecipe.resolveItem():
- BuiltInRegistries.ITEM.get() now returns Optional<Holder.Reference<Item>>
…ason

PlanetResourceGenerator fixes:
- level.getRecipeManager().getAllRecipesFor() → RecipesRecord.getRecipes().byType()
- ResourceKey.location() → ResourceKey.identifier()
- entityType.create(serverLevel) → entityType.create(level, EntitySpawnReason.COMMAND)
- BuiltInRegistries.ITEM.getKey() → builtInRegistryHolder().key().identifier()

Recipe loader fixes:
- RegistrumRecipeProvider import: add .generators. subpackage
- RecipeUnlockedTrigger import: critereon → criterion
- RecipeOutput.accept(Identifier, ...) → accept(ResourceKey<Recipe<?>>, ...)
….of(namespace,path)

- Add missing import for dev.dubhe.anvilcraft.recipe.sync.RecipesRecord
- living.getLootTable() now returns Optional<ResourceKey<LootTable>>
- Identifier.of(path) needs namespace parameter: Identifier.of("minecraft", path)
- Identifier.of(namespace,path) → Identifier.withDefaultNamespace/fromNamespaceAndPath
- Include user's unused import cleanup in PlanetResourceGenerator and SpecialCelestialBodyRecipe
@WhereisFff WhereisFff marked this pull request as draft June 22, 2026 17:58
@anvil-craft

Copy link
Copy Markdown

⚠️ Dangerous command requires approval:

echo "=== 获取 PR 元数据 ===" && python3 -c "
import urllib.request, json
req = urllib.request.Request('https://api.github.com/repos/Anvil-Dev/AnvilCraft/pulls/3810')
req.add_header('Accept', 'application/...

Reason: script execution via -e/-c flag

Reply /approve to execute, /approve session to approve this pattern for the session, /approve always to approve permanently, or /deny to cancel.

@anvil-craft

Copy link
Copy Markdown

现在我已拥有足够信息来撰写完整审查意见。


代码审查摘要

PR: #3810 — Celestial Forging Anvil to 26.1 (锻星砧移植)
作者: WhereisFff
状态: Draft("只是能启动了,慢慢修")
结论: 评论(架构迁移正确,但明确为 WIP)


全局概况

指标 数值
文件总数 5,040
Java 源文件 1,730
生成资源 2,856
差异总行数 291,553
CFA 相关 Java 文件 43 (新增 15 个 megastructure handler + 渲染器)

✅ 架构迁移正确

1. API 迁移准确

  • ResourceLocationIdentifier — 全局正确替换 ✅
  • org.jetbrains.annotations.Nullableorg.jspecify.annotations.Nullable
  • saveAdditional(CompoundTag, HolderLookup)saveAdditional(ValueOutput) / loadAdditional(ValueInput) — 26.1 新持久化 API 用法正确 ✅
  • MobSpawnTypeEntitySpawnReason
  • propagatesSkylightDown(BlockState, BlockGetter, BlockPos)propagatesSkylightDown(BlockState)
  • @OnlyIn(Dist.CLIENT) 相关处理:CelestialBodyMatcherBufferedImage 替代 NativeImage,规避了服务端不可用问题,注释清晰 ✅

2. 新 megastructure 系统设计合理

  • CfaMegastructureManager 统一管理 13 种 handler,通过 LinkedHashMap 维护注册顺序 ✅
  • 每个 handler 实现 IMegastructureHandler 接口,职责单一 ✅
  • 持久化通过 CfaMegastructureManager.saveAdditional/loadAdditional 正确委托给每个 handler ✅

3. 渲染系统迁移正确

  • CFARenderer 使用 26.1 新渲染 API:SubmitNodeCollectorCameraRenderStateStandaloneModelKey
  • CachedBlockEntityRenderingPipeline 集成 ✅

4. 网络包更新

  • LaserEmitPacket 新增 gamma 字段,StreamCodec 用法正确 ✅
  • 服务端/客户端处理逻辑新增对 CelestialForgingAnvilLaserInterfaceBlockEntity 的支持 ✅

5. 空值安全

  • 新增的 BlockEntity tick 逻辑中一致使用了 if (level == null || level.isClientSide()) return; 守卫 ✅
  • @Nullable 注解在 Block 的 newBlockEntitygetTickergetPlacementState 等方法上正确标注 ✅

⚠️ 值得关注的问题

1. 🔴 zh_tw / zh_hk 缺失锻星砧翻译

en_us.json 新增了 7 个 CFA 相关 lang key(含 celestial_forging_anvil_portal),zh_cn.json 已有完整翻译("锻星砧"、"锻星砧增幅器"、"锻星砧流体接口"等),但 zh_tw.jsonzh_hk.json 中完全缺失这些 key。

en_us 新增: 487 行 (含 "celestial_forging_anvil_portal" 等)
zh_cn 新增: 691 行 (翻译完整)
zh_tw 新增:  67 行 (无任何 CFA 翻译) ← 缺失
zh_hk 新增:  67 行 (无任何 CFA 翻译) ← 缺失

建议: 在 zh_tw 和 zh_hk 中补充对应的繁体/粤语翻译,至少包括:

  • block.anvilcraft.celestial_forging_anvil → 鍛星砧
  • block.anvilcraft.celestial_forging_anvil_amplifier → 鍛星砧增幅器

2. ⚠️ Draft 状态确认

作者明确说明"只是能启动了,慢慢修"。从代码结构看:

  • 部分 handler(如 ColliderHandler)未实现 saveAdditional/loadAdditional 持久化
  • acceleratorHandler 虽然已保存,但 ColliderHandler 等可能还未完成

这本身不构成 bug(因为是 draft PR),但建议后续补全所有 handler 的持久化。

3. ⚠️ 生成资源 EOF 换行符

差异中有 2,680 处 \ No newline at end of file 标记,主要集中在 generated/resources/ 下的模型 JSON / 方块状态 JSON / 进度 JSON 中。可能需要在数据生成器中添加换行符配置。

建议后续抽空修复数据生成器配置,确保所有输出文件末尾有换行符。


🔍 细节发现

文件 发现 建议
CelestialForgingAnvilLaserInterfaceBlock.java 新增 ACTIVE 状态属性 确认 ACTIVE 状态是否有对应的模型切换/渲染变更
BaseMegastructureHandler.java 基础 handler 框架,保存 name 字段 注意子类共享此持久化路径,继承体系正确
CfaMegastructureManager.java:59 AcceleratorHandler 通过 @Getter 暴露而非通过 handlers map 设计意图明确——加速器是特殊角色 ✅
CelestialForgingAnvilBlockEntity.java 同时实现 IPowerConsumerIPowerProducer 注意 getInputPower()getOutputPower() 的返回值需在后续迭代中确认正确性
NeoforgeBlock.java block/ 移至 block/workstation/ + EntitySpawnReason 迁移 需要确认所有引用方已同步更新 ✅(主类 import 已改)

📋 审查清单检查

类别 状态 备注
正确性 ⚠️ WIP Draft PR,许多 feature 待完成
安全性 无明显注入/凭据泄露/NPE
代码质量 架构清晰,职责分离好
测试 未触及测试文件(后续需补充)
性能 无明显的 N+1 或阻塞操作
文档 ⚠️ zh_tw/zh_hk 翻译缺失
API 兼容性 26.1 迁移准确

总结: 这是一个大型架构迁移 PR,将锻星砧系统从旧版 API 移植到 NeoForge 26.1。迁移工作整体质量很高——所有关键 API 变更(ResourceLocationIdentifierNullable 注解、持久化系统、渲染系统、网络系统)都得到了正确处理。新引入的 megastructure handler 体系结构清晰。当前最大问题为 zh_tw/zh_hk 翻译缺失;其余缺失属于 Draft 阶段的预期内容。合并前需翻译补完后可继续推进。

@anvil-craft

Copy link
Copy Markdown

现在我有足够的信息来进行一次全面的审查了。让我汇总发现。


代码审查摘要

PR #3810 — Celestial Forging Anvil 移植到 26.1(锻星砧移植到26.1)
作者: WhereisFff | 分支: dev/26.1/1.6dev/1.21/1.6

总体评估

这是将 锻星砧(Celestial Forging Anvil)完整移植到 Minecraft 26.1 / NeoForge 26.1 的超大规模 PR,涉及 5,040 个文件291K 行差异。其中 1,730 个 Java 源文件(~80K 行实际逻辑变更)、2,856 个生成资源文件和 438 个手工资源文件。

作者标注"只是能启动了,慢慢修(",说明这是 WIP 阶段——可启动运行但还有待完善。


🔴 关键问题

1. getShadeBrightness 仍使用旧 3-参数签名(需确认 26.1 兼容性)

虽然 CFA 核心 Block 正确地迁移了 propagatesSkylightDown(BlockState) → 1-参数新签名,但有 6 个文件添加了带 3 参数的旧签名:

文件 位置
CelestialForgingAnvilPortalBlock.java 新文件
CelestialForgingAnvilInterfacePlaceholderBlock.java 新文件
HyperdimensionStorageStationBlock.java 修改
LargeCrateBlock.java 修改
BaseBatchCraftingBlock.java 修改
FishTankBlock.java 修改

如果 26.1 没有保留重载版本,这些会导致编译失败。建议: 统一改为 getShadeBrightness(BlockState state) 单参数版本。

2. Xmaxerrs = 10000 标识大量预期编译残留

options.compilerArgs << "-Xmaxerrs" << "10000"

设置 10,000 个错误上限意味着目前有大量编译错误待处理。这是移植 PR 的正常状态,但建议在 PR 描述中列出已知的编译错误清单,方便 reviewer 判断是否遗漏了不该出现的错误。

3. 生成资源文件大量缺少行末换行

No newline at end of file: 2680 处

所有生成资源文件(进度 JSON、配方、战利品表、item models)均缺少 POSIX 行末换行。这很可能是因为数据生成器在 26.1 下的行为变化。建议: 运行一次完整的数据生成后再提交,或者在数据生成代码中统一追加换行。


⚠️ 警告

1. explosion / item 等 Mixin 被移除但未确认替代方案

删除了以下 Mixin:

  • ExplosionMixin → 仅替换为 ServerExplosionMixin,缺少客户端爆炸相关修改
  • ItemMixin → 无替代 Mixin
  • EntityTypeBuilderMixin → 无替代 Mixin
  • compat.EmbChunkBuilderMeshingTaskMixin / compat.SodiumChunkBuilderMeshingTaskMixin → 如果使用 Embeddium/Sodium 的玩家依赖这些兼容性 Mixin,可能会遇到渲染崩溃

建议: 确认这些 Mixin 的功能在 26.1 中是否有对应的 API 替代方案,如果确认不再需要,在 PR 描述中说明。

2. 客户端 Mixin 大量移除可能导致渲染兼容性问题

移除了 GameRendererMixinGuiGraphicsMixinItemFrameRendererMixinItemOverridesMixinLevelRendererMixinMinecraftClientMixin,这些被替换为 GuiGraphicsExtractorMixinItemSubmitMixinSubmitNodeCollectionMixin。新旧 Mixin 功能覆盖关系不明确,可能遗漏了部分渲染修改。

3. getActiveMegastructureIndex() 在 search 执行时被依赖

startSearch() 方法中,searching = true 在 search ticks 开始前设置。但 getInputPower() 也依赖 searching 状态来计算功耗。如果在 search tick 期间 megastructure 状态变更会导致功率计算不一致。建议在 getInputPower() 中对 search 状态的功耗计算增加确认锁或检查条件。


💡 建议

1. 优秀的架构设计——Megastructure 委托模式

CfaMegastructureManager + IMegastructureHandler 接口模式非常清晰,14 种巨型结构(Excavator、Extractor、Collider、Dyson Sphere、Penrose Sphere、Wormhole Stabilizer 等)各自独立实现,通过 LinkedHashMap 注册。这种设计使得未来添加新巨型结构时无需修改核心 BlockEntity 逻辑。

2. CelestialBodyMatcher 的 NativeImage → BufferedImage 迁移很聪明

注意到注释中明确说明了 26.1 下 NativeImage 变为 @OnlyIn(Dist.CLIENT),改用 javax.imageio.ImageIO + BufferedImage 实现了跨端兼容。同时也正确处理了像素格式差异(ABGR → ARGB)。

3. 26.1 API 迁移整体良好

已确认的正确迁移:

  • ResourceLocationIdentifier
  • ResourceLocation.fromNamespaceAndPath()Identifier.fromNamespaceAndPath()
  • saveAdditional(CompoundTag, HolderLookup.Provider)saveAdditional(ValueOutput)
  • loadAdditional(CompoundTag, HolderLookup.Provider)loadAdditional(ValueInput)
  • ✅ NBT 持久化使用 output.store() / input.read() + Codec
  • IFluidHandlerResourceHandler<FluidResource>
  • IItemHandlerResourceHandler<ItemResource>
  • BlockEntityRenderer<BE>BlockEntityRenderer<BE, RenderState>
  • ✅ 使用 StandaloneModelKey<BlockStateModel> + SimpleUnbakedStandaloneModel
  • propagatesSkylightDown(BlockState, BlockGetter, BlockPos)propagatesSkylightDown(BlockState)
  • updateShape(BlocState, LevelReader, Direction, BlockPos, BlockState, RandomSource)updateShape(BlockState, LevelReader, ScheduledTickAccess, BlockPos, Direction, BlockPos, BlockState, RandomSource)
  • entityInside(BlockState, Level, BlockPos, Entity)entityInside(BlockState, Level, BlockPos, Entity, InsideBlockEffectApplier, boolean)
  • org.jetbrains.annotations.Nullableorg.jspecify.annotations.Nullable(大部分文件已完成)
  • ✅ Minecraft 版本迁移:1.21.1 → 26.1.2,Java 21 → 25

4. 翻译/语言文件

语言文件未在本次 PR 的核心范围内——主要是生成资源的 en_us.jsonen_ud.json 更新。建议在功能稳定后单独提交翻译 PR。

5. 缺少 @OnlyIn(Dist.CLIENT) 被正确注释为注释

多处代码保留 // @OnlyIn(Dist.CLIENT) 注释说明 26.1 后的变化,有助于后续维护者理解迁移背景。


✅ 看起来不错

  • CFA BlockEntityIPowerConsumer / IPowerProducer 实现完整,功率计算支持 search 状态和 megastructure 场景的委派
  • CelestialBodyMatcher 的三步匹配逻辑(Mass-Radius → Temperature-Age → Age-Radius)实现清晰,Bitset 预计算加速查询
  • 搜索动画 使用了 easeInOutCubic 插值和 rotation boost,用户体验优化到位
  • Temple 系统(3 天周期、祭品系统、祝福/惩罚)设计完整
  • 虫洞稳定器 的跨维度区块加载和 CFA 连接追踪实现正确
  • BlockEntity NBT 持久化 全面,包括 megastructureManager 的委派持久化和网络同步
  • CfaInterfaceScanner 的相邻方块扫描逻辑准确,支持激光/流体/物流三种接口发现
  • 渲染器迁移到 26.1 的 new model system(CFARenderer 使用 StandaloneModelKey + SubmitNodeCollector
  • AT 文件正确更新了 MushroomCowZombieVillager 的包路径变更

结论: 这是将锻星砧完整移植到 26.1 的大型工作,核心架构(Megastructure 委托、Power 系统、天体匹配引擎)移植质量很高。当前阶段属于"可启动"的 WIP,建议合并后可逐步修复剩余的编译错误和 Mixin 兼容性问题。需要注意的重点是 getShadeBrightness 签名兼容性和生成资源的行末换行缺失——如果两者都不影响编译和运行时功能,可以后续修复。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants