diff --git a/gradle.properties b/gradle.properties index b3b72c1..c1bc917 100644 --- a/gradle.properties +++ b/gradle.properties @@ -28,7 +28,7 @@ loader_version_range=[4,) mod_id=advancedgrindstone mod_name=Advanced Grindstone mod_license=GNU GPLv3 -mod_version=0.0.1 +mod_version=0.0.2 mod_group_id=net.ramen5914.advancedgrindstone mod_authors=Omar Rahman (Ramen5914) mod_description=A special grindstone to remove specific enchants or curses! diff --git a/src/generated/resources/assets/advancedgrindstone/lang/en_us.json b/src/generated/resources/assets/advancedgrindstone/lang/en_us.json index 5c3e04a..ffee865 100644 --- a/src/generated/resources/assets/advancedgrindstone/lang/en_us.json +++ b/src/generated/resources/assets/advancedgrindstone/lang/en_us.json @@ -1,4 +1,5 @@ { "block.advancedgrindstone.advanced_grindstone": "Advanced Grindstone", - "container.advancedgrindstone.advanced_grindstone_title": "Advanced Grindstone" + "container.advancedgrindstone.advanced_grindstone_title": "Advanced Grindstone", + "itemgroup.advancedgrindstone.advanced_grindstone_tab": "Ramen's Additions" } \ No newline at end of file diff --git a/src/main/java/net/ramen5914/advancedgrindstone/AdvancedGrindstone.java b/src/main/java/net/ramen5914/advancedgrindstone/AdvancedGrindstone.java index 4145285..a9d8047 100644 --- a/src/main/java/net/ramen5914/advancedgrindstone/AdvancedGrindstone.java +++ b/src/main/java/net/ramen5914/advancedgrindstone/AdvancedGrindstone.java @@ -28,6 +28,8 @@ public class AdvancedGrindstone { public AdvancedGrindstone(IEventBus modEventBus, ModContainer modContainer) { modEventBus.addListener(this::commonSetup); + ModCreativeModeTabs.register(modEventBus); + ModBlocks.register(modEventBus); ModItems.register(modEventBus); ModMenuTypes.register(modEventBus); diff --git a/src/main/java/net/ramen5914/advancedgrindstone/ModCreativeModeTabs.java b/src/main/java/net/ramen5914/advancedgrindstone/ModCreativeModeTabs.java new file mode 100644 index 0000000..4b03d49 --- /dev/null +++ b/src/main/java/net/ramen5914/advancedgrindstone/ModCreativeModeTabs.java @@ -0,0 +1,28 @@ +package net.ramen5914.advancedgrindstone; + +import net.minecraft.core.registries.Registries; +import net.minecraft.network.chat.Component; +import net.minecraft.world.item.CreativeModeTab; +import net.minecraft.world.item.ItemStack; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.registries.DeferredRegister; +import net.ramen5914.advancedgrindstone.block.ModBlocks; + +import java.util.function.Supplier; + +public class ModCreativeModeTabs { + public static DeferredRegister CREATIVE_MODE_TABS = + DeferredRegister.create(Registries.CREATIVE_MODE_TAB, AdvancedGrindstone.MOD_ID); + + public static final Supplier ADVANCED_GRINDSTONE_TAB = + CREATIVE_MODE_TABS.register("advanced_grindstone_tab", () -> CreativeModeTab.builder() + .title(Component.translatable(String.format("itemgroup.%s.advanced_grindstone_tab", AdvancedGrindstone.MOD_ID))) + .icon(() -> new ItemStack(ModBlocks.ADVANCED_GRINDSTONE.get())) + .displayItems((parameters, output) -> { + output.accept(ModBlocks.ADVANCED_GRINDSTONE); + }).build()); + + public static void register(IEventBus eventBus) { + CREATIVE_MODE_TABS.register(eventBus); + } +} diff --git a/src/main/java/net/ramen5914/advancedgrindstone/datagen/ModEnglishLangProvider.java b/src/main/java/net/ramen5914/advancedgrindstone/datagen/ModEnglishLangProvider.java index 7f9390c..ee67e22 100644 --- a/src/main/java/net/ramen5914/advancedgrindstone/datagen/ModEnglishLangProvider.java +++ b/src/main/java/net/ramen5914/advancedgrindstone/datagen/ModEnglishLangProvider.java @@ -2,7 +2,6 @@ import net.minecraft.data.PackOutput; import net.neoforged.neoforge.common.data.LanguageProvider; - import net.ramen5914.advancedgrindstone.AdvancedGrindstone; import net.ramen5914.advancedgrindstone.block.ModBlocks; @@ -15,6 +14,7 @@ public ModEnglishLangProvider(PackOutput output) { protected void addTranslations() { addBlock(ModBlocks.ADVANCED_GRINDSTONE, "Advanced Grindstone"); - add("container.advancedgrindstone.advanced_grindstone_title", "Advanced Grindstone"); + add(String.format("container.%s.advanced_grindstone_title", AdvancedGrindstone.MOD_ID), "Advanced Grindstone"); + add(String.format("itemgroup.%s.advanced_grindstone_tab", AdvancedGrindstone.MOD_ID), "Ramen's Additions"); } } diff --git a/src/main/java/net/ramen5914/advancedgrindstone/datagen/ModRecipeProvider.java b/src/main/java/net/ramen5914/advancedgrindstone/datagen/ModRecipeProvider.java index ad962cf..c27e148 100644 --- a/src/main/java/net/ramen5914/advancedgrindstone/datagen/ModRecipeProvider.java +++ b/src/main/java/net/ramen5914/advancedgrindstone/datagen/ModRecipeProvider.java @@ -6,7 +6,6 @@ import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.data.recipes.RecipeProvider; import net.minecraft.data.recipes.SmithingTransformRecipeBuilder; -import net.minecraft.world.item.Item; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.level.block.Blocks;