feat: more groups finished

This commit is contained in:
TheClashFruit 2023-08-10 11:47:31 +02:00
parent 9f30ea0344
commit e8dc8b2201
Signed by: TheClashFruit
GPG key ID: CF4A319B9A73290C
5 changed files with 357 additions and 2 deletions

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="DiscordProjectSettings"> <component name="DiscordProjectSettings">
<option name="show" value="ASK" /> <option name="show" value="PROJECT_FILES" />
<option name="description" value="" /> <option name="description" value="" />
</component> </component>
</project> </project>

6
.idea/vcs.xml Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View file

@ -0,0 +1,18 @@
package me.theclashfruit.cc.mixin;
import net.minecraft.item.Instrument;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemGroups;
import net.minecraft.registry.RegistryWrapper;
import net.minecraft.registry.tag.TagKey;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;
@Mixin(ItemGroups.class)
public interface ItemGroupsInterfaceMixin {
@Invoker("addInstruments")
static void invokeAddInstruments(ItemGroup.Entries entries, RegistryWrapper<Instrument> registryWrapper, Item item, TagKey<Instrument> instrumentTag, ItemGroup.StackVisibility visibility) {
throw new AssertionError();
}
}

View file

@ -4,9 +4,14 @@ import net.minecraft.block.Blocks;
import net.minecraft.item.*; import net.minecraft.item.*;
import net.minecraft.registry.Registry; import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey; import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.registry.RegistryWrapper;
import net.minecraft.registry.tag.InstrumentTags;
import net.minecraft.registry.tag.TagKey;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import net.minecraft.village.raid.Raid; import net.minecraft.village.raid.Raid;
import org.spongepowered.asm.mixin.*; import org.spongepowered.asm.mixin.*;
import org.spongepowered.asm.mixin.gen.Invoker;
import java.util.Set; import java.util.Set;
@ -953,6 +958,69 @@ public class ItemGroupsMixin {
content.add(Items.TNT); content.add(Items.TNT);
content.add(Items.REDSTONE_LAMP); content.add(Items.REDSTONE_LAMP);
content.add(Items.NOTE_BLOCK); content.add(Items.NOTE_BLOCK);
content.add(Items.STONE_BUTTON);
content.add(Items.POLISHED_BLACKSTONE_BUTTON);
content.add(Items.OAK_BUTTON);
content.add(Items.SPRUCE_BUTTON);
content.add(Items.BIRCH_BUTTON);
content.add(Items.JUNGLE_BUTTON);
content.add(Items.ACACIA_BUTTON);
content.add(Items.DARK_OAK_BUTTON);
content.add(Items.MANGROVE_BUTTON);
content.add(Items.CHERRY_BUTTON);
content.add(Items.CRIMSON_BUTTON);
content.add(Items.WARPED_BUTTON);
content.add(Items.STONE_PRESSURE_PLATE);
content.add(Items.POLISHED_BLACKSTONE_PRESSURE_PLATE);
content.add(Items.LIGHT_WEIGHTED_PRESSURE_PLATE);
content.add(Items.HEAVY_WEIGHTED_PRESSURE_PLATE);
content.add(Items.OAK_PRESSURE_PLATE);
content.add(Items.SPRUCE_PRESSURE_PLATE);
content.add(Items.BIRCH_PRESSURE_PLATE);
content.add(Items.JUNGLE_PRESSURE_PLATE);
content.add(Items.ACACIA_PRESSURE_PLATE);
content.add(Items.DARK_OAK_PRESSURE_PLATE);
content.add(Items.MANGROVE_PRESSURE_PLATE);
content.add(Items.CHERRY_PRESSURE_PLATE);
content.add(Items.CRIMSON_PRESSURE_PLATE);
content.add(Items.WARPED_PRESSURE_PLATE);
content.add(Items.IRON_DOOR);
content.add(Items.OAK_DOOR);
content.add(Items.SPRUCE_DOOR);
content.add(Items.BIRCH_DOOR);
content.add(Items.JUNGLE_DOOR);
content.add(Items.ACACIA_DOOR);
content.add(Items.DARK_OAK_DOOR);
content.add(Items.MANGROVE_DOOR);
content.add(Items.CHERRY_DOOR);
content.add(Items.CRIMSON_DOOR);
content.add(Items.WARPED_DOOR);
content.add(Items.IRON_TRAPDOOR);
content.add(Items.OAK_TRAPDOOR);
content.add(Items.SPRUCE_TRAPDOOR);
content.add(Items.BIRCH_TRAPDOOR);
content.add(Items.JUNGLE_TRAPDOOR);
content.add(Items.ACACIA_TRAPDOOR);
content.add(Items.DARK_OAK_TRAPDOOR);
content.add(Items.MANGROVE_TRAPDOOR);
content.add(Items.CHERRY_TRAPDOOR);
content.add(Items.CRIMSON_TRAPDOOR);
content.add(Items.WARPED_TRAPDOOR);
content.add(Items.OAK_FENCE_GATE);
content.add(Items.SPRUCE_FENCE_GATE);
content.add(Items.BIRCH_FENCE_GATE);
content.add(Items.JUNGLE_FENCE_GATE);
content.add(Items.ACACIA_FENCE_GATE);
content.add(Items.DARK_OAK_FENCE_GATE);
content.add(Items.MANGROVE_FENCE_GATE);
content.add(Items.CHERRY_FENCE_GATE);
content.add(Items.CRIMSON_FENCE_GATE);
content.add(Items.WARPED_FENCE_GATE);
}) })
.build() .build()
); );
@ -966,6 +1034,39 @@ public class ItemGroupsMixin {
.icon(() -> new ItemStack(Items.POWERED_RAIL)) .icon(() -> new ItemStack(Items.POWERED_RAIL))
.entries((displayContext, content) -> { .entries((displayContext, content) -> {
content.add(Items.POWERED_RAIL); content.add(Items.POWERED_RAIL);
content.add(Items.DETECTOR_RAIL);
content.add(Items.RAIL);
content.add(Items.ACTIVATOR_RAIL);
content.add(Items.SADDLE);
content.add(Items.MINECART);
content.add(Items.CHEST_MINECART);
content.add(Items.FURNACE_MINECART);
content.add(Items.TNT_MINECART);
content.add(Items.HOPPER_MINECART);
content.add(Items.CARROT_ON_A_STICK);
content.add(Items.WARPED_FUNGUS_ON_A_STICK);
content.add(Items.ELYTRA);
content.add(Items.OAK_BOAT);
content.add(Items.OAK_CHEST_BOAT);
content.add(Items.SPRUCE_BOAT);
content.add(Items.SPRUCE_CHEST_BOAT);
content.add(Items.BIRCH_BOAT);
content.add(Items.BIRCH_CHEST_BOAT);
content.add(Items.JUNGLE_BOAT);
content.add(Items.JUNGLE_CHEST_BOAT);
content.add(Items.ACACIA_BOAT);
content.add(Items.ACACIA_CHEST_BOAT);
content.add(Items.DARK_OAK_BOAT);
content.add(Items.DARK_OAK_CHEST_BOAT);
content.add(Items.MANGROVE_BOAT);
content.add(Items.MANGROVE_CHEST_BOAT);
content.add(Items.CHERRY_BOAT);
content.add(Items.CHERRY_CHEST_BOAT);
}) })
.build() .build()
); );
@ -978,7 +1079,237 @@ public class ItemGroupsMixin {
.displayName(Text.translatable("itemGroup.misc")) .displayName(Text.translatable("itemGroup.misc"))
.icon(() -> new ItemStack(Items.LAVA_BUCKET)) .icon(() -> new ItemStack(Items.LAVA_BUCKET))
.entries((displayContext, content) -> { .entries((displayContext, content) -> {
content.add(Items.BEACON);
content.add(Items.TURTLE_EGG);
content.add(Items.CONDUIT);
content.add(Items.SCUTE);
content.add(Items.COAL);
content.add(Items.CHARCOAL);
content.add(Items.DIAMOND);
content.add(Items.EMERALD);
content.add(Items.LAPIS_LAZULI);
content.add(Items.QUARTZ);
content.add(Items.AMETHYST_SHARD);
content.add(Items.RAW_IRON);
content.add(Items.IRON_INGOT);
content.add(Items.RAW_COPPER);
content.add(Items.COPPER_INGOT);
content.add(Items.RAW_GOLD);
content.add(Items.GOLD_INGOT);
content.add(Items.NETHERITE_INGOT);
content.add(Items.NETHERITE_SCRAP);
content.add(Items.STICK);
content.add(Items.BOWL);
content.add(Items.STRING);
content.add(Items.FEATHER);
content.add(Items.GUNPOWDER);
content.add(Items.WHEAT_SEEDS);
content.add(Items.WHEAT);
content.add(Items.FLINT);
content.add(Items.BUCKET);
content.add(Items.WATER_BUCKET);
content.add(Items.LAVA_BUCKET); content.add(Items.LAVA_BUCKET);
content.add(Items.POWDER_SNOW_BUCKET);
content.add(Items.SNOWBALL);
content.add(Items.LEATHER);
content.add(Items.MILK_BUCKET);
content.add(Items.PUFFERFISH_BUCKET);
content.add(Items.SALMON_BUCKET);
content.add(Items.COD_BUCKET);
content.add(Items.TROPICAL_FISH_BUCKET);
content.add(Items.AXOLOTL_BUCKET);
content.add(Items.TADPOLE_BUCKET);
content.add(Items.BRICK);
content.add(Items.CLAY_BALL);
content.add(Items.PAPER);
content.add(Items.BOOK);
content.add(Items.SLIME_BALL);
content.add(Items.EGG);
content.add(Items.GLOWSTONE_DUST);
content.add(Items.INK_SAC);
content.add(Items.GLOW_INK_SAC);
content.add(Items.COCOA_BEANS);
content.add(Items.WHITE_DYE);
content.add(Items.ORANGE_DYE);
content.add(Items.MAGENTA_DYE);
content.add(Items.LIGHT_BLUE_DYE);
content.add(Items.YELLOW_DYE);
content.add(Items.LIME_DYE);
content.add(Items.PINK_DYE);
content.add(Items.GRAY_DYE);
content.add(Items.LIGHT_GRAY_DYE);
content.add(Items.CYAN_DYE);
content.add(Items.PURPLE_DYE);
content.add(Items.BLUE_DYE);
content.add(Items.BROWN_DYE);
content.add(Items.GREEN_DYE);
content.add(Items.RED_DYE);
content.add(Items.BLACK_DYE);
content.add(Items.BONE_MEAL);
content.add(Items.BONE);
content.add(Items.SUGAR);
content.add(Items.MELON_SEEDS);
content.add(Items.PUMPKIN_SEEDS);
content.add(Items.ENDER_PEARL);
content.add(Items.BLAZE_ROD);
content.add(Items.GOLD_NUGGET);
content.add(Items.NETHER_WART);
content.add(Items.ENDER_EYE);
content.add(Items.ALLAY_SPAWN_EGG);
content.add(Items.AXOLOTL_SPAWN_EGG);
content.add(Items.BAT_SPAWN_EGG);
content.add(Items.BEE_SPAWN_EGG);
content.add(Items.BLAZE_SPAWN_EGG);
content.add(Items.CAMEL_SPAWN_EGG);
content.add(Items.CAT_SPAWN_EGG);
content.add(Items.CAVE_SPIDER_SPAWN_EGG);
content.add(Items.CHICKEN_SPAWN_EGG);
content.add(Items.COD_SPAWN_EGG);
content.add(Items.COW_SPAWN_EGG);
content.add(Items.CREEPER_SPAWN_EGG);
content.add(Items.DOLPHIN_SPAWN_EGG);
content.add(Items.DONKEY_SPAWN_EGG);
content.add(Items.DROWNED_SPAWN_EGG);
content.add(Items.ELDER_GUARDIAN_SPAWN_EGG);
content.add(Items.ENDERMAN_SPAWN_EGG);
content.add(Items.ENDERMITE_SPAWN_EGG);
content.add(Items.EVOKER_SPAWN_EGG);
content.add(Items.FOX_SPAWN_EGG);
content.add(Items.FROG_SPAWN_EGG);
content.add(Items.GHAST_SPAWN_EGG);
content.add(Items.GLOW_SQUID_SPAWN_EGG);
content.add(Items.GOAT_SPAWN_EGG);
content.add(Items.GUARDIAN_SPAWN_EGG);
content.add(Items.HOGLIN_SPAWN_EGG);
content.add(Items.HORSE_SPAWN_EGG);
content.add(Items.HUSK_SPAWN_EGG);
content.add(Items.IRON_GOLEM_SPAWN_EGG);
content.add(Items.LLAMA_SPAWN_EGG);
content.add(Items.MAGMA_CUBE_SPAWN_EGG);
content.add(Items.MOOSHROOM_SPAWN_EGG);
content.add(Items.MULE_SPAWN_EGG);
content.add(Items.OCELOT_SPAWN_EGG);
content.add(Items.PANDA_SPAWN_EGG);
content.add(Items.PARROT_SPAWN_EGG);
content.add(Items.PHANTOM_SPAWN_EGG);
content.add(Items.PIG_SPAWN_EGG);
content.add(Items.PIGLIN_SPAWN_EGG);
content.add(Items.PIGLIN_BRUTE_SPAWN_EGG);
content.add(Items.PILLAGER_SPAWN_EGG);
content.add(Items.POLAR_BEAR_SPAWN_EGG);
content.add(Items.PUFFERFISH_SPAWN_EGG);
content.add(Items.RABBIT_SPAWN_EGG);
content.add(Items.RAVAGER_SPAWN_EGG);
content.add(Items.SALMON_SPAWN_EGG);
content.add(Items.SHEEP_SPAWN_EGG);
content.add(Items.SHULKER_SPAWN_EGG);
content.add(Items.SILVERFISH_SPAWN_EGG);
content.add(Items.SKELETON_SPAWN_EGG);
content.add(Items.SKELETON_HORSE_SPAWN_EGG);
content.add(Items.SLIME_SPAWN_EGG);
content.add(Items.SNIFFER_SPAWN_EGG);
content.add(Items.SNOW_GOLEM_SPAWN_EGG);
content.add(Items.SPIDER_SPAWN_EGG);
content.add(Items.SQUID_SPAWN_EGG);
content.add(Items.STRAY_SPAWN_EGG);
content.add(Items.STRIDER_SPAWN_EGG);
content.add(Items.TADPOLE_SPAWN_EGG);
content.add(Items.TRADER_LLAMA_SPAWN_EGG);
content.add(Items.TROPICAL_FISH_SPAWN_EGG);
content.add(Items.TURTLE_SPAWN_EGG);
content.add(Items.VEX_SPAWN_EGG);
content.add(Items.VILLAGER_SPAWN_EGG);
content.add(Items.VINDICATOR_SPAWN_EGG);
content.add(Items.WANDERING_TRADER_SPAWN_EGG);
content.add(Items.WARDEN_SPAWN_EGG);
content.add(Items.WITCH_SPAWN_EGG);
content.add(Items.WITHER_SKELETON_SPAWN_EGG);
content.add(Items.WOLF_SPAWN_EGG);
content.add(Items.ZOGLIN_SPAWN_EGG);
content.add(Items.ZOMBIE_SPAWN_EGG);
content.add(Items.ZOMBIE_HORSE_SPAWN_EGG);
content.add(Items.ZOMBIE_VILLAGER_SPAWN_EGG);
content.add(Items.ZOMBIFIED_PIGLIN_SPAWN_EGG);
content.add(Items.EXPERIENCE_BOTTLE);
content.add(Items.FIRE_CHARGE);
content.add(Items.WRITABLE_BOOK);
content.add(Items.MAP);
content.add(Items.NETHER_STAR);
content.add(Items.FIREWORK_ROCKET);
content.add(Items.FIREWORK_STAR);
content.add(Items.NETHER_BRICK);
content.add(Items.PRISMARINE_SHARD);
content.add(Items.PRISMARINE_CRYSTALS);
content.add(Items.RABBIT_HIDE);
content.add(Items.IRON_HORSE_ARMOR);
content.add(Items.GOLDEN_HORSE_ARMOR);
content.add(Items.DIAMOND_HORSE_ARMOR);
content.add(Items.LEATHER_HORSE_ARMOR);
content.add(Items.CHORUS_FRUIT);
content.add(Items.POPPED_CHORUS_FRUIT);
content.add(Items.BEETROOT_SEEDS);
content.add(Items.SHULKER_SHELL);
content.add(Items.IRON_NUGGET);
content.add(Items.MUSIC_DISC_13);
content.add(Items.MUSIC_DISC_CAT);
content.add(Items.MUSIC_DISC_BLOCKS);
content.add(Items.MUSIC_DISC_CHIRP);
content.add(Items.MUSIC_DISC_FAR);
content.add(Items.MUSIC_DISC_MALL);
content.add(Items.MUSIC_DISC_MELLOHI);
content.add(Items.MUSIC_DISC_STAL);
content.add(Items.MUSIC_DISC_STRAD);
content.add(Items.MUSIC_DISC_WARD);
content.add(Items.MUSIC_DISC_11);
content.add(Items.MUSIC_DISC_WAIT);
content.add(Items.MUSIC_DISC_OTHERSIDE);
content.add(Items.MUSIC_DISC_5);
content.add(Items.MUSIC_DISC_PIGSTEP);
content.add(Items.DISC_FRAGMENT_5);
content.add(Items.NAUTILUS_SHELL);
content.add(Items.HEART_OF_THE_SEA);
content.add(Items.FLOWER_BANNER_PATTERN);
content.add(Items.CREEPER_BANNER_PATTERN);
content.add(Items.SKULL_BANNER_PATTERN);
content.add(Items.MOJANG_BANNER_PATTERN);
content.add(Items.GLOBE_BANNER_PATTERN);
content.add(Items.PIGLIN_BANNER_PATTERN);
displayContext.lookup().getOptionalWrapper(RegistryKeys.INSTRUMENT).ifPresent(wrapper -> ItemGroupsInterfaceMixin.invokeAddInstruments(content, wrapper, Items.GOAT_HORN, InstrumentTags.GOAT_HORNS, ItemGroup.StackVisibility.PARENT_AND_SEARCH_TABS));
content.add(Items.HONEYCOMB);
content.add(Items.FROGSPAWN);
content.add(Items.ECHO_SHARD);
}) })
.build() .build()
); );

View file

@ -4,10 +4,10 @@
"package": "me.theclashfruit.cc.mixin", "package": "me.theclashfruit.cc.mixin",
"compatibilityLevel": "JAVA_17", "compatibilityLevel": "JAVA_17",
"mixins": [ "mixins": [
"ItemGroupsInterfaceMixin",
"ItemGroupsMixin" "ItemGroupsMixin"
], ],
"client": [ "client": [
], ],
"injectors": { "injectors": {
"defaultRequire": 1 "defaultRequire": 1