ATM10 5.5版本中,放置装配矩阵增强方块会导致游戏崩溃 #46

This commit is contained in:
GaLi 2026-03-02 10:51:54 +08:00
parent 6eef34e2dc
commit f44f0056fa

View File

@ -94,30 +94,7 @@ public class ExtendedAEPlus {
StorageCells.addCellHandler(InfinityBigIntegerCellHandler.INSTANCE); StorageCells.addCellHandler(InfinityBigIntegerCellHandler.INSTANCE);
// 绑定 AE2 CraftingBlockEntity 到本模组的自定义加速器方块避免 AEBaseEntityBlock.blockEntityType 为空 // 绑定 AE2 CraftingBlockEntity 到本模组的自定义加速器方块避免 AEBaseEntityBlock.blockEntityType 为空
event.enqueueWork(() -> {
try { try {
// 注册升级卡
new UpgradeCards(event);
// PartItem 注册 AE2 部件模型
PartModels.registerModels(
PartModelsHelper.createModels(
ModItems.ENTITY_TICKER_PART_ITEM.get().getPartClass().asSubclass(IPart.class)
)
);
// 注册自定义 AE2 MenuLocator用于 Curios 槽位打开菜单
try {
appeng.menu.locator.MenuLocators.register(
com.extendedae_plus.menu.locator.CuriosItemLocator.class,
com.extendedae_plus.menu.locator.CuriosItemLocator::writeToPacket,
com.extendedae_plus.menu.locator.CuriosItemLocator::readFromPacket
);
LOGGER.info("Registered AE2 MenuLocator: CuriosItemLocator");
} catch (Throwable t) {
LOGGER.warn("Failed to register CuriosItemLocator with AE2 MenuLocators: {}", t.toString());
}
AEBaseEntityBlock<CraftingBlockEntity> b4 = (AEBaseEntityBlock<CraftingBlockEntity>) ModBlocks.ACCELERATOR_4x.get(); AEBaseEntityBlock<CraftingBlockEntity> b4 = (AEBaseEntityBlock<CraftingBlockEntity>) ModBlocks.ACCELERATOR_4x.get();
AEBaseEntityBlock<CraftingBlockEntity> b16 = (AEBaseEntityBlock<CraftingBlockEntity>) ModBlocks.ACCELERATOR_16x.get(); AEBaseEntityBlock<CraftingBlockEntity> b16 = (AEBaseEntityBlock<CraftingBlockEntity>) ModBlocks.ACCELERATOR_16x.get();
AEBaseEntityBlock<CraftingBlockEntity> b64 = (AEBaseEntityBlock<CraftingBlockEntity>) ModBlocks.ACCELERATOR_64x.get(); AEBaseEntityBlock<CraftingBlockEntity> b64 = (AEBaseEntityBlock<CraftingBlockEntity>) ModBlocks.ACCELERATOR_64x.get();
@ -165,7 +142,35 @@ public class ExtendedAEPlus {
LOGGER.info("Bound UploadCoreBlockEntity to assembler matrix upload core block."); LOGGER.info("Bound UploadCoreBlockEntity to assembler matrix upload core block.");
} catch (Throwable t) { } catch (Throwable t) {
LOGGER.warn("Failed to bind block entities: {}", t.toString()); LOGGER.error("Failed to bind block entities: {}", t.toString());
throw new RuntimeException("Critical error: Failed to bind block entities", t);
}
event.enqueueWork(() -> {
try {
// 注册升级卡
new UpgradeCards(event);
// PartItem 注册 AE2 部件模型
PartModels.registerModels(
PartModelsHelper.createModels(
ModItems.ENTITY_TICKER_PART_ITEM.get().getPartClass().asSubclass(IPart.class)
)
);
// 注册自定义 AE2 MenuLocator用于 Curios 槽位打开菜单
try {
appeng.menu.locator.MenuLocators.register(
com.extendedae_plus.menu.locator.CuriosItemLocator.class,
com.extendedae_plus.menu.locator.CuriosItemLocator::writeToPacket,
com.extendedae_plus.menu.locator.CuriosItemLocator::readFromPacket
);
LOGGER.info("Registered AE2 MenuLocator: CuriosItemLocator");
} catch (Throwable t) {
LOGGER.warn("Failed to register CuriosItemLocator with AE2 MenuLocators: {}", t.toString());
}
} catch (Throwable t) {
LOGGER.warn("Failed to complete enqueued setup work: {}", t.toString());
} }
}); });
} }