diff --git a/README.md b/README.md index b421122..fc59708 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,7 @@ -Installation information -======= +# 稗田阿求的书卷 Hieda no Akyuu no Makimono -This template repository can be directly cloned to get you started with a new -mod. Simply create a new repository cloned from this one, by following the -instructions provided by [GitHub](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template). +这是稗茗奉月居创作的用于纪念稗田阿求的模组 -Once you have your clone, simply open the repository in the IDE of your choice. The usual recommendation for an IDE is either IntelliJ IDEA or Eclipse. - -If at any point you are missing libraries in your IDE, or you've run into problems you can -run `gradlew --refresh-dependencies` to refresh the local cache. `gradlew clean` to reset everything -{this does not affect your code} and then start the process again. - -Mapping Names: -============ -By default, the MDK is configured to use the official mapping names from Mojang for methods and fields -in the Minecraft codebase. These names are covered by a specific license. All modders should be aware of this -license. For the latest license text, refer to the mapping file itself, or the reference copy here: -https://github.com/NeoForged/NeoForm/blob/main/Mojang.md - -Additional Resources: -========== -Community Documentation: https://docs.neoforged.net/ -NeoForged Discord: https://discord.neoforged.net/ +保留所有权利 +All rights reserved \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index ea9a1aa..587ee8d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Sets default memory used for gradle commands. Can be overridden by user or command line properties. -org.gradle.jvmargs=-Xmx1G +org.gradle.jvmargs=-Xmx3G org.gradle.daemon=true org.gradle.parallel=true org.gradle.caching=true @@ -16,7 +16,7 @@ minecraft_version=1.21 # The Minecraft version range can use any release version of Minecraft as bounds. # Snapshots, pre-releases, and release candidates are not guaranteed to sort properly # as they do not follow standard versioning conventions. -minecraft_version_range=[1.21,1.21.1) +minecraft_version_range=[1.21,1.21.2) # The Neo version must agree with the Minecraft version to get a valid artifact neo_version=21.0.167 # The Neo version range can use any version of Neo as bounds @@ -28,18 +28,18 @@ loader_version_range=[4,) # The unique mod identifier for the mod. Must be lowercase in English locale. Must fit the regex [a-z][a-z0-9_]{1,63} # Must match the String constant located in the main mod class annotated with @Mod. -mod_id=examplemod +mod_id=hiedanoakyuunomakimono # The human-readable display name for the mod. -mod_name=Example Mod +mod_name=Hieda no Akyuu no Makimono # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. mod_license=All Rights Reserved # The mod version. See https://semver.org/ -mod_version=1.0.0 +mod_version=1.0.0-snaphot # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # This should match the base package used for the mod sources. # See https://maven.apache.org/guides/mini/guide-naming-conventions.html -mod_group_id=com.example.examplemod +mod_group_id=org.hiedacamellia.hiedanoakyuunomakimono # The authors of the mod. This is a simple text string that is used for display purposes in the mod list. -mod_authors=YourNameHere, OtherNameHere +mod_authors=Hieda Camellia # The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list. -mod_description=Example mod description.\nNewline characters can be used and will be replaced properly. +mod_description=????????????????????? diff --git a/src/main/java/com/example/examplemod/Config.java b/src/main/java/com/example/examplemod/Config.java deleted file mode 100644 index d70d1eb..0000000 --- a/src/main/java/com/example/examplemod/Config.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.example.examplemod; - -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.item.Item; -import net.neoforged.bus.api.SubscribeEvent; -import net.neoforged.fml.common.EventBusSubscriber; -import net.neoforged.fml.event.config.ModConfigEvent; -import net.neoforged.neoforge.common.ModConfigSpec; - -// An example config class. This is not required, but it's a good idea to have one to keep your config organized. -// Demonstrates how to use Neo's config APIs -@EventBusSubscriber(modid = ExampleMod.MODID, bus = EventBusSubscriber.Bus.MOD) -public class Config -{ - private static final ModConfigSpec.Builder BUILDER = new ModConfigSpec.Builder(); - - private static final ModConfigSpec.BooleanValue LOG_DIRT_BLOCK = BUILDER - .comment("Whether to log the dirt block on common setup") - .define("logDirtBlock", true); - - private static final ModConfigSpec.IntValue MAGIC_NUMBER = BUILDER - .comment("A magic number") - .defineInRange("magicNumber", 42, 0, Integer.MAX_VALUE); - - public static final ModConfigSpec.ConfigValue MAGIC_NUMBER_INTRODUCTION = BUILDER - .comment("What you want the introduction message to be for the magic number") - .define("magicNumberIntroduction", "The magic number is... "); - - // a list of strings that are treated as resource locations for items - private static final ModConfigSpec.ConfigValue> ITEM_STRINGS = BUILDER - .comment("A list of items to log on common setup.") - .defineListAllowEmpty("items", List.of("minecraft:iron_ingot"), Config::validateItemName); - - static final ModConfigSpec SPEC = BUILDER.build(); - - public static boolean logDirtBlock; - public static int magicNumber; - public static String magicNumberIntroduction; - public static Set items; - - private static boolean validateItemName(final Object obj) - { - return obj instanceof String itemName && BuiltInRegistries.ITEM.containsKey(ResourceLocation.parse(itemName)); - } - - @SubscribeEvent - static void onLoad(final ModConfigEvent event) - { - logDirtBlock = LOG_DIRT_BLOCK.get(); - magicNumber = MAGIC_NUMBER.get(); - magicNumberIntroduction = MAGIC_NUMBER_INTRODUCTION.get(); - - // convert the list of strings into a set of items - items = ITEM_STRINGS.get().stream() - .map(itemName -> BuiltInRegistries.ITEM.get(ResourceLocation.parse(itemName))) - .collect(Collectors.toSet()); - } -} diff --git a/src/main/java/com/example/examplemod/ExampleMod.java b/src/main/java/com/example/examplemod/ExampleMod.java deleted file mode 100644 index 835a48d..0000000 --- a/src/main/java/com/example/examplemod/ExampleMod.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.example.examplemod; - -import org.slf4j.Logger; - -import com.mojang.logging.LogUtils; - -import net.minecraft.client.Minecraft; -import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.core.registries.Registries; -import net.minecraft.network.chat.Component; -import net.minecraft.world.food.FoodProperties; -import net.minecraft.world.item.BlockItem; -import net.minecraft.world.item.CreativeModeTab; -import net.minecraft.world.item.CreativeModeTabs; -import net.minecraft.world.item.Item; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.state.BlockBehaviour; -import net.minecraft.world.level.material.MapColor; -import net.neoforged.api.distmarker.Dist; -import net.neoforged.bus.api.IEventBus; -import net.neoforged.bus.api.SubscribeEvent; -import net.neoforged.fml.ModContainer; -import net.neoforged.fml.common.EventBusSubscriber; -import net.neoforged.fml.common.Mod; -import net.neoforged.fml.config.ModConfig; -import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; -import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent; -import net.neoforged.neoforge.common.NeoForge; -import net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent; -import net.neoforged.neoforge.event.server.ServerStartingEvent; -import net.neoforged.neoforge.registries.DeferredBlock; -import net.neoforged.neoforge.registries.DeferredHolder; -import net.neoforged.neoforge.registries.DeferredItem; -import net.neoforged.neoforge.registries.DeferredRegister; - -// The value here should match an entry in the META-INF/neoforge.mods.toml file -@Mod(ExampleMod.MODID) -public class ExampleMod -{ - // Define mod id in a common place for everything to reference - public static final String MODID = "examplemod"; - // Directly reference a slf4j logger - private static final Logger LOGGER = LogUtils.getLogger(); - // Create a Deferred Register to hold Blocks which will all be registered under the "examplemod" namespace - public static final DeferredRegister.Blocks BLOCKS = DeferredRegister.createBlocks(MODID); - // Create a Deferred Register to hold Items which will all be registered under the "examplemod" namespace - public static final DeferredRegister.Items ITEMS = DeferredRegister.createItems(MODID); - // Create a Deferred Register to hold CreativeModeTabs which will all be registered under the "examplemod" namespace - public static final DeferredRegister CREATIVE_MODE_TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, MODID); - - // Creates a new Block with the id "examplemod:example_block", combining the namespace and path - public static final DeferredBlock EXAMPLE_BLOCK = BLOCKS.registerSimpleBlock("example_block", BlockBehaviour.Properties.of().mapColor(MapColor.STONE)); - // Creates a new BlockItem with the id "examplemod:example_block", combining the namespace and path - public static final DeferredItem EXAMPLE_BLOCK_ITEM = ITEMS.registerSimpleBlockItem("example_block", EXAMPLE_BLOCK); - - // Creates a new food item with the id "examplemod:example_id", nutrition 1 and saturation 2 - public static final DeferredItem EXAMPLE_ITEM = ITEMS.registerSimpleItem("example_item", new Item.Properties().food(new FoodProperties.Builder() - .alwaysEdible().nutrition(1).saturationModifier(2f).build())); - - // Creates a creative tab with the id "examplemod:example_tab" for the example item, that is placed after the combat tab - public static final DeferredHolder EXAMPLE_TAB = CREATIVE_MODE_TABS.register("example_tab", () -> CreativeModeTab.builder() - .title(Component.translatable("itemGroup.examplemod")) //The language key for the title of your CreativeModeTab - .withTabsBefore(CreativeModeTabs.COMBAT) - .icon(() -> EXAMPLE_ITEM.get().getDefaultInstance()) - .displayItems((parameters, output) -> { - output.accept(EXAMPLE_ITEM.get()); // Add the example item to the tab. For your own tabs, this method is preferred over the event - }).build()); - - // The constructor for the mod class is the first code that is run when your mod is loaded. - // FML will recognize some parameter types like IEventBus or ModContainer and pass them in automatically. - public ExampleMod(IEventBus modEventBus, ModContainer modContainer) - { - // Register the commonSetup method for modloading - modEventBus.addListener(this::commonSetup); - - // Register the Deferred Register to the mod event bus so blocks get registered - BLOCKS.register(modEventBus); - // Register the Deferred Register to the mod event bus so items get registered - ITEMS.register(modEventBus); - // Register the Deferred Register to the mod event bus so tabs get registered - CREATIVE_MODE_TABS.register(modEventBus); - - // Register ourselves for server and other game events we are interested in. - // Note that this is necessary if and only if we want *this* class (ExampleMod) to respond directly to events. - // Do not add this line if there are no @SubscribeEvent-annotated functions in this class, like onServerStarting() below. - NeoForge.EVENT_BUS.register(this); - - // Register the item to a creative tab - modEventBus.addListener(this::addCreative); - - // Register our mod's ModConfigSpec so that FML can create and load the config file for us - modContainer.registerConfig(ModConfig.Type.COMMON, Config.SPEC); - } - - private void commonSetup(final FMLCommonSetupEvent event) - { - // Some common setup code - LOGGER.info("HELLO FROM COMMON SETUP"); - - if (Config.logDirtBlock) - LOGGER.info("DIRT BLOCK >> {}", BuiltInRegistries.BLOCK.getKey(Blocks.DIRT)); - - LOGGER.info(Config.magicNumberIntroduction + Config.magicNumber); - - Config.items.forEach((item) -> LOGGER.info("ITEM >> {}", item.toString())); - } - - // Add the example block item to the building blocks tab - private void addCreative(BuildCreativeModeTabContentsEvent event) - { - if (event.getTabKey() == CreativeModeTabs.BUILDING_BLOCKS) - event.accept(EXAMPLE_BLOCK_ITEM); - } - - // You can use SubscribeEvent and let the Event Bus discover methods to call - @SubscribeEvent - public void onServerStarting(ServerStartingEvent event) - { - // Do something when the server starts - LOGGER.info("HELLO from server starting"); - } - - // You can use EventBusSubscriber to automatically register all static methods in the class annotated with @SubscribeEvent - @EventBusSubscriber(modid = MODID, bus = EventBusSubscriber.Bus.MOD, value = Dist.CLIENT) - public static class ClientModEvents - { - @SubscribeEvent - public static void onClientSetup(FMLClientSetupEvent event) - { - // Some client setup code - LOGGER.info("HELLO FROM CLIENT SETUP"); - LOGGER.info("MINECRAFT NAME >> {}", Minecraft.getInstance().getUser().getName()); - } - } -} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/Config.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/Config.java new file mode 100644 index 0000000..e319d37 --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/Config.java @@ -0,0 +1,35 @@ +package org.hiedacamellia.hiedanoakyuunomakimono; + +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.EventBusSubscriber; +import net.neoforged.fml.event.config.ModConfigEvent; +import net.neoforged.neoforge.common.ModConfigSpec; + +// An example config class. This is not required, but it's a good idea to have one to keep your config organized. +// Demonstrates how to use Neo's config APIs +@EventBusSubscriber(modid = HiedanoAkyuunoMakimono.MODID, bus = EventBusSubscriber.Bus.MOD) +public class Config +{ + private static final ModConfigSpec.Builder BUILDER = new ModConfigSpec.Builder(); + + private static final ModConfigSpec.BooleanValue DEBUG = BUILDER + .comment("Set to true to enable debug info") + .comment("设置为true以启用调试信息") + .define("debug", true); + + + static final ModConfigSpec SPEC = BUILDER.build(); + + public static boolean debug; + + public static void setDebug(boolean debug){ + DEBUG.set(debug); + } + + + @SubscribeEvent + static void onLoad(final ModConfigEvent event) + { + debug = DEBUG.get(); + } +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/HiedanoAkyuunoMakimono.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/HiedanoAkyuunoMakimono.java new file mode 100644 index 0000000..6a4278a --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/HiedanoAkyuunoMakimono.java @@ -0,0 +1,36 @@ +package org.hiedacamellia.hiedanoakyuunomakimono; + + +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.ModContainer; +import net.neoforged.fml.common.Mod; +import net.neoforged.fml.config.ModConfig; +import org.hiedacamellia.hiedanoakyuunomakimono.core.data.Data; +import org.hiedacamellia.hiedanoakyuunomakimono.registers.*; + +@Mod(HiedanoAkyuunoMakimono.MODID) +public class HiedanoAkyuunoMakimono { + public static final String MODID = "hiedanoakyuunomakimono"; + + public HiedanoAkyuunoMakimono(IEventBus modEventBus, ModContainer modContainer) + { + modEventBus.addListener(Data::onGatherData); + + HAMBlock.BLOCKS.register(modEventBus); + HAMBlockItem.ITEMS.register(modEventBus); + HAMItem.ITEMS.register(modEventBus); + HAMTab.TABS.register(modEventBus); + HAMAttachment.ATTACHMENTS.register(modEventBus); + HAMDataComponent.DATA_COMPONENTS.register(modEventBus); + HAMEffect.EFFECTS.register(modEventBus); + HAMMenu.MENUS.register(modEventBus); + HAMRicipe.RECIPE_TYPES.register(modEventBus); + HAMRicipeSerializer.RECIPE_SERIALIZERS.register(modEventBus); + HAMBlockEntity.BLOCK_ENTITIES.register(modEventBus); + +// NeoForge.EVENT_BUS.register(this); + + + modContainer.registerConfig(ModConfig.Type.COMMON, Config.SPEC); + } +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/data/Data.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/data/Data.java new file mode 100644 index 0000000..47d3aff --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/data/Data.java @@ -0,0 +1,23 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.core.data; + +import net.neoforged.neoforge.data.event.GatherDataEvent; +import org.hiedacamellia.hiedanoakyuunomakimono.core.data.lang.ChineseLanguageProvider; +import org.hiedacamellia.hiedanoakyuunomakimono.core.data.lang.ClassicalChineseLanguageProvider; +import org.hiedacamellia.hiedanoakyuunomakimono.core.data.lang.EnglishLanguageProvider; +import org.hiedacamellia.hiedanoakyuunomakimono.core.data.provider.ModelProvider; +import org.hiedacamellia.hiedanoakyuunomakimono.core.data.provider.StateProvider; +import org.hiedacamellia.hiedanoakyuunomakimono.core.data.provider.WGRecipeProvider; + +public class Data { + public static void onGatherData(GatherDataEvent event) { + var gen = event.getGenerator(); + var packOutput = gen.getPackOutput(); + var helper = event.getExistingFileHelper(); + gen.addProvider(event.includeClient(), new EnglishLanguageProvider(packOutput)); + gen.addProvider(event.includeClient(), new ChineseLanguageProvider(packOutput)); + gen.addProvider(event.includeClient(), new ClassicalChineseLanguageProvider(packOutput)); + gen.addProvider(event.includeClient(), new ModelProvider(packOutput, helper)); + gen.addProvider(event.includeClient(), new StateProvider(packOutput, helper)); + gen.addProvider(event.includeServer(), new WGRecipeProvider(packOutput, event.getLookupProvider())); + } +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/data/lang/ChineseLanguageProvider.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/data/lang/ChineseLanguageProvider.java new file mode 100644 index 0000000..dfebf29 --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/data/lang/ChineseLanguageProvider.java @@ -0,0 +1,30 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.core.data.lang; + +import net.minecraft.data.PackOutput; +import net.neoforged.neoforge.common.data.LanguageProvider; +import org.hiedacamellia.hiedanoakyuunomakimono.HiedanoAkyuunoMakimono; + + +public class ChineseLanguageProvider extends LanguageProvider { + + public ChineseLanguageProvider(PackOutput output) { + super(output, HiedanoAkyuunoMakimono.MODID, "zh_cn"); + } + + @Override + protected void addTranslations() { + add("tooltip.hiedanoakyuunomakimono.press_shift","按住Shift键以显示更多信息"); + add("itemGroup.hiedanoakyuunomakimono", "浅草轻语"); + add("network.hiedanoakyuunomakimono.failed","无法处理网络数据: %s"); + add("cmd.hiedanoakyuunomakimono.modify.success","修改值成功:%f"); + add("cmd.hiedanoakyuunomakimono.modify.failed","修改值失败:%s"); + add("cmd.hiedanoakyuunomakimono.set.success","设置值成功:%f"); + add("cmd.hiedanoakyuunomakimono.set.failed","设置值失败:%s"); + add("cmd.hiedanoakyuunomakimono.get.success","获取值成功:%f"); + add("cmd.hiedanoakyuunomakimono.get.failed","获取值失败:%s"); + add("cmd.hiedanoakyuunomakimono.reset.success","重设值成功"); + add("cmd.hiedanoakyuunomakimono.reset.failed","重设值失败"); + + + } +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/data/lang/ClassicalChineseLanguageProvider.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/data/lang/ClassicalChineseLanguageProvider.java new file mode 100644 index 0000000..89e9997 --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/data/lang/ClassicalChineseLanguageProvider.java @@ -0,0 +1,19 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.core.data.lang; + +import net.minecraft.data.PackOutput; +import net.neoforged.neoforge.common.data.LanguageProvider; +import org.hiedacamellia.hiedanoakyuunomakimono.HiedanoAkyuunoMakimono; + +public class ClassicalChineseLanguageProvider extends LanguageProvider { + + public ClassicalChineseLanguageProvider(PackOutput output) { + super(output, HiedanoAkyuunoMakimono.MODID, "lzh"); + } + + @Override + protected void addTranslations() { + add("tooltip.hiedanoakyuunomakimono.press_shift","按住變鍵以示詳情。"); + add("itemGroup.hiedanoakyuunomakimono", "淺草輕語"); + } + +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/data/lang/EnglishLanguageProvider.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/data/lang/EnglishLanguageProvider.java new file mode 100644 index 0000000..18a9cbf --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/data/lang/EnglishLanguageProvider.java @@ -0,0 +1,33 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.core.data.lang; + +import net.minecraft.data.PackOutput; +import net.neoforged.neoforge.common.data.LanguageProvider; +import org.hiedacamellia.hiedanoakyuunomakimono.HiedanoAkyuunoMakimono; + + +public class EnglishLanguageProvider extends LanguageProvider { + + public EnglishLanguageProvider(PackOutput output) { + super(output, HiedanoAkyuunoMakimono.MODID, "en_us"); + } + + @Override + protected void addTranslations() { + add("tooltip.hiedanoakyuunomakimono.press_shift","Press Shift to display more information"); + add("itemGroup.hiedanoakyuunomakimono", "Whisper Grove"); + add("item.hiedanoakyuunomakimono.test_item", "Test Item"); + add("tooltip.hiedanoakyuunomakimono.test_item", "This is a test item"); + add("block.hiedanoakyuunomakimono.test_block", "Example Block"); + add("tooltip.hiedanoakyuunomakimono.test_block", "This is an example block"); + add("network.hiedanoakyuunomakimono.failed","Failed to handle network data: %s"); + add("cmd.hiedanoakyuunomakimono.modify.success","Modify Value success: %f"); + add("cmd.hiedanoakyuunomakimono.modify.failed","Modify Value failed: %s"); + add("cmd.hiedanoakyuunomakimono.set.success","Set Value success: %f"); + add("cmd.hiedanoakyuunomakimono.set.failed","Set Value failed: %s"); + add("cmd.hiedanoakyuunomakimono.get.success","Get Value success: %f"); + add("cmd.hiedanoakyuunomakimono.get.failed","Get Value failed: %s"); + add("cmd.hiedanoakyuunomakimono.reset.success","Reset Value success"); + add("cmd.hiedanoakyuunomakimono.reset.failed","Reset Value failed"); + + } +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/data/provider/ModelProvider.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/data/provider/ModelProvider.java new file mode 100644 index 0000000..d94b4fd --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/data/provider/ModelProvider.java @@ -0,0 +1,18 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.core.data.provider; + +import net.minecraft.data.PackOutput; +import net.minecraft.resources.ResourceLocation; +import net.neoforged.neoforge.client.model.generators.ItemModelProvider; +import net.neoforged.neoforge.common.data.ExistingFileHelper; +import org.hiedacamellia.hiedanoakyuunomakimono.HiedanoAkyuunoMakimono; + +public class ModelProvider extends ItemModelProvider { + public ModelProvider(PackOutput gen, ExistingFileHelper helper) { + super(gen, HiedanoAkyuunoMakimono.MODID, helper); + } + + @Override + protected void registerModels() { + + } +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/data/provider/StateProvider.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/data/provider/StateProvider.java new file mode 100644 index 0000000..b0152c9 --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/data/provider/StateProvider.java @@ -0,0 +1,18 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.core.data.provider; + +import net.minecraft.data.PackOutput; +import net.minecraft.resources.ResourceLocation; +import net.neoforged.neoforge.client.model.generators.BlockStateProvider; +import net.neoforged.neoforge.common.data.ExistingFileHelper; +import org.hiedacamellia.hiedanoakyuunomakimono.HiedanoAkyuunoMakimono; + +public class StateProvider extends BlockStateProvider { + public StateProvider(PackOutput gen, ExistingFileHelper helper) { + super(gen, HiedanoAkyuunoMakimono.MODID, helper); + } + + @Override + protected void registerStatesAndModels() { + + } +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/data/provider/WGRecipeProvider.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/data/provider/WGRecipeProvider.java new file mode 100644 index 0000000..5ca2fad --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/data/provider/WGRecipeProvider.java @@ -0,0 +1,19 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.core.data.provider; + +import net.minecraft.core.HolderLookup; +import net.minecraft.data.PackOutput; +import net.minecraft.data.recipes.RecipeOutput; +import net.minecraft.data.recipes.RecipeProvider; +import java.util.concurrent.CompletableFuture; + + +public class WGRecipeProvider extends RecipeProvider { + public WGRecipeProvider(PackOutput output, CompletableFuture lookupProvider) { + super(output, lookupProvider); + } + + @Override + protected void buildRecipes(RecipeOutput output) { + + } +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/debug/Debug.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/debug/Debug.java new file mode 100644 index 0000000..92504eb --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/debug/Debug.java @@ -0,0 +1,107 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.core.debug; + +import net.minecraft.client.Minecraft; +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.level.Level; +import net.neoforged.fml.loading.FMLEnvironment; +import org.hiedacamellia.hiedanoakyuunomakimono.Config; +import org.hiedacamellia.hiedanoakyuunomakimono.HiedanoAkyuunoMakimono; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Debug { + + private static String prefix = "[§a浅草轻语§r]"; + private static Boolean debugConfig = Config.debug; + private static Logger logger = LoggerFactory.getLogger(HiedanoAkyuunoMakimono.MODID); + + + public Debug(){ + } + + public static void info(String message){ + logger.info(message); + } + + public static void info(String message, Throwable t){ + logger.info(message,t); + } + + public static void info(String format, Object arg) { + logger.info(format, arg); + } + + public static void debug(String message){ + if(debugConfig) + logger.debug(message); + } + + public static void debug(String message, Throwable t){ + if(debugConfig) + logger.debug(message,t); + } + + public static void debug(String format, Object arg) { + if(debugConfig) + logger.debug(format, arg); + } + + public static void error(String message){ + logger.error(message); + } + + public static void error(String message, Throwable t){ + logger.error(message,t); + } + + public static void error(String format, Object arg) { + logger.error(format, arg); + } + + public static void warn(String message){ + logger.warn(message); + } + + public static void warn(String message, Throwable t){ + logger.warn(message,t); + } + + public static void warn(String format, Object arg) { + logger.warn(format, arg); + } + + public static void trace(String message){ + logger.trace(message); + } + + public static void trace(String message, Throwable t){ + logger.trace(message,t); + } + + public static void trace(String format, Object arg) { + logger.trace(format, arg); + } + + public static Logger getLogger(){ + return logger; + } + + //客户端调试信息 + public static void send(String string) { + if (FMLEnvironment.dist.isClient()) { + Minecraft mc = Minecraft.getInstance(); + if (mc.player != null && debugConfig) { + mc.player.sendSystemMessage(Component.literal(prefix + string)); + } + } + } + + //服务端调试信息 + public static void send(String string, Player player) { + Level level = player.level(); + if(!level.isClientSide && debugConfig) { + player.sendSystemMessage(Component.literal(prefix + string)); + } + } +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/entry/BaseBlock.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/entry/BaseBlock.java new file mode 100644 index 0000000..fb0f1c7 --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/entry/BaseBlock.java @@ -0,0 +1,34 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.core.entry; + +import net.minecraft.client.gui.screens.Screen; +import net.minecraft.network.chat.Component; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.block.Block; + +import java.util.List; + +public class BaseBlock extends Block { + + private final String regname; + + public BaseBlock(Properties properties,String regname) { + super(properties); + this.regname = regname; + } + + @Override + public void appendHoverText(ItemStack itemstack, Item.TooltipContext ctx, List list, TooltipFlag flag) { + super.appendHoverText(itemstack, ctx, list, flag); + if (!Screen.hasShiftDown()) { + list.add(Component.literal( + "§7§o" + Component.translatable("tooltip.whispergrove.press_shift").getString() + "§r")); + } else { + String[] description = Component.translatable("tooltip.whispergrove."+this.regname).getString().split("§n"); + for (String line : description) { + list.add(Component.literal(line)); + } + } + } +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/entry/BaseBlockItem.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/entry/BaseBlockItem.java new file mode 100644 index 0000000..446c889 --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/entry/BaseBlockItem.java @@ -0,0 +1,12 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.core.entry; + +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.level.block.Block; + +public class BaseBlockItem extends BlockItem { + + public BaseBlockItem(Block block, Properties properties) { + super(block, properties); + } + +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/entry/BaseCropBlock.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/entry/BaseCropBlock.java new file mode 100644 index 0000000..bacca92 --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/entry/BaseCropBlock.java @@ -0,0 +1,34 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.core.entry; + +import net.minecraft.client.gui.screens.Screen; +import net.minecraft.network.chat.Component; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.block.CropBlock; + +import java.util.List; + +public class BaseCropBlock extends CropBlock { + + private final String regname; + + public BaseCropBlock(Properties properties, String regname) { + super(properties); + this.regname = regname; + } + + @Override + public void appendHoverText(ItemStack itemstack, Item.TooltipContext ctx, List list, TooltipFlag flag) { + super.appendHoverText(itemstack, ctx, list, flag); + if (!Screen.hasShiftDown()) { + list.add(Component.literal( + "§7§o" + Component.translatable("tooltip.whispergrove.press_shift").getString() + "§r")); + } else { + String[] description = Component.translatable("tooltip.whispergrove."+this.regname).getString().split("§n"); + for (String line : description) { + list.add(Component.literal(line)); + } + } + } +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/entry/BaseEffect.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/entry/BaseEffect.java new file mode 100644 index 0000000..1422b7f --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/entry/BaseEffect.java @@ -0,0 +1,36 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.core.entry; + +import net.minecraft.world.effect.MobEffect; +import net.minecraft.world.effect.MobEffectCategory; +import net.minecraft.world.entity.LivingEntity; +import org.jetbrains.annotations.NotNull; + +public class BaseEffect extends MobEffect { + + private final String id; + + public BaseEffect(MobEffectCategory category, int color,String id) { + super(category, color); + this.id = id; + } + + @Override + public @NotNull String getDescriptionId() { + return id; + } + + @Override + public void onEffectStarted(LivingEntity entity, int amplifier) { + super.onEffectStarted(entity, amplifier); + } + + @Override + public boolean shouldApplyEffectTickThisTick(int duration, int amplifier) { + return super.shouldApplyEffectTickThisTick(duration, amplifier); + } + + @Override + public boolean applyEffectTick(LivingEntity entity, int amplifier) { + return super.applyEffectTick(entity, amplifier); + } +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/entry/BaseItem.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/entry/BaseItem.java new file mode 100644 index 0000000..f3f9607 --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/entry/BaseItem.java @@ -0,0 +1,51 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.core.entry; + +import net.minecraft.client.gui.screens.Screen; +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.food.FoodProperties; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.Level; + +import java.util.List; + +public class BaseItem extends Item { + + private final String regname; + + public BaseItem(Properties properties, String regname) { + super(properties); + this.regname = regname; + } + + @Override + public void appendHoverText(ItemStack itemstack, TooltipContext ctx, List list, TooltipFlag flag) { + super.appendHoverText(itemstack, ctx, list, flag); + if (!Screen.hasShiftDown()) { + list.add(Component.literal( + "§7§o" + Component.translatable("tooltip.whispergrove.press_shift").getString() + "§r")); + } else { + String[] description = Component.translatable("tooltip.whispergrove."+this.regname).getString().split("§n"); + for (String line : description) { + list.add(Component.literal(line)); + } + } + } + + @Override + public ItemStack finishUsingItem(ItemStack stack, Level level, LivingEntity livingEntity) { + FoodProperties foodproperties = stack.getFoodProperties(livingEntity); + if (livingEntity instanceof Player player){ + } + return foodproperties != null ? livingEntity.eat(level, stack, foodproperties) : stack; + } + + public String getReg() { + return regname; + } +} + + diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/entry/BaseLogBlock.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/entry/BaseLogBlock.java new file mode 100644 index 0000000..b6d86b5 --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/entry/BaseLogBlock.java @@ -0,0 +1,34 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.core.entry; + +import net.minecraft.client.gui.screens.Screen; +import net.minecraft.network.chat.Component; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.block.RotatedPillarBlock; + +import java.util.List; + +public class BaseLogBlock extends RotatedPillarBlock { + + private final String regname; + + public BaseLogBlock(Properties properties, String regname) { + super(properties); + this.regname = regname; + } + + @Override + public void appendHoverText(ItemStack itemstack, Item.TooltipContext ctx, List list, TooltipFlag flag) { + super.appendHoverText(itemstack, ctx, list, flag); + if (!Screen.hasShiftDown()) { + list.add(Component.literal( + "§7§o" + Component.translatable("tooltip.whispergrove.press_shift").getString() + "§r")); + } else { + String[] description = Component.translatable("tooltip.whispergrove."+this.regname).getString().split("§n"); + for (String line : description) { + list.add(Component.literal(line)); + } + } + } +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/entry/BaseRicipeBuilder.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/entry/BaseRicipeBuilder.java new file mode 100644 index 0000000..95f3505 --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/entry/BaseRicipeBuilder.java @@ -0,0 +1,54 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.core.entry; + +import net.minecraft.advancements.Criterion; +import net.minecraft.data.recipes.RecipeBuilder; +import net.minecraft.data.recipes.RecipeOutput; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; + +import javax.annotation.Nullable; +import java.util.LinkedHashMap; +import java.util.Map; + +public class BaseRicipeBuilder implements RecipeBuilder { + // Make the fields protected so our subclasses can use them. + protected final ItemStack result; + protected final Map> criteria = new LinkedHashMap<>(); + @Nullable + protected String group; + + // It is common for constructors to accept the result item stack. + // Alternatively, static builder methods are also possible. + public BaseRicipeBuilder(ItemStack result) { + this.result = result; + } + + // This method adds a criterion for the recipe advancement. + @Override + public BaseRicipeBuilder unlockedBy(String name, Criterion criterion) { + this.criteria.put(name, criterion); + return this; + } + + // This method adds a recipe book group. If you do not want to use recipe book groups, + // remove the this.group field and make this method no-op (i.e. return this). + @Override + public BaseRicipeBuilder group(@Nullable String group) { + this.group = group; + return this; + } + + // Vanilla wants an Item here, not an ItemStack. You still can and should use the ItemStack + // for serializing the recipes. + @Override + public Item getResult() { + return this.result.getItem(); + } + + @Override + public void save(RecipeOutput recipeOutput, ResourceLocation resourceLocation) { + + } + +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/entry/builder/BaseItemBuilder.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/entry/builder/BaseItemBuilder.java new file mode 100644 index 0000000..4c4143f --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/entry/builder/BaseItemBuilder.java @@ -0,0 +1,24 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.core.entry.builder; + +import net.minecraft.world.item.Item; +import org.hiedacamellia.hiedanoakyuunomakimono.core.entry.BaseItem; + +public class BaseItemBuilder { + + private String regname; + private Item.Properties properties; + + public BaseItem build(){ + return new BaseItem(properties,regname); + } + + public BaseItemBuilder regname(String regname){ + this.regname = regname; + return this; + } + + public BaseItemBuilder properties(Item.Properties properties){ + this.properties = properties; + return this; + } +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMAttachment.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMAttachment.java new file mode 100644 index 0000000..2301a68 --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMAttachment.java @@ -0,0 +1,12 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.registers; + +import net.neoforged.neoforge.attachment.AttachmentType; +import net.neoforged.neoforge.registries.DeferredRegister; +import net.neoforged.neoforge.registries.NeoForgeRegistries; +import org.hiedacamellia.hiedanoakyuunomakimono.HiedanoAkyuunoMakimono; + +public class HAMAttachment { + // Create the DeferredRegister for attachment types + public static final DeferredRegister> ATTACHMENTS = DeferredRegister.create(NeoForgeRegistries.ATTACHMENT_TYPES, HiedanoAkyuunoMakimono.MODID); + +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMBlock.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMBlock.java new file mode 100644 index 0000000..7196502 --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMBlock.java @@ -0,0 +1,15 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.registers; + +import net.minecraft.world.level.block.LeavesBlock; +import net.minecraft.world.level.block.SlabBlock; +import net.minecraft.world.level.block.StairBlock; +import net.neoforged.neoforge.registries.DeferredBlock; +import net.neoforged.neoforge.registries.DeferredRegister; +import org.hiedacamellia.hiedanoakyuunomakimono.HiedanoAkyuunoMakimono; + +public class HAMBlock { + public static final DeferredRegister.Blocks BLOCKS = DeferredRegister.createBlocks(HiedanoAkyuunoMakimono.MODID); + + + +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMBlockEntity.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMBlockEntity.java new file mode 100644 index 0000000..0647265 --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMBlockEntity.java @@ -0,0 +1,11 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.registers; + +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.neoforged.neoforge.registries.DeferredRegister; +import org.hiedacamellia.hiedanoakyuunomakimono.HiedanoAkyuunoMakimono; + +public class HAMBlockEntity { + public static final DeferredRegister> BLOCK_ENTITIES = DeferredRegister.create(BuiltInRegistries.BLOCK_ENTITY_TYPE, HiedanoAkyuunoMakimono.MODID); + +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMBlockItem.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMBlockItem.java new file mode 100644 index 0000000..33793dd --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMBlockItem.java @@ -0,0 +1,11 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.registers; + +import net.minecraft.world.item.BlockItem; +import net.neoforged.neoforge.registries.DeferredItem; +import net.neoforged.neoforge.registries.DeferredRegister; +import org.hiedacamellia.hiedanoakyuunomakimono.HiedanoAkyuunoMakimono; + +public class HAMBlockItem { + public static final DeferredRegister.Items ITEMS = DeferredRegister.createItems(HiedanoAkyuunoMakimono.MODID); + +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMDataComponent.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMDataComponent.java new file mode 100644 index 0000000..1a52622 --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMDataComponent.java @@ -0,0 +1,11 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.registers; + +import net.minecraft.core.component.DataComponentType; +import net.neoforged.neoforge.registries.DeferredHolder; +import net.neoforged.neoforge.registries.DeferredRegister; +import org.hiedacamellia.hiedanoakyuunomakimono.HiedanoAkyuunoMakimono; + +public class HAMDataComponent { + public static final DeferredRegister.DataComponents DATA_COMPONENTS = DeferredRegister.createDataComponents(HiedanoAkyuunoMakimono.MODID); + +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMEffect.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMEffect.java new file mode 100644 index 0000000..7441175 --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMEffect.java @@ -0,0 +1,13 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.registers; + +import net.minecraft.core.registries.Registries; +import net.minecraft.world.effect.MobEffect; +import net.neoforged.neoforge.registries.DeferredHolder; +import net.neoforged.neoforge.registries.DeferredRegister; +import org.hiedacamellia.hiedanoakyuunomakimono.HiedanoAkyuunoMakimono; + +public class HAMEffect { + public static final DeferredRegister EFFECTS = DeferredRegister.create(Registries.MOB_EFFECT, HiedanoAkyuunoMakimono.MODID); + + +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMItem.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMItem.java new file mode 100644 index 0000000..71e4603 --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMItem.java @@ -0,0 +1,15 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.registers; + +import net.minecraft.world.food.FoodProperties; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.Rarity; +import net.neoforged.neoforge.registries.DeferredItem; +import net.neoforged.neoforge.registries.DeferredRegister; +import org.hiedacamellia.hiedanoakyuunomakimono.HiedanoAkyuunoMakimono; + + +public class HAMItem { + + public static final DeferredRegister.Items ITEMS = DeferredRegister.createItems(HiedanoAkyuunoMakimono.MODID); + +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMMenu.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMMenu.java new file mode 100644 index 0000000..1908d34 --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMMenu.java @@ -0,0 +1,14 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.registers; + +import net.minecraft.core.registries.Registries; +import net.minecraft.world.inventory.MenuType; +import net.neoforged.neoforge.common.extensions.IMenuTypeExtension; +import net.neoforged.neoforge.registries.DeferredRegister; +import org.hiedacamellia.hiedanoakyuunomakimono.HiedanoAkyuunoMakimono; + +import java.util.function.Supplier; + +public class HAMMenu { + public static final DeferredRegister> MENUS = DeferredRegister.create(Registries.MENU, HiedanoAkyuunoMakimono.MODID); + +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMRicipe.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMRicipe.java new file mode 100644 index 0000000..3cad8fc --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMRicipe.java @@ -0,0 +1,14 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.registers; + +import net.minecraft.core.registries.Registries; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.crafting.RecipeType; +import net.neoforged.neoforge.registries.DeferredHolder; +import net.neoforged.neoforge.registries.DeferredRegister; +import org.hiedacamellia.hiedanoakyuunomakimono.HiedanoAkyuunoMakimono; + +public class HAMRicipe { + public static final DeferredRegister> RECIPE_TYPES = + DeferredRegister.create(Registries.RECIPE_TYPE, HiedanoAkyuunoMakimono.MODID); + +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMRicipeSerializer.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMRicipeSerializer.java new file mode 100644 index 0000000..48f91e2 --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMRicipeSerializer.java @@ -0,0 +1,14 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.registers; + +import net.minecraft.core.registries.Registries; +import net.minecraft.world.item.crafting.RecipeSerializer; +import net.neoforged.neoforge.registries.DeferredRegister; +import org.hiedacamellia.hiedanoakyuunomakimono.HiedanoAkyuunoMakimono; + +import java.util.function.Supplier; + +public class HAMRicipeSerializer { + public static final DeferredRegister> RECIPE_SERIALIZERS = + DeferredRegister.create(Registries.RECIPE_SERIALIZER, HiedanoAkyuunoMakimono.MODID); + +} diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMScreen.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMScreen.java new file mode 100644 index 0000000..e04fb03 --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMScreen.java @@ -0,0 +1,14 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.registers; + + +import net.neoforged.api.distmarker.Dist; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.EventBusSubscriber; +import net.neoforged.neoforge.client.event.RegisterMenuScreensEvent; + +@EventBusSubscriber(bus = EventBusSubscriber.Bus.MOD, value = Dist.CLIENT) +public class HAMScreen { + @SubscribeEvent + public static void clientLoad(RegisterMenuScreensEvent event) { + } +} \ No newline at end of file diff --git a/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMTab.java b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMTab.java new file mode 100644 index 0000000..d39e21c --- /dev/null +++ b/src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/registers/HAMTab.java @@ -0,0 +1,25 @@ +package org.hiedacamellia.hiedanoakyuunomakimono.registers; + +import net.minecraft.core.registries.Registries; +import net.minecraft.network.chat.Component; +import net.minecraft.world.item.*; +import net.neoforged.neoforge.registries.DeferredHolder; +import net.neoforged.neoforge.registries.DeferredRegister; +import org.hiedacamellia.hiedanoakyuunomakimono.HiedanoAkyuunoMakimono; + +public class HAMTab { + public static final DeferredRegister TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, HiedanoAkyuunoMakimono.MODID); + + public static final DeferredHolder WG_TAB = TABS.register("hiedanoakyuunomakimono", () -> CreativeModeTab.builder() + .title(Component.translatable("itemGroup.hiedanoakyuunomakimono")) //The language key for the title of your CreativeModeTab + .withTabsBefore(CreativeModeTabs.COMBAT) + //.icon() + .displayItems((parameters, tab) -> { + for(DeferredHolder item: HAMBlockItem.ITEMS.getEntries()){ + tab.accept(item.get()); + } + for(DeferredHolder item: HAMItem.ITEMS.getEntries()){ + tab.accept(item.get()); + } + }).build()); +}