From 53ad95cccc1254481c4e4f8a888b4fb77109f959 Mon Sep 17 00:00:00 2001 From: rtm516 Date: Fri, 5 Apr 2024 21:30:08 +0100 Subject: [PATCH] Rework entire creative category/group mapping system --- .../hydraulic/item/CreativeMapping.java | 9 +- .../hydraulic/item/CreativeMappingTarget.java | 10 + .../hydraulic/item/CreativeMappings.java | 383 ++++++++++++++---- .../hydraulic/item/ItemPackModule.java | 2 + .../geysermc/hydraulic/util/ItemGroup.java | 94 +++++ 5 files changed, 420 insertions(+), 78 deletions(-) create mode 100644 shared/src/main/java/org/geysermc/hydraulic/item/CreativeMappingTarget.java create mode 100644 shared/src/main/java/org/geysermc/hydraulic/util/ItemGroup.java diff --git a/shared/src/main/java/org/geysermc/hydraulic/item/CreativeMapping.java b/shared/src/main/java/org/geysermc/hydraulic/item/CreativeMapping.java index 846d920..f462b77 100644 --- a/shared/src/main/java/org/geysermc/hydraulic/item/CreativeMapping.java +++ b/shared/src/main/java/org/geysermc/hydraulic/item/CreativeMapping.java @@ -1,18 +1,15 @@ package org.geysermc.hydraulic.item; import org.geysermc.geyser.api.util.CreativeCategory; +import org.geysermc.hydraulic.util.ItemGroup; import org.jetbrains.annotations.NotNull; /** * Represents a creative mapping for the creative * group and {@link CreativeCategory category}. */ -public record CreativeMapping(@NotNull String creativeGroup, @NotNull CreativeCategory creativeCategory) { - public CreativeMapping(String creativeGroup) { - this(creativeGroup, CreativeCategory.ITEMS); - } - +public record CreativeMapping(@NotNull ItemGroup creativeGroup, @NotNull CreativeCategory creativeCategory) { public CreativeMapping(CreativeCategory creativeCategory) { - this("", creativeCategory); + this(ItemGroup.NONE, creativeCategory); } } diff --git a/shared/src/main/java/org/geysermc/hydraulic/item/CreativeMappingTarget.java b/shared/src/main/java/org/geysermc/hydraulic/item/CreativeMappingTarget.java new file mode 100644 index 0000000..00d9767 --- /dev/null +++ b/shared/src/main/java/org/geysermc/hydraulic/item/CreativeMappingTarget.java @@ -0,0 +1,10 @@ +package org.geysermc.hydraulic.item; + +import net.minecraft.tags.TagKey; +import net.minecraft.world.item.Item; +import net.minecraft.world.level.block.Block; + +import java.util.List; + +public record CreativeMappingTarget(List> itemClasses, List> itemTags, List> blockClasses, List> blockTags) { +} diff --git a/shared/src/main/java/org/geysermc/hydraulic/item/CreativeMappings.java b/shared/src/main/java/org/geysermc/hydraulic/item/CreativeMappings.java index 7ed5dd1..393a852 100644 --- a/shared/src/main/java/org/geysermc/hydraulic/item/CreativeMappings.java +++ b/shared/src/main/java/org/geysermc/hydraulic/item/CreativeMappings.java @@ -1,122 +1,361 @@ package org.geysermc.hydraulic.item; +import net.minecraft.tags.BlockTags; +import net.minecraft.tags.ItemTags; +import net.minecraft.tags.TagKey; import net.minecraft.world.item.*; import net.minecraft.world.level.block.*; +import net.minecraft.world.level.block.state.BlockState; import org.geysermc.geyser.api.block.custom.CustomBlockData; import org.geysermc.geyser.api.item.custom.NonVanillaCustomItemData; import org.geysermc.geyser.api.util.CreativeCategory; +import org.geysermc.hydraulic.util.ItemGroup; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; /** * Contains mappings for items to their creative groups and categories. */ public class CreativeMappings { - // https://wiki.bedrock.dev/documentation/creative-categories.html - private static final Map, CreativeMapping> CREATIVE_ITEM_MAPPINGS = new LinkedHashMap<>() { + private static final Map CREATIVE_MAPPINGS = new LinkedHashMap<>() { { - put(ArmorItem.class, new CreativeMapping(CreativeCategory.EQUIPMENT)); - put(ArrowItem.class, new CreativeMapping("itemGroup.name.arrow", CreativeCategory.EQUIPMENT)); - put(AxeItem.class, new CreativeMapping("itemGroup.name.axe", CreativeCategory.EQUIPMENT)); - put(BannerPatternItem.class, new CreativeMapping("itemGroup.name.banner_pattern")); - put(BowItem.class, new CreativeMapping(CreativeCategory.EQUIPMENT)); - put(HoeItem.class, new CreativeMapping("itemGroup.name.hoe", CreativeCategory.EQUIPMENT)); - put(HorseArmorItem.class, new CreativeMapping("itemGroup.name.horseArmor", CreativeCategory.EQUIPMENT)); - put(MinecartItem.class, new CreativeMapping("itemGroup.name.minecart")); - put(PickaxeItem.class, new CreativeMapping("itemGroup.name.pickaxe", CreativeCategory.EQUIPMENT)); - put(RecordItem.class, new CreativeMapping("itemGroup.name.record")); - put(ShearsItem.class, new CreativeMapping(CreativeCategory.EQUIPMENT)); - put(ShovelItem.class, new CreativeMapping("itemGroup.name.shovel", CreativeCategory.EQUIPMENT)); - put(SpawnEggItem.class, new CreativeMapping("itemGroup.name.mobEgg", CreativeCategory.NATURE)); // Added differently to bedrock https://wiki.bedrock.dev/visuals/retexturing-spawn-eggs.html - put(SwordItem.class, new CreativeMapping("itemGroup.name.sword", CreativeCategory.EQUIPMENT)); - put(HangingSignItem.class , new CreativeMapping("itemGroup.name.hanging_sign")); - put(SignItem.class , new CreativeMapping("itemGroup.name.sign")); - put(SmithingTemplateItem.class , new CreativeMapping("itemGroup.name.smithing_templates")); - - // Fallbacks for more base level classes - put(TieredItem.class, new CreativeMapping(CreativeCategory.EQUIPMENT)); - } - }; + // region --- Construction --- + put(new CreativeMappingTarget( + List.of(), + List.of(), + List.of(SlabBlock.class), + List.of() + ), new CreativeMapping(ItemGroup.SLABS, CreativeCategory.CONSTRUCTION)); - private static final Map, CreativeMapping> CREATIVE_BLOCK_MAPPINGS = new LinkedHashMap<>() { - { - put(AnvilBlock.class, new CreativeMapping("itemGroup.name.anvil")); - - put(LeavesBlock.class, new CreativeMapping("itemGroup.name.leaves", CreativeCategory.NATURE)); - put(SaplingBlock.class, new CreativeMapping("itemGroup.name.sapling", CreativeCategory.NATURE)); - put(TallFlowerBlock.class, new CreativeMapping("itemGroup.name.flower", CreativeCategory.NATURE)); - put(FlowerBlock.class, new CreativeMapping("itemGroup.name.flower", CreativeCategory.NATURE)); - put(PinkPetalsBlock.class, new CreativeMapping("itemGroup.name.flower", CreativeCategory.NATURE)); - put(CropBlock.class, new CreativeMapping("itemGroup.name.crop", CreativeCategory.NATURE)); - put(HugeMushroomBlock.class, new CreativeMapping("itemGroup.name.mushroom", CreativeCategory.NATURE)); - put(MushroomBlock.class, new CreativeMapping("itemGroup.name.mushroom", CreativeCategory.NATURE)); - - put(SlabBlock.class, new CreativeMapping("itemGroup.name.slab", CreativeCategory.CONSTRUCTION)); - put(FenceGateBlock.class, new CreativeMapping("itemGroup.name.fenceGate", CreativeCategory.CONSTRUCTION)); - put(FenceBlock.class, new CreativeMapping("itemGroup.name.fence", CreativeCategory.CONSTRUCTION)); - put(DoorBlock.class, new CreativeMapping("itemGroup.name.door", CreativeCategory.CONSTRUCTION)); - put(TrapDoorBlock.class, new CreativeMapping("itemGroup.name.trapdoor", CreativeCategory.CONSTRUCTION)); - put(StairBlock.class, new CreativeMapping("itemGroup.name.stairs", CreativeCategory.CONSTRUCTION)); - put(WallBlock.class, new CreativeMapping("itemGroup.name.walls", CreativeCategory.CONSTRUCTION)); - - put(CeilingHangingSignBlock.class, new CreativeMapping("itemGroup.name.hanging_sign")); - put(WallHangingSignBlock.class, new CreativeMapping("itemGroup.name.hanging_sign")); - put(SignBlock.class, new CreativeMapping("itemGroup.name.sign")); - - put(ButtonBlock.class, new CreativeMapping("itemGroup.name.buttons")); - put(PressurePlateBlock.class, new CreativeMapping("itemGroup.name.pressurePlate")); - - // Fallbacks for more base level classes - put(GrowingPlantBlock.class, new CreativeMapping(CreativeCategory.NATURE)); - put(VineBlock.class, new CreativeMapping(CreativeCategory.NATURE)); - put(BushBlock.class, new CreativeMapping(CreativeCategory.NATURE)); + put(new CreativeMappingTarget( + List.of(), + List.of(), + List.of(FenceGateBlock.class), + List.of() + ), new CreativeMapping(ItemGroup.FENCE_GATES, CreativeCategory.CONSTRUCTION)); + + put(new CreativeMappingTarget( + List.of(), + List.of(), + List.of(FenceBlock.class), + List.of() + ), new CreativeMapping(ItemGroup.FENCES, CreativeCategory.CONSTRUCTION)); + + put(new CreativeMappingTarget( + List.of(), + List.of(), + List.of(DoorBlock.class), + List.of() + ), new CreativeMapping(ItemGroup.DOORS, CreativeCategory.CONSTRUCTION)); + + put(new CreativeMappingTarget( + List.of(), + List.of(), + List.of(TrapDoorBlock.class), + List.of() + ), new CreativeMapping(ItemGroup.TRAPDOORS, CreativeCategory.CONSTRUCTION)); + + put(new CreativeMappingTarget( + List.of(), + List.of(), + List.of(StairBlock.class), + List.of() + ), new CreativeMapping(ItemGroup.STAIRS, CreativeCategory.CONSTRUCTION)); + + put(new CreativeMappingTarget( + List.of(), + List.of(), + List.of(WallBlock.class), + List.of() + ), new CreativeMapping(ItemGroup.WALLS, CreativeCategory.CONSTRUCTION)); + // endregion + + // region --- Nature --- + put(new CreativeMappingTarget( + List.of(), + List.of(), + List.of(CropBlock.class), + List.of() + ), new CreativeMapping(ItemGroup.CROPS, CreativeCategory.NATURE)); + + put(new CreativeMappingTarget( + List.of(), + List.of(), + List.of(FlowerBlock.class, PinkPetalsBlock.class, TallFlowerBlock.class), + List.of() + ), new CreativeMapping(ItemGroup.FLOWERS, CreativeCategory.NATURE)); + + put(new CreativeMappingTarget( + List.of(), + List.of(), + List.of(LeavesBlock.class), + List.of() + ), new CreativeMapping(ItemGroup.LEAVES, CreativeCategory.NATURE)); + + // TODO Remove, these are added differently to bedrock https://wiki.bedrock.dev/visuals/retexturing-spawn-eggs.html + put(new CreativeMappingTarget( + List.of(SpawnEggItem.class), + List.of(), + List.of(), + List.of() + ), new CreativeMapping(ItemGroup.MOB_EGGS, CreativeCategory.NATURE)); + + put(new CreativeMappingTarget( + List.of(), + List.of(), + List.of(HugeMushroomBlock.class, MushroomBlock.class), + List.of() + ), new CreativeMapping(ItemGroup.MUSHROOMS, CreativeCategory.NATURE)); + + put(new CreativeMappingTarget( + List.of(), + List.of(), + List.of(SaplingBlock.class), + List.of() + ), new CreativeMapping(ItemGroup.SAPLINGS, CreativeCategory.NATURE)); + // endregion + + // region --- Equipment --- + put(new CreativeMappingTarget( + List.of(ArrowItem.class), + List.of(), + List.of(), + List.of() + ), new CreativeMapping(ItemGroup.ARROWS, CreativeCategory.EQUIPMENT)); + + put(new CreativeMappingTarget( + List.of(AxeItem.class), + List.of(), + List.of(), + List.of() + ), new CreativeMapping(ItemGroup.AXES, CreativeCategory.EQUIPMENT)); + + put(new CreativeMappingTarget( + List.of(HoeItem.class), + List.of(), + List.of(), + List.of() + ), new CreativeMapping(ItemGroup.HOES, CreativeCategory.EQUIPMENT)); + + put(new CreativeMappingTarget( + List.of(HorseArmorItem.class), + List.of(), + List.of(), + List.of() + ), new CreativeMapping(ItemGroup.HORSE_ARMOR, CreativeCategory.EQUIPMENT)); + + put(new CreativeMappingTarget( + List.of(PickaxeItem.class), + List.of(), + List.of(), + List.of() + ), new CreativeMapping(ItemGroup.PICKAXES, CreativeCategory.EQUIPMENT)); + + put(new CreativeMappingTarget( + List.of(ShovelItem.class), + List.of(), + List.of(), + List.of() + ), new CreativeMapping(ItemGroup.SHOVELS, CreativeCategory.EQUIPMENT)); + + put(new CreativeMappingTarget( + List.of(SwordItem.class), + List.of(), + List.of(), + List.of() + ), new CreativeMapping(ItemGroup.SWORDS, CreativeCategory.EQUIPMENT)); + // endregion + + // region --- Items --- + put(new CreativeMappingTarget( + List.of(), + List.of(), + List.of(AnvilBlock.class), + List.of() + ), new CreativeMapping(ItemGroup.ANVILS, CreativeCategory.ITEMS)); + + put(new CreativeMappingTarget( + List.of(BannerPatternItem.class), + List.of(), + List.of(), + List.of() + ), new CreativeMapping(ItemGroup.BANNER_PATTERNS, CreativeCategory.ITEMS)); + + put(new CreativeMappingTarget( + List.of(), + List.of(ItemTags.CHEST_BOATS), + List.of(), + List.of() + ), new CreativeMapping(ItemGroup.BOATS_WITH_CHEST, CreativeCategory.ITEMS)); + + put(new CreativeMappingTarget( + List.of(), + List.of(ItemTags.BOATS), + List.of(), + List.of() + ), new CreativeMapping(ItemGroup.BOATS, CreativeCategory.ITEMS)); + + put(new CreativeMappingTarget( + List.of(), + List.of(), + List.of(ButtonBlock.class), + List.of() + ), new CreativeMapping(ItemGroup.BUTTONS, CreativeCategory.ITEMS)); + + put(new CreativeMappingTarget( + List.of(HangingSignItem.class), + List.of(ItemTags.HANGING_SIGNS), + List.of(CeilingHangingSignBlock.class, WallHangingSignBlock.class), + List.of(BlockTags.CEILING_HANGING_SIGNS, BlockTags.WALL_HANGING_SIGNS) + ), new CreativeMapping(ItemGroup.HANGING_SIGNS, CreativeCategory.ITEMS)); + + put(new CreativeMappingTarget( + List.of(MinecartItem.class), + List.of(), + List.of(), + List.of() + ), new CreativeMapping(ItemGroup.MINECARTS, CreativeCategory.ITEMS)); + + put(new CreativeMappingTarget( + List.of(), + List.of(), + List.of(PressurePlateBlock.class), + List.of() + ), new CreativeMapping(ItemGroup.PRESSURE_PLATES, CreativeCategory.ITEMS)); + + put(new CreativeMappingTarget( + List.of(RecordItem.class), + List.of(), + List.of(), + List.of() + ), new CreativeMapping(ItemGroup.RECORDS, CreativeCategory.ITEMS)); + + put(new CreativeMappingTarget( + List.of(SignItem.class), + List.of(ItemTags.SIGNS), + List.of(SignBlock.class), + List.of(BlockTags.WALL_SIGNS, BlockTags.STANDING_SIGNS) + ), new CreativeMapping(ItemGroup.SIGNS, CreativeCategory.ITEMS)); + + put(new CreativeMappingTarget( + List.of(SmithingTemplateItem.class), + List.of(), + List.of(), + List.of() + ), new CreativeMapping(ItemGroup.SMITHING_TEMPLATES, CreativeCategory.ITEMS)); + // endregion + + // region --- Fallbacks --- + put(new CreativeMappingTarget( + List.of(), + List.of(), + List.of(GrowingPlantBlock.class, VineBlock.class, BushBlock.class), + List.of() + ), new CreativeMapping(CreativeCategory.NATURE)); + + put(new CreativeMappingTarget( + List.of(ArmorItem.class, BowItem.class, ShearsItem.class, TieredItem.class), + List.of(), + List.of(), + List.of() + ), new CreativeMapping(CreativeCategory.EQUIPMENT)); + // endregion } }; - static void setup(Item item, NonVanillaCustomItemData.Builder customItemBuilder) { - CreativeMapping mapping = getMapping(item.getClass(), CREATIVE_ITEM_MAPPINGS); + public static void setup(Item item, NonVanillaCustomItemData.Builder customItemBuilder) { + CreativeMapping mapping = getMapping(item); if (mapping == null) { return; } - customItemBuilder.creativeGroup(mapping.creativeGroup()).creativeCategory(mapping.creativeCategory().id()); + customItemBuilder.creativeGroup(mapping.creativeGroup().group()).creativeCategory(mapping.creativeCategory().id()); } public static void setupBlock(Block block, NonVanillaCustomItemData.Builder customItemBuilder) { - CreativeMapping mapping = getMapping(block.getClass(), CREATIVE_BLOCK_MAPPINGS); + CreativeMapping mapping = getMapping(block); if (mapping == null) { return; } - customItemBuilder.creativeGroup(mapping.creativeGroup()).creativeCategory(mapping.creativeCategory().id()); + customItemBuilder.creativeGroup(mapping.creativeGroup().group()).creativeCategory(mapping.creativeCategory().id()); } public static void setupBlock(Block block, CustomBlockData.Builder customItemBuilder) { - CreativeMapping mapping = getMapping(block.getClass(), CREATIVE_BLOCK_MAPPINGS); + CreativeMapping mapping = getMapping(block); if (mapping == null) { return; } - customItemBuilder.creativeGroup(mapping.creativeGroup()).creativeCategory(mapping.creativeCategory()); + customItemBuilder.creativeGroup(mapping.creativeGroup().group()).creativeCategory(mapping.creativeCategory()); } - private static CreativeMapping getMapping(Class inputClass, Map mappings) { - CreativeMapping mapping = mappings.get(inputClass); + private static CreativeMapping getMapping(Item item) { + Class itemClass = item.getClass(); + ItemStack itemStack = item.getDefaultInstance(); - // Try to find any inheritance mappings - if (mapping == null) { - for (Map.Entry entry : mappings.entrySet()) { - if (((Class)entry.getKey()).isAssignableFrom(inputClass)) { - mapping = entry.getValue(); - break; + for (Map.Entry entry : CREATIVE_MAPPINGS.entrySet()) { + CreativeMappingTarget target = entry.getKey(); + + // Check item classes + if (!target.itemClasses().isEmpty()) { + if (target.itemClasses().contains(itemClass)) { + return entry.getValue(); + } + for (Class targetItemClass : target.itemClasses()) { + if (targetItemClass.isAssignableFrom(itemClass)) { + return entry.getValue(); + } + } + } + + // Check item tags + if (!target.itemTags().isEmpty()) { + for (TagKey tag : target.itemTags()) { + if (itemStack.is(tag)) { + return entry.getValue(); + } + } + } + } + + return null; + } + + private static CreativeMapping getMapping(Block block) { + Class blockClass = block.getClass(); + BlockState blockState = block.defaultBlockState(); + + for (Map.Entry entry : CREATIVE_MAPPINGS.entrySet()) { + CreativeMappingTarget target = entry.getKey(); + + // Check block classes + if (!target.blockClasses().isEmpty()) { + if (target.blockClasses().contains(blockClass)) { + return entry.getValue(); + } + for (Class targetBlockClass : target.blockClasses()) { + if (targetBlockClass.isAssignableFrom(blockClass)) { + return entry.getValue(); + } + } + } + + // Check block tags + if (!target.blockTags().isEmpty()) { + for (TagKey tag : target.blockTags()) { + if (blockState.is(tag)) { + return entry.getValue(); + } } } } - return mapping; + return null; } } diff --git a/shared/src/main/java/org/geysermc/hydraulic/item/ItemPackModule.java b/shared/src/main/java/org/geysermc/hydraulic/item/ItemPackModule.java index fb58ce0..043f70a 100644 --- a/shared/src/main/java/org/geysermc/hydraulic/item/ItemPackModule.java +++ b/shared/src/main/java/org/geysermc/hydraulic/item/ItemPackModule.java @@ -6,6 +6,7 @@ import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; import net.minecraft.resources.ResourceLocation; +import net.minecraft.tags.ItemTags; import net.minecraft.world.item.ArmorItem; import net.minecraft.world.item.AxeItem; import net.minecraft.world.item.BlockItem; @@ -28,6 +29,7 @@ import org.geysermc.hydraulic.pack.context.PackEventContext; import org.geysermc.hydraulic.pack.context.PackPostProcessContext; import org.geysermc.hydraulic.pack.context.PackPreProcessContext; +import org.geysermc.hydraulic.util.ItemGroup; import org.geysermc.hydraulic.util.PackUtil; import org.geysermc.pack.bedrock.resource.BedrockResourcePack; import org.geysermc.pack.converter.converter.model.ModelStitcher; diff --git a/shared/src/main/java/org/geysermc/hydraulic/util/ItemGroup.java b/shared/src/main/java/org/geysermc/hydraulic/util/ItemGroup.java new file mode 100644 index 0000000..d68f00c --- /dev/null +++ b/shared/src/main/java/org/geysermc/hydraulic/util/ItemGroup.java @@ -0,0 +1,94 @@ +package org.geysermc.hydraulic.util; + +public enum ItemGroup { + NONE(""), + PLANKS("itemGroup.name.planks"), + WALLS("itemGroup.name.walls"), + FENCES("itemGroup.name.fence"), + FENCE_GATES("itemGroup.name.fenceGate"), + STAIRS("itemGroup.name.stairs"), + DOORS("itemGroup.name.door"), + GLASS("itemGroup.name.glass"), + GLASS_PANES("itemGroup.name.glassPane"), + PERMISSION_BLOCKS("itemGroup.name.permission"), + SLABS("itemGroup.name.slab"), + DECORATIVE_STONE("itemGroup.name.stoneBrick"), + SANDSTONE("itemGroup.name.sandstone"), + WOOL("itemGroup.name.wool"), + WOOL_CARPET("itemGroup.name.woolCarpet"), + CONCRETE_POWDER("itemGroup.name.concretePowder"), + CONCRETE("itemGroup.name.concrete"), + TERRACOTTA("itemGroup.name.stainedClay"), + GLAZED_TERRACOTTAS("itemGroup.name.glazedTerracotta"), + DYES("itemGroup.name.dye"), + ORES("itemGroup.name.ore"), + STONE("itemGroup.name.stone"), + LOGS("itemGroup.name.log"), + LEAVES("itemGroup.name.leaves"), + SAPLINGS("itemGroup.name.sapling"), + SEEDS("itemGroup.name.seed"), + CROPS("itemGroup.name.crop"), + GROUND_COVER("itemGroup.name.grass"), + FLOWERS("itemGroup.name.flower"), + RAW_FOOD("itemGroup.name.rawFood"), + COOKED_FOOD("itemGroup.name.cookedFood"), + MISCELLANEOUS_FOODS("itemGroup.name.miscFood"), + MUSHROOMS("itemGroup.name.mushroom"), + INFESTED_STONE("itemGroup.name.monsterStoneEgg"), + MOB_EGGS("itemGroup.name.mobEgg"), + HELMETS("itemGroup.name.helmet"), + CHESTPLATES("itemGroup.name.chestplate"), + LEGGINGS("itemGroup.name.leggings"), + BOOTS("itemGroup.name.boots"), + HORSE_ARMOR("itemGroup.name.horseArmor"), + SWORDS("itemGroup.name.sword"), + AXES("itemGroup.name.axe"), + PICKAXES("itemGroup.name.pickaxe"), + SHOVELS("itemGroup.name.shovel"), + HOES("itemGroup.name.hoe"), + ARROWS("itemGroup.name.arrow"), + POTIONS("itemGroup.name.potion"), + SPLASH_POTIONS("itemGroup.name.splashPotion"), + LINGERING_POTIONS("itemGroup.name.lingeringPotion"), + BEDS("itemGroup.name.bed"), + CHALKBOARDS("itemGroup.name.chalkboard"), + ANVILS("itemGroup.name.anvil"), + CHESTS("itemGroup.name.chest"), + SHULKER_BOXES("itemGroup.name.shulkerBox"), + RECORDS("itemGroup.name.record"), + MOB_SKULLS("itemGroup.name.skull"), + BOATS("itemGroup.name.boat"), + BOATS_WITH_CHEST("itemGroup.name.chestboat"), + RAILS("itemGroup.name.rail"), + MINECARTS("itemGroup.name.minecart"), + PRESSURE_PLATES("itemGroup.name.pressurePlate"), + TRAPDOORS("itemGroup.name.trapdoor"), + ENCHANTED_BOOKS("itemGroup.name.enchantedBook"), + BANNERS("itemGroup.name.banner"), + FIREWORKS("itemGroup.name.firework"), + FIREWORK_CHARGES("itemGroup.name.fireworkStars"), + CORAL_BLOCKS("itemGroup.name.coral"), + CORAL_DECORATIONS("itemGroup.name.coral_decorations"), + BUTTONS("itemGroup.name.buttons"), + SIGNS("itemGroup.name.sign"), + WOODS("itemGroup.name.wood"), + BANNER_PATTERNS("itemGroup.name.banner_pattern"), + NETHER_WARTS("itemGroup.name.netherWartBlock"), + CANDLES("itemGroup.name.candles"), + GOAT_HORNS("itemGroup.name.goatHorn"), + SCULK("itemGroup.name.sculk"), + HANGING_SIGNS("itemGroup.name.hanging_sign"), + POTTERY_SHERDS("itemGroup.name.potterySherds"), + SMITHING_TEMPLATES("itemGroup.name.smithing_templates"), + COPPER("itemGroup.name.copper"); + + private final String group; + + ItemGroup(String group) { + this.group = group; + } + + public String group() { + return group; + } +}