ExtendedAE_Plus/src/main/java/com/extendedae_plus/init/ModCreativeTabs.java

41 lines
2.1 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.extendedae_plus.init;
import com.extendedae_plus.ExtendedAEPlus;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.RegistryObject;
public final class ModCreativeTabs {
private ModCreativeTabs() {}
public static final DeferredRegister<CreativeModeTab> TABS =
DeferredRegister.create(Registries.CREATIVE_MODE_TAB, ExtendedAEPlus.MODID);
public static final RegistryObject<CreativeModeTab> MAIN = TABS.register("main",
() -> CreativeModeTab.builder()
.title(Component.translatable("itemGroup." + ExtendedAEPlus.MODID + ".main"))
.icon(() -> ModItems.WIRELESS_TRANSCEIVER.get().getDefaultInstance())
.displayItems((params, output) -> {
// 将本模组物品加入创造物品栏
output.accept(ModItems.WIRELESS_TRANSCEIVER.get());
output.accept(ModItems.NETWORK_PATTERN_CONTROLLER.get());
output.accept(ModItems.ACCELERATOR_4x.get());
output.accept(ModItems.ACCELERATOR_16x.get());
output.accept(ModItems.ACCELERATOR_64x.get());
output.accept(ModItems.ACCELERATOR_256x.get());
output.accept(ModItems.ACCELERATOR_1024x.get());
output.accept(ModItems.ENTITY_TICKER_PART_ITEM.get());
// 放入四个预设的 stacksx2,x4,x8,x16使用 ModItems 工厂创建
output.accept(ModItems.createEntitySpeedCardStack(2));
output.accept(ModItems.createEntitySpeedCardStack(4));
output.accept(ModItems.createEntitySpeedCardStack(8));
output.accept(ModItems.createEntitySpeedCardStack(16));
output.accept(ModItems.INFINITY_BIGINTEGER_CELL_ITEM.get());
})
.build());
}