Skip to content

Commit ac6ffe1

Browse files
committed
fix: 修复不可堆叠物品在输出时被堆叠的问题
1 parent 8fe6bfb commit ac6ffe1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main/java/hellfirepvp/modularmachinery/common/integration/ModIntegrationJEI.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,12 @@ public void register(IModRegistry registry) {
206206
registry.addRecipeCatalyst(stack, machineCategory);
207207
}
208208

209-
// Only handle MM recipes
210-
for (DynamicMachine machine : MachineRegistry.getRegistry()) {
211-
String machineCategory = getCategoryStringFor(machine);
212-
registry.getRecipeTransferRegistry().addRecipeTransferHandler(new MEInputRecipeTransferHandler(), machineCategory);
209+
// 仅在 AE2 存在时注册转移处理器,避免类加载失败导致 JEI 插件注册中断
210+
if (Mods.AE2.isPresent()) {
211+
for (DynamicMachine machine : MachineRegistry.getRegistry()) {
212+
String machineCategory = getCategoryStringFor(machine);
213+
registry.getRecipeTransferRegistry().addRecipeTransferHandler(new MEInputRecipeTransferHandler(), machineCategory);
214+
}
213215
}
214216

215217
for (DynamicMachine machine : MachineRegistry.getRegistry()) {

0 commit comments

Comments
 (0)