diff --git a/src/main/java/com/extendedae_plus/init/ModCreativeTabs.java b/src/main/java/com/extendedae_plus/init/ModCreativeTabs.java index 75a95b7..08ffd95 100644 --- a/src/main/java/com/extendedae_plus/init/ModCreativeTabs.java +++ b/src/main/java/com/extendedae_plus/init/ModCreativeTabs.java @@ -8,11 +8,8 @@ import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.RegistryObject; public final class ModCreativeTabs { - private ModCreativeTabs() {} - public static final DeferredRegister TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, ExtendedAEPlus.MODID); - public static final RegistryObject MAIN = TABS.register("main", () -> CreativeModeTab.builder() .title(Component.translatable("itemGroup." + ExtendedAEPlus.MODID + ".main")) @@ -35,11 +32,20 @@ public final class ModCreativeTabs { output.accept(ModItems.createEntitySpeedCardStack(4)); output.accept(ModItems.createEntitySpeedCardStack(8)); output.accept(ModItems.createEntitySpeedCardStack(16)); - - output.accept(ModItems.INFINITY_BIGINTEGER_CELL_ITEM.get()); - // 频道卡 output.accept(ModItems.CHANNEL_CARD.get()); + + output.accept(ModItems.OBLIVION_SINGULARITY.get()); + output.accept(ModItems.STORAGE_CORE.get()); + if (ModItems.ENERGY_CORE != null) { + output.accept(ModItems.ENERGY_CORE.get()); + } + if (ModItems.QUANTUM_STORAGE_CORE != null) { + output.accept(ModItems.QUANTUM_STORAGE_CORE.get()); + } + output.accept(ModItems.SPATIAL_CORE.get()); + + output.accept(ModItems.INFINITY_BIGINTEGER_CELL_ITEM.get()); }) .build()); } diff --git a/src/main/java/com/extendedae_plus/init/ModItems.java b/src/main/java/com/extendedae_plus/init/ModItems.java index 79b4209..2fab060 100644 --- a/src/main/java/com/extendedae_plus/init/ModItems.java +++ b/src/main/java/com/extendedae_plus/init/ModItems.java @@ -8,15 +8,15 @@ import com.extendedae_plus.ae.definitions.upgrades.EntitySpeedCardItem; import com.extendedae_plus.ae.items.ChannelCardItem; import com.extendedae_plus.ae.items.EntitySpeedTickerPartItem; import com.extendedae_plus.ae.items.InfinityBigIntegerCellItem; +import com.extendedae_plus.util.ModCheckUtils; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; public final class ModItems { - private ModItems() {} - public static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, ExtendedAEPlus.MODID); public static final RegistryObject WIRELESS_TRANSCEIVER = ITEMS.register( @@ -63,7 +63,7 @@ public final class ModItems { public static final RegistryObject ENTITY_TICKER_PART_ITEM = ITEMS.register( "entity_speed_ticker", - () -> new EntitySpeedTickerPartItem(new Item.Properties()) + () -> new EntitySpeedTickerPartItem(new Item.Properties()) ); // AE Upgrade Cards: 实体加速卡(四个等级:x2,x4,x8,x16) @@ -73,7 +73,7 @@ public final class ModItems { () -> new EntitySpeedCardItem(new Item.Properties()) ); - public static final RegistryObject INFINITY_BIGINTEGER_CELL_ITEM = ITEMS.register( + public static final RegistryObject INFINITY_BIGINTEGER_CELL_ITEM = ITEMS.register( "infinity_biginteger_cell", InfinityBigIntegerCellItem::new ); @@ -83,6 +83,42 @@ public final class ModItems { () -> new ChannelCardItem(new Item.Properties()) ); + public static final RegistryObject STORAGE_CORE = ITEMS.register( + "storage_core", + () -> new Item(new Item.Properties()) + ); + public static final RegistryObject SPATIAL_CORE = ITEMS.register( + "spatial_core", + () -> new Item(new Item.Properties()) + ); + public static final RegistryObject OBLIVION_SINGULARITY = ITEMS.register( + "oblivion_singularity", + () -> new Item(new Item.Properties()) + ); + public static final RegistryObject ENERGY_CORE; + public static final RegistryObject QUANTUM_STORAGE_CORE; + + static { + if (ModCheckUtils.isAppfluxLoading()) { + ENERGY_CORE = ITEMS.register( + "energy_core", + () -> new Item(new Item.Properties()) + ); + } else { + ENERGY_CORE = null; + } + + if (ModCheckUtils.isAAELoading()) { + QUANTUM_STORAGE_CORE = ITEMS.register( + "quantum_storage_core", + () -> new Item(new Item.Properties()) + ); + } else { + QUANTUM_STORAGE_CORE = null; + } + } + + private ModItems() {} /** * 为 PartItem 注册 AE2 部件模型。 @@ -99,7 +135,7 @@ public final class ModItems { /** * 工厂:创建带 multiplier 的实体加速卡 ItemStack(2/4/8/16) */ - public static net.minecraft.world.item.ItemStack createEntitySpeedCardStack(int multiplier) { + public static ItemStack createEntitySpeedCardStack(int multiplier) { return EntitySpeedCardItem.withMultiplier(multiplier); } } diff --git a/src/main/java/com/extendedae_plus/util/ModCheckUtils.java b/src/main/java/com/extendedae_plus/util/ModCheckUtils.java index 8ecd475..9eb70c0 100644 --- a/src/main/java/com/extendedae_plus/util/ModCheckUtils.java +++ b/src/main/java/com/extendedae_plus/util/ModCheckUtils.java @@ -82,4 +82,8 @@ public class ModCheckUtils { public static boolean isAppfluxLoading() { return ModCheckUtils.isLoaded(ModCheckUtils.MODID_APPFLUX); } + + public static boolean isAAELoading() { + return ModCheckUtils.isLoaded(ModCheckUtils.MODID_AAE); + } } diff --git a/src/main/resources/assets/extendedae_plus/lang/en_us.json b/src/main/resources/assets/extendedae_plus/lang/en_us.json index f30b010..b8190c3 100644 --- a/src/main/resources/assets/extendedae_plus/lang/en_us.json +++ b/src/main/resources/assets/extendedae_plus/lang/en_us.json @@ -24,6 +24,9 @@ "item.extendedae_plus.entity_speed_card.x4": "Entity Acceleration Card (x4)", "item.extendedae_plus.entity_speed_card.x8": "Entity Acceleration Card (x8)", "item.extendedae_plus.entity_speed_card.x16": "Entity Acceleration Card (x16)", + "item.extendedae_plus.storage_core": "Storage Core", + "item.extendedae_plus.spatial_core": "Spatial Core", + "item.extendedae_plus.oblivion_singularity": "Oblivion Singularity", "item.extendedae_plus.infinity_biginteger_cell": "§4De§cvou§6rer §eof §aCo§bsmic §dSilence", "tooltip.extendedae_plus.infinity_biginteger_cell.summon1": "§6Through ninefold sacrifice, the Void echoes§r—§8Iava, Lord of the Void§r, bestows upon thee this artifact", "tooltip.extendedae_plus.infinity_biginteger_cell.summon2": "§b—§4A §dUni§cverse §eWith§ain §6A §bSin§5gle §9Point", diff --git a/src/main/resources/assets/extendedae_plus/lang/zh_cn.json b/src/main/resources/assets/extendedae_plus/lang/zh_cn.json index 01aeac9..d529f86 100644 --- a/src/main/resources/assets/extendedae_plus/lang/zh_cn.json +++ b/src/main/resources/assets/extendedae_plus/lang/zh_cn.json @@ -24,6 +24,9 @@ "item.extendedae_plus.entity_speed_card.x4": "实体加速卡 (x4)", "item.extendedae_plus.entity_speed_card.x8": "实体加速卡 (x8)", "item.extendedae_plus.entity_speed_card.x16": "实体加速卡 (x16)", + "item.extendedae_plus.storage_core": "存储核心", + "item.extendedae_plus.spatial_core": "空间核心", + "item.extendedae_plus.oblivion_singularity": "湮灭奇点", "item.extendedae_plus.infinity_biginteger_cell": "§4吞§c噬§6万§e籁§a的§b寂§d静", "tooltip.extendedae_plus.infinity_biginteger_cell.summon1": "§6九重献祭, 终得虚空回响§r——觐见§8虚空之主Iava§r, 赐汝此物", "tooltip.extendedae_plus.infinity_biginteger_cell.summon2": "§b——§4方§d寸§c之§e间§a, §6自§b有§5千§9寰",