feat: release 1.0.0-rc.2 #2

Merged
TheClashFruit merged 8 commits from dev/rc2 into main 2023-08-16 08:42:47 +00:00
5 changed files with 74 additions and 16 deletions

View file

@ -8,9 +8,7 @@
<img alt="Issues" src="https://img.shields.io/badge/dynamic/json?color=yellow&label=issues&query=%24.open_issues_count&url=https%3A%2F%2Fgit.theclashfruit.me%2Fapi%2Fv1%2Frepos%2FTheClashFruit%2FClutteredCreative"> <img alt="Issues" src="https://img.shields.io/badge/dynamic/json?color=yellow&label=issues&query=%24.open_issues_count&url=https%3A%2F%2Fgit.theclashfruit.me%2Fapi%2Fv1%2Frepos%2FTheClashFruit%2FClutteredCreative">
<img alt="Pull Requests" src="https://img.shields.io/badge/dynamic/json?color=brightgreen&label=pull+requests&query=%24.open_pr_counter&url=https%3A%2F%2Fgit.theclashfruit.me%2Fapi%2Fv1%2Frepos%2FTheClashFruit%2FClutteredCreative"> <img alt="Pull Requests" src="https://img.shields.io/badge/dynamic/json?color=brightgreen&label=pull+requests&query=%24.open_pr_counter&url=https%3A%2F%2Fgit.theclashfruit.me%2Fapi%2Fv1%2Frepos%2FTheClashFruit%2FClutteredCreative">
<!--
<img alt="Modrinth Downloads" src="https://img.shields.io/modrinth/dt/Fs6mB0ic"> <img alt="Modrinth Downloads" src="https://img.shields.io/modrinth/dt/Fs6mB0ic">
-->
<img alt="Version" src="https://img.shields.io/badge/dynamic/json?color=orange&label=version&query=%24%5B0%5D.name&url=https%3A%2F%2Fgit.theclashfruit.me%2Fapi%2Fv1%2Frepos%2FTheClashFruit%2FClutteredCreative%2Freleases"> <img alt="Version" src="https://img.shields.io/badge/dynamic/json?color=orange&label=version&query=%24%5B0%5D.name&url=https%3A%2F%2Fgit.theclashfruit.me%2Fapi%2Fv1%2Frepos%2FTheClashFruit%2FClutteredCreative%2Freleases">
<img alt="License (MIT)" src="https://img.shields.io/badge/license-MIT-green.svg"> <img alt="License (MIT)" src="https://img.shields.io/badge/license-MIT-green.svg">

View file

@ -8,7 +8,7 @@ yarn_mappings=1.20+build.1
loader_version=0.14.22 loader_version=0.14.22
# Mod Properties # Mod Properties
mod_version = 1.0.0-rc.1 mod_version = 1.0.0-rc.2
maven_group = me.theclashfruit maven_group = me.theclashfruit
archives_base_name = cc archives_base_name = cc

View file

