11package io .github .mxpea .fadingshadow ;
22
3+ import io .github .mxpea .fadingshadow .item .ModCreativeTab ;
34import io .github .mxpea .fadingshadow .item .ModItem ;
45import org .slf4j .Logger ;
56
@@ -55,6 +56,7 @@ public class FadingShadow {
5556 public static final DeferredItem <Item > EXAMPLE_ITEM = ITEMS .registerSimpleItem ("example_item" , new Item .Properties ().food (new FoodProperties .Builder ()
5657 .alwaysEdible ().nutrition (1 ).saturationModifier (2f ).build ()));
5758
59+ /*
5860 // Creates a creative tab with the id "fadingshadow:example_tab" for the example item, that is placed after the combat tab
5961 public static final DeferredHolder<CreativeModeTab, CreativeModeTab> EXAMPLE_TAB = CREATIVE_MODE_TABS.register("example_tab", () -> CreativeModeTab.builder()
6062 .title(Component.translatable("itemGroup.fadingshadow")) //The language key for the title of your CreativeModeTab
@@ -64,13 +66,16 @@ public class FadingShadow {
6466 output.accept(EXAMPLE_ITEM.get()); // Add the example item to the tab. For your own tabs, this method is preferred over the event
6567 }).build());
6668
69+ */
70+
6771 // The constructor for the mod class is the first code that is run when your mod is loaded.
6872 // FML will recognize some parameter types like IEventBus or ModContainer and pass them in automatically.
6973 public FadingShadow (IEventBus modEventBus , ModContainer modContainer ) {
7074 // Register the commonSetup method for modloading
7175 modEventBus .addListener (this ::commonSetup );
72-
76+ //初始化
7377 ModItem .register (modEventBus );
78+ ModCreativeTab .register (modEventBus );
7479
7580 // Register the Deferred Register to the mod event bus so blocks get registered
7681 BLOCKS .register (modEventBus );
@@ -106,7 +111,7 @@ private void commonSetup(FMLCommonSetupEvent event) {
106111 */
107112 }
108113
109- // Add the example block item to the building blocks tab
114+ // 创造模式物品栏分类
110115 private void addCreative (BuildCreativeModeTabContentsEvent event ) {
111116 if (event .getTabKey () == CreativeModeTabs .INGREDIENTS ) {
112117 event .accept (ModItem .reality_fabric );
@@ -117,7 +122,7 @@ private void addCreative(BuildCreativeModeTabContentsEvent event) {
117122 // You can use SubscribeEvent and let the Event Bus discover methods to call
118123 @ SubscribeEvent
119124 public void onServerStarting (ServerStartingEvent event ) {
120- // Do something when the server starts
125+ // 服务器启动时打印日志
121126 LOGGER .info ("Fading,,,From where behind the reality..," );
122127 }
123128}
0 commit comments