@ -1,8 +1,20 @@
package me.theclashfruit.cc; package me.theclashfruit.cc;
import net.fabricmc.api.ModInitializer; import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.minecraft.item.*;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ClutteredCreative implements ModInitializer { public class ClutteredCreative implements ModInitializer {
public static final Logger LOGGER = LoggerFactory.getLogger("ClutteredCreative");
@Override @Override
public void onInitialize() { public void onInitialize() {

View file

@ -5,30 +5,50 @@ import net.minecraft.enchantment.EnchantmentLevelEntry;
import net.minecraft.enchantment.EnchantmentTarget; import net.minecraft.enchantment.EnchantmentTarget;
import net.minecraft.enchantment.Enchantments; import net.minecraft.enchantment.Enchantments;
import net.minecraft.item.*; import net.minecraft.item.*;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionUtil; import net.minecraft.potion.PotionUtil;
import net.minecraft.potion.Potions; import net.minecraft.potion.Potions;
import net.minecraft.registry.Registries;
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.RegistryKeys;
import net.minecraft.registry.RegistryWrapper;
import net.minecraft.registry.tag.InstrumentTags; 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.util.Identifier;
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.Accessor;
import org.spongepowered.asm.mixin.gen.Invoker; import org.spongepowered.asm.mixin.gen.Invoker;
import java.util.EnumSet; import java.util.*;
import java.util.Set;
import static me.theclashfruit.cc.ClutteredCreative.LOGGER;
import static net.minecraft.item.ItemGroups.*; import static net.minecraft.item.ItemGroups.*;
@Mixin(ItemGroups.class) @Mixin(ItemGroups.class)
public class ItemGroupsMixin { public class ItemGroupsMixin {
@Shadow @Final public static RegistryKey<ItemGroup> COLORED_BLOCKS; @Invoker("register")
@Shadow @Final public static RegistryKey<ItemGroup> REDSTONE; private static RegistryKey<ItemGroup> register(String id) {
throw new AssertionError();
}
@Unique
private static final RegistryKey<ItemGroup> BUILDING_BLOCKS = register("building_blocks");
@Unique
private static final RegistryKey<ItemGroup> DECORATION = register("natural_blocks");
@Unique
private static final RegistryKey<ItemGroup> REDSTONE = register("redstone_blocks");
@Unique
private static final RegistryKey<ItemGroup> TRANSPORTATION = register("functional_blocks");
@Unique
private static final RegistryKey<ItemGroup> MISC = register("ingredients");
@Unique
private static final RegistryKey<ItemGroup> FOOD = register("food_and_drinks");
@Unique
private static final RegistryKey<ItemGroup> TOOLS = register("tools_and_utilities");
@Unique
private static final RegistryKey<ItemGroup> BREWING = register("spawn_eggs");
@Unique @Unique
private static final ItemGroup hotbarGroup = ItemGroup private static final ItemGroup hotbarGroup = ItemGroup
.create(ItemGroup.Row.TOP, 5) .create(ItemGroup.Row.TOP, 5)
@ -52,10 +72,12 @@ public class ItemGroupsMixin {
/** /**
* @author TheClashFruit * @author TheClashFruit
* @reason pre 1.19.4 inventory layout :3 * @reason pre 1.19.3 inventory layout :3
*/ */
@Overwrite @Overwrite
public static ItemGroup registerAndGetDefault(Registry<ItemGroup> registry) { public static ItemGroup registerAndGetDefault(Registry<ItemGroup> registry) {
LOGGER.info("ItemGroups Working!");
final ItemGroup searchGroup = ItemGroup final ItemGroup searchGroup = ItemGroup
.create(ItemGroup.Row.TOP, 6) .create(ItemGroup.Row.TOP, 6)
.displayName(Text.translatable("itemGroup.search")) .displayName(Text.translatable("itemGroup.search"))
@ -84,6 +106,7 @@ public class ItemGroupsMixin {
BUILDING_BLOCKS, BUILDING_BLOCKS,
ItemGroup ItemGroup
.create(ItemGroup.Row.TOP, 0) .create(ItemGroup.Row.TOP, 0)
.type(ItemGroup.Type.CATEGORY)
.displayName(Text.translatable("itemGroup.buildingBlocks")) .displayName(Text.translatable("itemGroup.buildingBlocks"))
.icon(() -> new ItemStack(Blocks.BRICKS)) .icon(() -> new ItemStack(Blocks.BRICKS))
.entries((displayContext, content) -> { .entries((displayContext, content) -> {
@ -117,6 +140,7 @@ public class ItemGroupsMixin {
content.add(Items.DARK_OAK_PLANKS); content.add(Items.DARK_OAK_PLANKS);
content.add(Items.MANGROVE_PLANKS); content.add(Items.MANGROVE_PLANKS);
content.add(Items.CHERRY_PLANKS); content.add(Items.CHERRY_PLANKS);
content.add(Items.BAMBOO_PLANKS);
content.add(Items.CRIMSON_PLANKS); content.add(Items.CRIMSON_PLANKS);
content.add(Items.WARPED_PLANKS); content.add(Items.WARPED_PLANKS);
content.add(Items.BEDROCK); content.add(Items.BEDROCK);
@ -196,6 +220,7 @@ public class ItemGroupsMixin {
content.add(Items.MANGROVE_ROOTS); content.add(Items.MANGROVE_ROOTS);
content.add(Items.MUDDY_MANGROVE_ROOTS); content.add(Items.MUDDY_MANGROVE_ROOTS);
content.add(Items.CHERRY_LOG); content.add(Items.CHERRY_LOG);
content.add(Items.BAMBOO_BLOCK);
content.add(Items.CRIMSON_STEM); content.add(Items.CRIMSON_STEM);
content.add(Items.WARPED_STEM); content.add(Items.WARPED_STEM);
@ -207,6 +232,7 @@ public class ItemGroupsMixin {
content.add(Items.STRIPPED_DARK_OAK_LOG); content.add(Items.STRIPPED_DARK_OAK_LOG);
content.add(Items.STRIPPED_MANGROVE_LOG); content.add(Items.STRIPPED_MANGROVE_LOG);
content.add(Items.STRIPPED_CHERRY_LOG); content.add(Items.STRIPPED_CHERRY_LOG);
content.add(Items.STRIPPED_BAMBOO_BLOCK);
content.add(Items.STRIPPED_CRIMSON_STEM); content.add(Items.STRIPPED_CRIMSON_STEM);
content.add(Items.STRIPPED_WARPED_STEM); content.add(Items.STRIPPED_WARPED_STEM);
@ -269,6 +295,7 @@ public class ItemGroupsMixin {
content.add(Items.DARK_OAK_SLAB); content.add(Items.DARK_OAK_SLAB);
content.add(Items.MANGROVE_SLAB); content.add(Items.MANGROVE_SLAB);
content.add(Items.CHERRY_SLAB); content.add(Items.CHERRY_SLAB);
content.add(Items.BAMBOO_SLAB);
content.add(Items.CRIMSON_SLAB); content.add(Items.CRIMSON_SLAB);
content.add(Items.WARPED_SLAB); content.add(Items.WARPED_SLAB);
@ -363,6 +390,7 @@ public class ItemGroupsMixin {
content.add(Items.DARK_OAK_STAIRS); content.add(Items.DARK_OAK_STAIRS);
content.add(Items.MANGROVE_STAIRS); content.add(Items.MANGROVE_STAIRS);
content.add(Items.CHERRY_STAIRS); content.add(Items.CHERRY_STAIRS);
content.add(Items.BAMBOO_STAIRS);
content.add(Items.CRIMSON_STAIRS); content.add(Items.CRIMSON_STAIRS);
content.add(Items.WARPED_STAIRS); content.add(Items.WARPED_STAIRS);
@ -535,9 +563,10 @@ public class ItemGroupsMixin {
Registry.register( Registry.register(
registry, registry,
NATURAL, DECORATION,
ItemGroup ItemGroup
.create(ItemGroup.Row.TOP, 1) .create(ItemGroup.Row.TOP, 1)
.type(ItemGroup.Type.CATEGORY)
.displayName(Text.translatable("itemGroup.decorations")) .displayName(Text.translatable("itemGroup.decorations"))
.icon(() -> new ItemStack(Blocks.PEONY)) .icon(() -> new ItemStack(Blocks.PEONY))
.entries((displayContext, content) -> { .entries((displayContext, content) -> {
@ -604,6 +633,7 @@ public class ItemGroupsMixin {
content.add(Items.BIG_DRIPLEAF); content.add(Items.BIG_DRIPLEAF);
content.add(Items.SMALL_DRIPLEAF); content.add(Items.SMALL_DRIPLEAF);
content.add(Items.BAMBOO); content.add(Items.BAMBOO);
content.add(Items.BAMBOO_MOSAIC);
content.add(Items.TORCH); content.add(Items.TORCH);
@ -631,6 +661,7 @@ public class ItemGroupsMixin {
content.add(Items.DARK_OAK_FENCE); content.add(Items.DARK_OAK_FENCE);
content.add(Items.MANGROVE_FENCE); content.add(Items.MANGROVE_FENCE);
content.add(Items.CHERRY_FENCE); content.add(Items.CHERRY_FENCE);
content.add(Items.BAMBOO_FENCE);
content.add(Items.CRIMSON_FENCE); content.add(Items.CRIMSON_FENCE);
content.add(Items.WARPED_FENCE); content.add(Items.WARPED_FENCE);
@ -806,6 +837,7 @@ public class ItemGroupsMixin {
content.add(Items.ACACIA_SIGN); content.add(Items.ACACIA_SIGN);
content.add(Items.DARK_OAK_SIGN); content.add(Items.DARK_OAK_SIGN);
content.add(Items.MANGROVE_SIGN); content.add(Items.MANGROVE_SIGN);
content.add(Items.BAMBOO_SIGN);
content.add(Items.CHERRY_SIGN); content.add(Items.CHERRY_SIGN);
content.add(Items.CRIMSON_SIGN); content.add(Items.CRIMSON_SIGN);
content.add(Items.WARPED_SIGN); content.add(Items.WARPED_SIGN);
@ -818,6 +850,7 @@ public class ItemGroupsMixin {
content.add(Items.DARK_OAK_HANGING_SIGN); content.add(Items.DARK_OAK_HANGING_SIGN);
content.add(Items.MANGROVE_HANGING_SIGN); content.add(Items.MANGROVE_HANGING_SIGN);
content.add(Items.CHERRY_HANGING_SIGN); content.add(Items.CHERRY_HANGING_SIGN);
content.add(Items.BAMBOO_HANGING_SIGN);
content.add(Items.CRIMSON_HANGING_SIGN); content.add(Items.CRIMSON_HANGING_SIGN);
content.add(Items.WARPED_HANGING_SIGN); content.add(Items.WARPED_HANGING_SIGN);
@ -937,6 +970,7 @@ public class ItemGroupsMixin {
REDSTONE, REDSTONE,
ItemGroup ItemGroup
.create(ItemGroup.Row.TOP, 2) .create(ItemGroup.Row.TOP, 2)
.type(ItemGroup.Type.CATEGORY)
.displayName(Text.translatable("itemGroup.redstone")) .displayName(Text.translatable("itemGroup.redstone"))
.icon(() -> new ItemStack(Items.REDSTONE)) .icon(() -> new ItemStack(Items.REDSTONE))
.entries((displayContext, content) -> { .entries((displayContext, content) -> {
@ -976,6 +1010,7 @@ public class ItemGroupsMixin {
content.add(Items.DARK_OAK_BUTTON); content.add(Items.DARK_OAK_BUTTON);
content.add(Items.MANGROVE_BUTTON); content.add(Items.MANGROVE_BUTTON);
content.add(Items.CHERRY_BUTTON); content.add(Items.CHERRY_BUTTON);
content.add(Items.BAMBOO_BUTTON);
content.add(Items.CRIMSON_BUTTON); content.add(Items.CRIMSON_BUTTON);
content.add(Items.WARPED_BUTTON); content.add(Items.WARPED_BUTTON);
@ -991,6 +1026,7 @@ public class ItemGroupsMixin {
content.add(Items.DARK_OAK_PRESSURE_PLATE); content.add(Items.DARK_OAK_PRESSURE_PLATE);
content.add(Items.MANGROVE_PRESSURE_PLATE); content.add(Items.MANGROVE_PRESSURE_PLATE);
content.add(Items.CHERRY_PRESSURE_PLATE); content.add(Items.CHERRY_PRESSURE_PLATE);
content.add(Items.BAMBOO_PRESSURE_PLATE);
content.add(Items.CRIMSON_PRESSURE_PLATE); content.add(Items.CRIMSON_PRESSURE_PLATE);
content.add(Items.WARPED_PRESSURE_PLATE); content.add(Items.WARPED_PRESSURE_PLATE);
@ -1003,6 +1039,7 @@ public class ItemGroupsMixin {
content.add(Items.DARK_OAK_DOOR); content.add(Items.DARK_OAK_DOOR);
content.add(Items.MANGROVE_DOOR); content.add(Items.MANGROVE_DOOR);
content.add(Items.CHERRY_DOOR); content.add(Items.CHERRY_DOOR);
content.add(Items.BAMBOO_DOOR);
content.add(Items.CRIMSON_DOOR); content.add(Items.CRIMSON_DOOR);
content.add(Items.WARPED_DOOR); content.add(Items.WARPED_DOOR);
@ -1015,6 +1052,7 @@ public class ItemGroupsMixin {
content.add(Items.DARK_OAK_TRAPDOOR); content.add(Items.DARK_OAK_TRAPDOOR);
content.add(Items.MANGROVE_TRAPDOOR); content.add(Items.MANGROVE_TRAPDOOR);
content.add(Items.CHERRY_TRAPDOOR); content.add(Items.CHERRY_TRAPDOOR);
content.add(Items.BAMBOO_TRAPDOOR);
content.add(Items.CRIMSON_TRAPDOOR); content.add(Items.CRIMSON_TRAPDOOR);
content.add(Items.WARPED_TRAPDOOR); content.add(Items.WARPED_TRAPDOOR);
@ -1026,6 +1064,7 @@ public class ItemGroupsMixin {
content.add(Items.DARK_OAK_FENCE_GATE); content.add(Items.DARK_OAK_FENCE_GATE);
content.add(Items.MANGROVE_FENCE_GATE); content.add(Items.MANGROVE_FENCE_GATE);
content.add(Items.CHERRY_FENCE_GATE); content.add(Items.CHERRY_FENCE_GATE);
content.add(Items.BAMBOO_FENCE_GATE);
content.add(Items.CRIMSON_FENCE_GATE); content.add(Items.CRIMSON_FENCE_GATE);
content.add(Items.WARPED_FENCE_GATE); content.add(Items.WARPED_FENCE_GATE);
}) })
@ -1034,9 +1073,10 @@ public class ItemGroupsMixin {
Registry.register( Registry.register(
registry, registry,
FUNCTIONAL, TRANSPORTATION,
ItemGroup ItemGroup
.create(ItemGroup.Row.TOP, 3) .create(ItemGroup.Row.TOP, 3)
.type(ItemGroup.Type.CATEGORY)
.displayName(Text.translatable("itemGroup.transportation")) .displayName(Text.translatable("itemGroup.transportation"))
.icon(() -> new ItemStack(Items.POWERED_RAIL)) .icon(() -> new ItemStack(Items.POWERED_RAIL))
.entries((displayContext, content) -> { .entries((displayContext, content) -> {
@ -1074,15 +1114,18 @@ public class ItemGroupsMixin {
content.add(Items.MANGROVE_CHEST_BOAT); content.add(Items.MANGROVE_CHEST_BOAT);
content.add(Items.CHERRY_BOAT); content.add(Items.CHERRY_BOAT);
content.add(Items.CHERRY_CHEST_BOAT); content.add(Items.CHERRY_CHEST_BOAT);
content.add(Items.BAMBOO_RAFT);
content.add(Items.BAMBOO_CHEST_RAFT);
}) })
.build() .build()
); );
Registry.register( Registry.register(
registry, registry,
INGREDIENTS, MISC,
ItemGroup ItemGroup
.create(ItemGroup.Row.BOTTOM, 0) .create(ItemGroup.Row.BOTTOM, 0)
.type(ItemGroup.Type.CATEGORY)
.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) -> {
@ -1323,9 +1366,10 @@ public class ItemGroupsMixin {
Registry.register( Registry.register(
registry, registry,
FOOD_AND_DRINK, FOOD,
ItemGroup ItemGroup
.create(ItemGroup.Row.BOTTOM, 1) .create(ItemGroup.Row.BOTTOM, 1)
.type(ItemGroup.Type.CATEGORY)
.displayName(Text.translatable("itemGroup.food")) .displayName(Text.translatable("itemGroup.food"))
.icon(() -> new ItemStack(Items.APPLE)) .icon(() -> new ItemStack(Items.APPLE))
.entries((displayContext, content) -> { .entries((displayContext, content) -> {
@ -1376,6 +1420,7 @@ public class ItemGroupsMixin {
TOOLS, TOOLS,
ItemGroup ItemGroup
.create(ItemGroup.Row.BOTTOM, 2) .create(ItemGroup.Row.BOTTOM, 2)
.type(ItemGroup.Type.CATEGORY)
.displayName(Text.translatable("itemGroup.tools")) .displayName(Text.translatable("itemGroup.tools"))
.icon(() -> new ItemStack(Items.IRON_AXE)) .icon(() -> new ItemStack(Items.IRON_AXE))
.entries((displayContext, content) -> { .entries((displayContext, content) -> {
@ -1441,6 +1486,7 @@ public class ItemGroupsMixin {
COMBAT, COMBAT,
ItemGroup ItemGroup
.create(ItemGroup.Row.BOTTOM, 3) .create(ItemGroup.Row.BOTTOM, 3)
.type(ItemGroup.Type.CATEGORY)
.displayName(Text.translatable("itemGroup.combat")) .displayName(Text.translatable("itemGroup.combat"))
.icon(() -> new ItemStack(Items.GOLDEN_SWORD)) .icon(() -> new ItemStack(Items.GOLDEN_SWORD))
.entries((displayContext, content) -> { .entries((displayContext, content) -> {
@ -1504,9 +1550,10 @@ public class ItemGroupsMixin {
Registry.register( Registry.register(
registry, registry,
COLORED_BLOCKS, BREWING,
ItemGroup ItemGroup
.create(ItemGroup.Row.BOTTOM, 4) .create(ItemGroup.Row.BOTTOM, 4)
.type(ItemGroup.Type.CATEGORY)
.displayName(Text.translatable("itemGroup.brewing")) .displayName(Text.translatable("itemGroup.brewing"))
.icon(() -> new ItemStack(PotionUtil.setPotion(new ItemStack(Items.POTION), Potions.WATER).getItem())) .icon(() -> new ItemStack(PotionUtil.setPotion(new ItemStack(Items.POTION), Potions.WATER).getItem()))
.entries((displayContext, content) -> { .entries((displayContext, content) -> {

View file

@ -8,6 +8,7 @@
"ItemGroupsMixin" "ItemGroupsMixin"
], ],
"client": [ "client": [
], ],
"injectors": { "injectors": {
"defaultRequire": 1 "defaultRequire": 1