From 1d34d58d3dbc4d12a11a2e5b7a0f71ef4196b28d Mon Sep 17 00:00:00 2001 From: TheClashFruit Date: Mon, 14 Aug 2023 19:26:51 +0200 Subject: [PATCH 1/8] feat: testing, trying to make tabs wider --- .../theclashfruit/cc/ClutteredCreative.java | 123 ++++++++++++++++++ .../mixin/CreativeInventoryScreenMixin.java | 28 ++++ .../cc/mixin/ItemGroupsMixin.java | 54 ++++++-- src/main/resources/cc.mixins.json | 1 + 4 files changed, 194 insertions(+), 12 deletions(-) create mode 100644 src/main/java/me/theclashfruit/cc/mixin/CreativeInventoryScreenMixin.java diff --git a/src/main/java/me/theclashfruit/cc/ClutteredCreative.java b/src/main/java/me/theclashfruit/cc/ClutteredCreative.java index 9a5a3b4..83873b8 100644 --- a/src/main/java/me/theclashfruit/cc/ClutteredCreative.java +++ b/src/main/java/me/theclashfruit/cc/ClutteredCreative.java @@ -1,10 +1,133 @@ package me.theclashfruit.cc; 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 { + + private static final ItemGroup YES = FabricItemGroup.builder() + .icon(() -> new ItemStack(Items.DIAMOND)) + .displayName(Text.translatable("itemGroup.tutorial.test_group")) + .entries((displayContext, content) -> { + content.add(Items.DIAMOND); + }) + .build(); + + private static final ItemGroup NO = FabricItemGroup.builder() + .icon(() -> new ItemStack(Items.DIAMOND)) + .displayName(Text.translatable("itemGroup.tutorial.test_group")) + .entries((displayContext, content) -> { + content.add(Items.DIAMOND); + }) + .build(); + + private static final ItemGroup SHIT = FabricItemGroup.builder() + .icon(() -> new ItemStack(Items.DIAMOND)) + .displayName(Text.translatable("itemGroup.tutorial.test_group")) + .entries((displayContext, content) -> { + content.add(Items.DIAMOND); + }) + .build(); + + private static final ItemGroup YES2 = FabricItemGroup.builder() + .icon(() -> new ItemStack(Items.DIAMOND)) + .displayName(Text.translatable("itemGroup.tutorial.test_group")) + .entries((displayContext, content) -> { + content.add(Items.DIAMOND); + }) + .build(); + + private static final ItemGroup NO2 = FabricItemGroup.builder() + .icon(() -> new ItemStack(Items.DIAMOND)) + .displayName(Text.translatable("itemGroup.tutorial.test_group")) + .entries((displayContext, content) -> { + content.add(Items.DIAMOND); + }) + .build(); + + private static final ItemGroup SHIT2 = FabricItemGroup.builder() + .icon(() -> new ItemStack(Items.DIAMOND)) + .displayName(Text.translatable("itemGroup.tutorial.test_group")) + .entries((displayContext, content) -> { + content.add(Items.DIAMOND); + }) + .build(); + + private static final ItemGroup YES3 = FabricItemGroup.builder() + .icon(() -> new ItemStack(Items.DIAMOND)) + .displayName(Text.translatable("itemGroup.tutorial.test_group")) + .entries((displayContext, content) -> { + content.add(Items.DIAMOND); + }) + .build(); + + private static final ItemGroup NO3 = FabricItemGroup.builder() + .icon(() -> new ItemStack(Items.DIAMOND)) + .displayName(Text.translatable("itemGroup.tutorial.test_group")) + .entries((displayContext, content) -> { + content.add(Items.DIAMOND); + }) + .build(); + + private static final ItemGroup SHIT3 = FabricItemGroup.builder() + .icon(() -> new ItemStack(Items.DIAMOND)) + .displayName(Text.translatable("itemGroup.tutorial.test_group")) + .entries((displayContext, content) -> { + content.add(Items.DIAMOND); + }) + .build(); + + private static final ItemGroup YES4 = FabricItemGroup.builder() + .icon(() -> new ItemStack(Items.DIAMOND)) + .displayName(Text.translatable("itemGroup.tutorial.test_group")) + .entries((displayContext, content) -> { + content.add(Items.DIAMOND); + }) + .build(); + + private static final ItemGroup NO4 = FabricItemGroup.builder() + .icon(() -> new ItemStack(Items.DIAMOND)) + .displayName(Text.translatable("itemGroup.tutorial.test_group")) + .entries((displayContext, content) -> { + content.add(Items.DIAMOND); + }) + .build(); + + private static final ItemGroup SHIT4 = FabricItemGroup.builder() + .icon(() -> new ItemStack(Items.DIAMOND)) + .displayName(Text.translatable("itemGroup.tutorial.test_group")) + .entries((displayContext, content) -> { + content.add(Items.DIAMOND); + }) + .build(); + + public static final Logger LOGGER = LoggerFactory.getLogger("ClutteredCreative"); + @Override public void onInitialize() { + Registry.register(Registries.ITEM_GROUP, new Identifier("cc", "yes"), YES); + Registry.register(Registries.ITEM_GROUP, new Identifier("cc", "no"), NO); + Registry.register(Registries.ITEM_GROUP, new Identifier("cc", "shit"), SHIT); + Registry.register(Registries.ITEM_GROUP, new Identifier("cc", "yes2"), YES2); + Registry.register(Registries.ITEM_GROUP, new Identifier("cc", "no2"), NO2); + Registry.register(Registries.ITEM_GROUP, new Identifier("cc", "shit2"), SHIT2); + + Registry.register(Registries.ITEM_GROUP, new Identifier("cc", "yes3"), YES3); + Registry.register(Registries.ITEM_GROUP, new Identifier("cc", "no3"), NO3); + Registry.register(Registries.ITEM_GROUP, new Identifier("cc", "shit3"), SHIT3); + + Registry.register(Registries.ITEM_GROUP, new Identifier("cc", "yes4"), YES4); + Registry.register(Registries.ITEM_GROUP, new Identifier("cc", "no4"), NO4); + Registry.register(Registries.ITEM_GROUP, new Identifier("cc", "shit4"), SHIT4); } } diff --git a/src/main/java/me/theclashfruit/cc/mixin/CreativeInventoryScreenMixin.java b/src/main/java/me/theclashfruit/cc/mixin/CreativeInventoryScreenMixin.java new file mode 100644 index 0000000..f6c29ac --- /dev/null +++ b/src/main/java/me/theclashfruit/cc/mixin/CreativeInventoryScreenMixin.java @@ -0,0 +1,28 @@ +package me.theclashfruit.cc.mixin; + +import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen; +import net.minecraft.item.ItemGroup; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(CreativeInventoryScreen.class) +public class CreativeInventoryScreenMixin { + + /** + * @author TheClashFruit + * @reason pre 1.19.3 inventory layout :3 + */ + @Overwrite + private int getTabX(ItemGroup group) { + int i = group.getColumn(); + int j = 32; + int k = 32 * i; + if (group.isSpecial()) { + k = 176 - 32 * (6 - i) + 1; + } + return k; + } +} diff --git a/src/main/java/me/theclashfruit/cc/mixin/ItemGroupsMixin.java b/src/main/java/me/theclashfruit/cc/mixin/ItemGroupsMixin.java index a69eeed..f9782cd 100644 --- a/src/main/java/me/theclashfruit/cc/mixin/ItemGroupsMixin.java +++ b/src/main/java/me/theclashfruit/cc/mixin/ItemGroupsMixin.java @@ -5,30 +5,49 @@ import net.minecraft.enchantment.EnchantmentLevelEntry; import net.minecraft.enchantment.EnchantmentTarget; import net.minecraft.enchantment.Enchantments; import net.minecraft.item.*; -import net.minecraft.potion.Potion; import net.minecraft.potion.PotionUtil; import net.minecraft.potion.Potions; import net.minecraft.registry.Registry; 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.village.raid.Raid; import org.spongepowered.asm.mixin.*; -import org.spongepowered.asm.mixin.gen.Invoker; import java.util.EnumSet; import java.util.Set; +import static me.theclashfruit.cc.ClutteredCreative.LOGGER; import static net.minecraft.item.ItemGroups.*; @Mixin(ItemGroups.class) public class ItemGroupsMixin { - @Shadow @Final public static RegistryKey COLORED_BLOCKS; - @Shadow @Final public static RegistryKey REDSTONE; + @Shadow + private static RegistryKey register(String id) { + throw new AssertionError(); + } + + @Unique + private static final RegistryKey BUILDING_BLOCKS = register("building_blocks"); + @Unique + private static final RegistryKey DECORATION = register("decoration"); + @Unique + private static final RegistryKey REDSTONE = register("redstone"); + @Unique + private static final RegistryKey TRANSPORTATION = register("transportation"); + @Unique + private static final RegistryKey MISC = register("misc"); + @Unique + private static final RegistryKey FOOD = register("food"); + @Unique + private static final RegistryKey TOOLS = register("tools"); + @Unique + private static final RegistryKey COMBAT = register("combat"); + @Unique + private static final RegistryKey BREWING = register("brewing"); + @Unique private static final ItemGroup hotbarGroup = ItemGroup .create(ItemGroup.Row.TOP, 5) @@ -52,10 +71,12 @@ public class ItemGroupsMixin { /** * @author TheClashFruit - * @reason pre 1.19.4 inventory layout :3 + * @reason pre 1.19.3 inventory layout :3 */ @Overwrite public static ItemGroup registerAndGetDefault(Registry registry) { + LOGGER.info("ItemGroups Working!"); + final ItemGroup searchGroup = ItemGroup .create(ItemGroup.Row.TOP, 6) .displayName(Text.translatable("itemGroup.search")) @@ -84,6 +105,7 @@ public class ItemGroupsMixin { BUILDING_BLOCKS, ItemGroup .create(ItemGroup.Row.TOP, 0) + .type(ItemGroup.Type.CATEGORY) .displayName(Text.translatable("itemGroup.buildingBlocks")) .icon(() -> new ItemStack(Blocks.BRICKS)) .entries((displayContext, content) -> { @@ -535,9 +557,10 @@ public class ItemGroupsMixin { Registry.register( registry, - NATURAL, + DECORATION, ItemGroup .create(ItemGroup.Row.TOP, 1) + .type(ItemGroup.Type.CATEGORY) .displayName(Text.translatable("itemGroup.decorations")) .icon(() -> new ItemStack(Blocks.PEONY)) .entries((displayContext, content) -> { @@ -937,6 +960,7 @@ public class ItemGroupsMixin { REDSTONE, ItemGroup .create(ItemGroup.Row.TOP, 2) + .type(ItemGroup.Type.CATEGORY) .displayName(Text.translatable("itemGroup.redstone")) .icon(() -> new ItemStack(Items.REDSTONE)) .entries((displayContext, content) -> { @@ -1034,9 +1058,10 @@ public class ItemGroupsMixin { Registry.register( registry, - FUNCTIONAL, + TRANSPORTATION, ItemGroup .create(ItemGroup.Row.TOP, 3) + .type(ItemGroup.Type.CATEGORY) .displayName(Text.translatable("itemGroup.transportation")) .icon(() -> new ItemStack(Items.POWERED_RAIL)) .entries((displayContext, content) -> { @@ -1080,9 +1105,10 @@ public class ItemGroupsMixin { Registry.register( registry, - INGREDIENTS, + MISC, ItemGroup .create(ItemGroup.Row.BOTTOM, 0) + .type(ItemGroup.Type.CATEGORY) .displayName(Text.translatable("itemGroup.misc")) .icon(() -> new ItemStack(Items.LAVA_BUCKET)) .entries((displayContext, content) -> { @@ -1323,9 +1349,10 @@ public class ItemGroupsMixin { Registry.register( registry, - FOOD_AND_DRINK, + FOOD, ItemGroup .create(ItemGroup.Row.BOTTOM, 1) + .type(ItemGroup.Type.CATEGORY) .displayName(Text.translatable("itemGroup.food")) .icon(() -> new ItemStack(Items.APPLE)) .entries((displayContext, content) -> { @@ -1376,6 +1403,7 @@ public class ItemGroupsMixin { TOOLS, ItemGroup .create(ItemGroup.Row.BOTTOM, 2) + .type(ItemGroup.Type.CATEGORY) .displayName(Text.translatable("itemGroup.tools")) .icon(() -> new ItemStack(Items.IRON_AXE)) .entries((displayContext, content) -> { @@ -1441,6 +1469,7 @@ public class ItemGroupsMixin { COMBAT, ItemGroup .create(ItemGroup.Row.BOTTOM, 3) + .type(ItemGroup.Type.CATEGORY) .displayName(Text.translatable("itemGroup.combat")) .icon(() -> new ItemStack(Items.GOLDEN_SWORD)) .entries((displayContext, content) -> { @@ -1504,9 +1533,10 @@ public class ItemGroupsMixin { Registry.register( registry, - COLORED_BLOCKS, + BREWING, ItemGroup .create(ItemGroup.Row.BOTTOM, 4) + .type(ItemGroup.Type.CATEGORY) .displayName(Text.translatable("itemGroup.brewing")) .icon(() -> new ItemStack(PotionUtil.setPotion(new ItemStack(Items.POTION), Potions.WATER).getItem())) .entries((displayContext, content) -> { diff --git a/src/main/resources/cc.mixins.json b/src/main/resources/cc.mixins.json index 3ea717b..f82ad3f 100644 --- a/src/main/resources/cc.mixins.json +++ b/src/main/resources/cc.mixins.json @@ -8,6 +8,7 @@ "ItemGroupsMixin" ], "client": [ + "CreativeInventoryScreenMixin" ], "injectors": { "defaultRequire": 1 From 0a475b38218a10a849dff2589bb1edba2e270ab9 Mon Sep 17 00:00:00 2001 From: TheClashFruit Date: Mon, 14 Aug 2023 20:43:56 +0200 Subject: [PATCH 2/8] feat: pain --- .../cc/mixin/CreativeInventoryScreenMixin.java | 18 ++++++++++++++---- src/main/resources/cc.accesswidener | 4 +++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/main/java/me/theclashfruit/cc/mixin/CreativeInventoryScreenMixin.java b/src/main/java/me/theclashfruit/cc/mixin/CreativeInventoryScreenMixin.java index f6c29ac..ec90679 100644 --- a/src/main/java/me/theclashfruit/cc/mixin/CreativeInventoryScreenMixin.java +++ b/src/main/java/me/theclashfruit/cc/mixin/CreativeInventoryScreenMixin.java @@ -1,12 +1,22 @@ package me.theclashfruit.cc.mixin; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.gui.screen.ingame.AbstractInventoryScreen; import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen; +import net.minecraft.client.gui.screen.ingame.HandledScreen; +import net.minecraft.client.gui.screen.ingame.InventoryScreen; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.ItemGroup; +import net.minecraft.item.ItemGroups; +import net.minecraft.item.ItemStack; +import net.minecraft.text.Text; +import net.minecraft.util.Identifier; +import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import org.spongepowered.asm.mixin.Shadow; @Mixin(CreativeInventoryScreen.class) public class CreativeInventoryScreenMixin { @@ -21,7 +31,7 @@ public class CreativeInventoryScreenMixin { int j = 32; int k = 32 * i; if (group.isSpecial()) { - k = 176 - 32 * (6 - i) + 1; + k = 176 - 32 * (6 - i) - 7; } return k; } diff --git a/src/main/resources/cc.accesswidener b/src/main/resources/cc.accesswidener index 71e6311..d9d5be0 100644 --- a/src/main/resources/cc.accesswidener +++ b/src/main/resources/cc.accesswidener @@ -1,3 +1,5 @@ accessWidener v1 named -accessible method net/minecraft/item/ItemGroup$Builder type (Lnet/minecraft/item/ItemGroup$Type;)Lnet/minecraft/item/ItemGroup$Builder; \ No newline at end of file +accessible method net/minecraft/item/ItemGroup$Builder type (Lnet/minecraft/item/ItemGroup$Type;)Lnet/minecraft/item/ItemGroup$Builder; + +# accessible method net/minecraft/client/gui/screen/ingame/CreativeInventoryScreen renderTabIcon (Lnet/minecraft/gui/DrawContext; Lnet/minecraft/item/ItemGroup;)V \ No newline at end of file From cd81afb5c5c7f2bc73158430eff91bd19c6b584e Mon Sep 17 00:00:00 2001 From: TheClashFruit Date: Tue, 15 Aug 2023 13:40:22 +0200 Subject: [PATCH 3/8] feat: nvm --- .../mixin/CreativeInventoryScreenMixin.java | 38 ------------------- .../cc/mixin/ItemGroupsMixin.java | 1 + src/main/resources/cc.accesswidener | 4 +- src/main/resources/cc.mixins.json | 2 +- 4 files changed, 3 insertions(+), 42 deletions(-) delete mode 100644 src/main/java/me/theclashfruit/cc/mixin/CreativeInventoryScreenMixin.java diff --git a/src/main/java/me/theclashfruit/cc/mixin/CreativeInventoryScreenMixin.java b/src/main/java/me/theclashfruit/cc/mixin/CreativeInventoryScreenMixin.java deleted file mode 100644 index ec90679..0000000 --- a/src/main/java/me/theclashfruit/cc/mixin/CreativeInventoryScreenMixin.java +++ /dev/null @@ -1,38 +0,0 @@ -package me.theclashfruit.cc.mixin; - -import net.minecraft.client.gui.DrawContext; -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.screen.ingame.AbstractInventoryScreen; -import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen; -import net.minecraft.client.gui.screen.ingame.HandledScreen; -import net.minecraft.client.gui.screen.ingame.InventoryScreen; -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.player.PlayerInventory; -import net.minecraft.item.ItemGroup; -import net.minecraft.item.ItemGroups; -import net.minecraft.item.ItemStack; -import net.minecraft.text.Text; -import net.minecraft.util.Identifier; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; -import org.spongepowered.asm.mixin.Shadow; - -@Mixin(CreativeInventoryScreen.class) -public class CreativeInventoryScreenMixin { - - /** - * @author TheClashFruit - * @reason pre 1.19.3 inventory layout :3 - */ - @Overwrite - private int getTabX(ItemGroup group) { - int i = group.getColumn(); - int j = 32; - int k = 32 * i; - if (group.isSpecial()) { - k = 176 - 32 * (6 - i) - 7; - } - return k; - } -} diff --git a/src/main/java/me/theclashfruit/cc/mixin/ItemGroupsMixin.java b/src/main/java/me/theclashfruit/cc/mixin/ItemGroupsMixin.java index f9782cd..dfc6958 100644 --- a/src/main/java/me/theclashfruit/cc/mixin/ItemGroupsMixin.java +++ b/src/main/java/me/theclashfruit/cc/mixin/ItemGroupsMixin.java @@ -19,6 +19,7 @@ import java.util.EnumSet; import java.util.Set; import static me.theclashfruit.cc.ClutteredCreative.LOGGER; +import static net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen.TAB_WIDTH; import static net.minecraft.item.ItemGroups.*; @Mixin(ItemGroups.class) diff --git a/src/main/resources/cc.accesswidener b/src/main/resources/cc.accesswidener index d9d5be0..71e6311 100644 --- a/src/main/resources/cc.accesswidener +++ b/src/main/resources/cc.accesswidener @@ -1,5 +1,3 @@ accessWidener v1 named -accessible method net/minecraft/item/ItemGroup$Builder type (Lnet/minecraft/item/ItemGroup$Type;)Lnet/minecraft/item/ItemGroup$Builder; - -# accessible method net/minecraft/client/gui/screen/ingame/CreativeInventoryScreen renderTabIcon (Lnet/minecraft/gui/DrawContext; Lnet/minecraft/item/ItemGroup;)V \ No newline at end of file +accessible method net/minecraft/item/ItemGroup$Builder type (Lnet/minecraft/item/ItemGroup$Type;)Lnet/minecraft/item/ItemGroup$Builder; \ No newline at end of file diff --git a/src/main/resources/cc.mixins.json b/src/main/resources/cc.mixins.json index f82ad3f..4e0dc43 100644 --- a/src/main/resources/cc.mixins.json +++ b/src/main/resources/cc.mixins.json @@ -8,7 +8,7 @@ "ItemGroupsMixin" ], "client": [ - "CreativeInventoryScreenMixin" + ], "injectors": { "defaultRequire": 1 From 025dcdb6e4e0a6ef1ff58b328496cbacd007c83e Mon Sep 17 00:00:00 2001 From: TheClashFruit Date: Tue, 15 Aug 2023 13:42:02 +0200 Subject: [PATCH 4/8] feat: remove tests --- .../theclashfruit/cc/ClutteredCreative.java | 111 ------------------ 1 file changed, 111 deletions(-) diff --git a/src/main/java/me/theclashfruit/cc/ClutteredCreative.java b/src/main/java/me/theclashfruit/cc/ClutteredCreative.java index 83873b8..283dcac 100644 --- a/src/main/java/me/theclashfruit/cc/ClutteredCreative.java +++ b/src/main/java/me/theclashfruit/cc/ClutteredCreative.java @@ -13,121 +13,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class ClutteredCreative implements ModInitializer { - - private static final ItemGroup YES = FabricItemGroup.builder() - .icon(() -> new ItemStack(Items.DIAMOND)) - .displayName(Text.translatable("itemGroup.tutorial.test_group")) - .entries((displayContext, content) -> { - content.add(Items.DIAMOND); - }) - .build(); - - private static final ItemGroup NO = FabricItemGroup.builder() - .icon(() -> new ItemStack(Items.DIAMOND)) - .displayName(Text.translatable("itemGroup.tutorial.test_group")) - .entries((displayContext, content) -> { - content.add(Items.DIAMOND); - }) - .build(); - - private static final ItemGroup SHIT = FabricItemGroup.builder() - .icon(() -> new ItemStack(Items.DIAMOND)) - .displayName(Text.translatable("itemGroup.tutorial.test_group")) - .entries((displayContext, content) -> { - content.add(Items.DIAMOND); - }) - .build(); - - private static final ItemGroup YES2 = FabricItemGroup.builder() - .icon(() -> new ItemStack(Items.DIAMOND)) - .displayName(Text.translatable("itemGroup.tutorial.test_group")) - .entries((displayContext, content) -> { - content.add(Items.DIAMOND); - }) - .build(); - - private static final ItemGroup NO2 = FabricItemGroup.builder() - .icon(() -> new ItemStack(Items.DIAMOND)) - .displayName(Text.translatable("itemGroup.tutorial.test_group")) - .entries((displayContext, content) -> { - content.add(Items.DIAMOND); - }) - .build(); - - private static final ItemGroup SHIT2 = FabricItemGroup.builder() - .icon(() -> new ItemStack(Items.DIAMOND)) - .displayName(Text.translatable("itemGroup.tutorial.test_group")) - .entries((displayContext, content) -> { - content.add(Items.DIAMOND); - }) - .build(); - - private static final ItemGroup YES3 = FabricItemGroup.builder() - .icon(() -> new ItemStack(Items.DIAMOND)) - .displayName(Text.translatable("itemGroup.tutorial.test_group")) - .entries((displayContext, content) -> { - content.add(Items.DIAMOND); - }) - .build(); - - private static final ItemGroup NO3 = FabricItemGroup.builder() - .icon(() -> new ItemStack(Items.DIAMOND)) - .displayName(Text.translatable("itemGroup.tutorial.test_group")) - .entries((displayContext, content) -> { - content.add(Items.DIAMOND); - }) - .build(); - - private static final ItemGroup SHIT3 = FabricItemGroup.builder() - .icon(() -> new ItemStack(Items.DIAMOND)) - .displayName(Text.translatable("itemGroup.tutorial.test_group")) - .entries((displayContext, content) -> { - content.add(Items.DIAMOND); - }) - .build(); - - private static final ItemGroup YES4 = FabricItemGroup.builder() - .icon(() -> new ItemStack(Items.DIAMOND)) - .displayName(Text.translatable("itemGroup.tutorial.test_group")) - .entries((displayContext, content) -> { - content.add(Items.DIAMOND); - }) - .build(); - - private static final ItemGroup NO4 = FabricItemGroup.builder() - .icon(() -> new ItemStack(Items.DIAMOND)) - .displayName(Text.translatable("itemGroup.tutorial.test_group")) - .entries((displayContext, content) -> { - content.add(Items.DIAMOND); - }) - .build(); - - private static final ItemGroup SHIT4 = FabricItemGroup.builder() - .icon(() -> new ItemStack(Items.DIAMOND)) - .displayName(Text.translatable("itemGroup.tutorial.test_group")) - .entries((displayContext, content) -> { - content.add(Items.DIAMOND); - }) - .build(); - public static final Logger LOGGER = LoggerFactory.getLogger("ClutteredCreative"); @Override public void onInitialize() { - Registry.register(Registries.ITEM_GROUP, new Identifier("cc", "yes"), YES); - Registry.register(Registries.ITEM_GROUP, new Identifier("cc", "no"), NO); - Registry.register(Registries.ITEM_GROUP, new Identifier("cc", "shit"), SHIT); - Registry.register(Registries.ITEM_GROUP, new Identifier("cc", "yes2"), YES2); - Registry.register(Registries.ITEM_GROUP, new Identifier("cc", "no2"), NO2); - Registry.register(Registries.ITEM_GROUP, new Identifier("cc", "shit2"), SHIT2); - - Registry.register(Registries.ITEM_GROUP, new Identifier("cc", "yes3"), YES3); - Registry.register(Registries.ITEM_GROUP, new Identifier("cc", "no3"), NO3); - Registry.register(Registries.ITEM_GROUP, new Identifier("cc", "shit3"), SHIT3); - - Registry.register(Registries.ITEM_GROUP, new Identifier("cc", "yes4"), YES4); - Registry.register(Registries.ITEM_GROUP, new Identifier("cc", "no4"), NO4); - Registry.register(Registries.ITEM_GROUP, new Identifier("cc", "shit4"), SHIT4); } } From c8601c3661532146a0ba1ce72e6eb4ef0dc1671f Mon Sep 17 00:00:00 2001 From: TheClashFruit Date: Tue, 15 Aug 2023 13:52:37 +0200 Subject: [PATCH 5/8] feat: bamboo --- .../java/me/theclashfruit/cc/mixin/ItemGroupsMixin.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/theclashfruit/cc/mixin/ItemGroupsMixin.java b/src/main/java/me/theclashfruit/cc/mixin/ItemGroupsMixin.java index dfc6958..1515c2e 100644 --- a/src/main/java/me/theclashfruit/cc/mixin/ItemGroupsMixin.java +++ b/src/main/java/me/theclashfruit/cc/mixin/ItemGroupsMixin.java @@ -19,7 +19,6 @@ import java.util.EnumSet; import java.util.Set; import static me.theclashfruit.cc.ClutteredCreative.LOGGER; -import static net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen.TAB_WIDTH; import static net.minecraft.item.ItemGroups.*; @Mixin(ItemGroups.class) @@ -140,6 +139,7 @@ public class ItemGroupsMixin { content.add(Items.DARK_OAK_PLANKS); content.add(Items.MANGROVE_PLANKS); content.add(Items.CHERRY_PLANKS); + content.add(Items.BAMBOO_PLANKS); content.add(Items.CRIMSON_PLANKS); content.add(Items.WARPED_PLANKS); content.add(Items.BEDROCK); @@ -219,6 +219,7 @@ public class ItemGroupsMixin { content.add(Items.MANGROVE_ROOTS); content.add(Items.MUDDY_MANGROVE_ROOTS); content.add(Items.CHERRY_LOG); + content.add(Items.BAMBOO_BLOCK); content.add(Items.CRIMSON_STEM); content.add(Items.WARPED_STEM); @@ -230,6 +231,7 @@ public class ItemGroupsMixin { content.add(Items.STRIPPED_DARK_OAK_LOG); content.add(Items.STRIPPED_MANGROVE_LOG); content.add(Items.STRIPPED_CHERRY_LOG); + content.add(Items.STRIPPED_BAMBOO_BLOCK); content.add(Items.STRIPPED_CRIMSON_STEM); content.add(Items.STRIPPED_WARPED_STEM); @@ -292,6 +294,7 @@ public class ItemGroupsMixin { content.add(Items.DARK_OAK_SLAB); content.add(Items.MANGROVE_SLAB); content.add(Items.CHERRY_SLAB); + content.add(Items.BAMBOO_SLAB); content.add(Items.CRIMSON_SLAB); content.add(Items.WARPED_SLAB); @@ -386,6 +389,7 @@ public class ItemGroupsMixin { content.add(Items.DARK_OAK_STAIRS); content.add(Items.MANGROVE_STAIRS); content.add(Items.CHERRY_STAIRS); + content.add(Items.BAMBOO_STAIRS); content.add(Items.CRIMSON_STAIRS); content.add(Items.WARPED_STAIRS); From 86e0dfdf1e42aae4d557b9ac3b26ff3447974c2a Mon Sep 17 00:00:00 2001 From: TheClashFruit Date: Wed, 16 Aug 2023 10:32:23 +0200 Subject: [PATCH 6/8] feat: more bamboo --- .../cc/mixin/ItemGroupsMixin.java | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/src/main/java/me/theclashfruit/cc/mixin/ItemGroupsMixin.java b/src/main/java/me/theclashfruit/cc/mixin/ItemGroupsMixin.java index 1515c2e..b73eb49 100644 --- a/src/main/java/me/theclashfruit/cc/mixin/ItemGroupsMixin.java +++ b/src/main/java/me/theclashfruit/cc/mixin/ItemGroupsMixin.java @@ -7,16 +7,19 @@ import net.minecraft.enchantment.Enchantments; import net.minecraft.item.*; import net.minecraft.potion.PotionUtil; import net.minecraft.potion.Potions; +import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; import net.minecraft.registry.RegistryKey; import net.minecraft.registry.RegistryKeys; import net.minecraft.registry.tag.InstrumentTags; import net.minecraft.text.Text; +import net.minecraft.util.Identifier; import net.minecraft.village.raid.Raid; import org.spongepowered.asm.mixin.*; +import org.spongepowered.asm.mixin.gen.Accessor; +import org.spongepowered.asm.mixin.gen.Invoker; -import java.util.EnumSet; -import java.util.Set; +import java.util.*; import static me.theclashfruit.cc.ClutteredCreative.LOGGER; import static net.minecraft.item.ItemGroups.*; @@ -24,7 +27,7 @@ import static net.minecraft.item.ItemGroups.*; @Mixin(ItemGroups.class) public class ItemGroupsMixin { - @Shadow + @Invoker("register") private static RegistryKey register(String id) { throw new AssertionError(); } @@ -32,21 +35,19 @@ public class ItemGroupsMixin { @Unique private static final RegistryKey BUILDING_BLOCKS = register("building_blocks"); @Unique - private static final RegistryKey DECORATION = register("decoration"); + private static final RegistryKey DECORATION = register("natural_blocks"); @Unique - private static final RegistryKey REDSTONE = register("redstone"); + private static final RegistryKey REDSTONE = register("redstone_blocks"); @Unique - private static final RegistryKey TRANSPORTATION = register("transportation"); + private static final RegistryKey TRANSPORTATION = register("functional_blocks"); @Unique - private static final RegistryKey MISC = register("misc"); + private static final RegistryKey MISC = register("ingredients"); @Unique - private static final RegistryKey FOOD = register("food"); + private static final RegistryKey FOOD = register("food_and_drinks"); @Unique - private static final RegistryKey TOOLS = register("tools"); + private static final RegistryKey TOOLS = register("tools_and_utilities"); @Unique - private static final RegistryKey COMBAT = register("combat"); - @Unique - private static final RegistryKey BREWING = register("brewing"); + private static final RegistryKey BREWING = register("spawn_eggs"); @Unique private static final ItemGroup hotbarGroup = ItemGroup @@ -632,6 +633,7 @@ public class ItemGroupsMixin { content.add(Items.BIG_DRIPLEAF); content.add(Items.SMALL_DRIPLEAF); content.add(Items.BAMBOO); + content.add(Items.BAMBOO_MOSAIC); content.add(Items.TORCH); @@ -659,6 +661,7 @@ public class ItemGroupsMixin { content.add(Items.DARK_OAK_FENCE); content.add(Items.MANGROVE_FENCE); content.add(Items.CHERRY_FENCE); + content.add(Items.BAMBOO_FENCE); content.add(Items.CRIMSON_FENCE); content.add(Items.WARPED_FENCE); @@ -834,6 +837,7 @@ public class ItemGroupsMixin { content.add(Items.ACACIA_SIGN); content.add(Items.DARK_OAK_SIGN); content.add(Items.MANGROVE_SIGN); + content.add(Items.BAMBOO_SIGN); content.add(Items.CHERRY_SIGN); content.add(Items.CRIMSON_SIGN); content.add(Items.WARPED_SIGN); @@ -846,6 +850,7 @@ public class ItemGroupsMixin { content.add(Items.DARK_OAK_HANGING_SIGN); content.add(Items.MANGROVE_HANGING_SIGN); content.add(Items.CHERRY_HANGING_SIGN); + content.add(Items.BAMBOO_HANGING_SIGN); content.add(Items.CRIMSON_HANGING_SIGN); content.add(Items.WARPED_HANGING_SIGN); @@ -1005,6 +1010,7 @@ public class ItemGroupsMixin { content.add(Items.DARK_OAK_BUTTON); content.add(Items.MANGROVE_BUTTON); content.add(Items.CHERRY_BUTTON); + content.add(Items.BAMBOO_BUTTON); content.add(Items.CRIMSON_BUTTON); content.add(Items.WARPED_BUTTON); @@ -1020,6 +1026,7 @@ public class ItemGroupsMixin { content.add(Items.DARK_OAK_PRESSURE_PLATE); content.add(Items.MANGROVE_PRESSURE_PLATE); content.add(Items.CHERRY_PRESSURE_PLATE); + content.add(Items.BAMBOO_PRESSURE_PLATE); content.add(Items.CRIMSON_PRESSURE_PLATE); content.add(Items.WARPED_PRESSURE_PLATE); @@ -1032,6 +1039,7 @@ public class ItemGroupsMixin { content.add(Items.DARK_OAK_DOOR); content.add(Items.MANGROVE_DOOR); content.add(Items.CHERRY_DOOR); + content.add(Items.BAMBOO_DOOR); content.add(Items.CRIMSON_DOOR); content.add(Items.WARPED_DOOR); @@ -1044,6 +1052,7 @@ public class ItemGroupsMixin { content.add(Items.DARK_OAK_TRAPDOOR); content.add(Items.MANGROVE_TRAPDOOR); content.add(Items.CHERRY_TRAPDOOR); + content.add(Items.BAMBOO_TRAPDOOR); content.add(Items.CRIMSON_TRAPDOOR); content.add(Items.WARPED_TRAPDOOR); @@ -1055,6 +1064,7 @@ public class ItemGroupsMixin { content.add(Items.DARK_OAK_FENCE_GATE); content.add(Items.MANGROVE_FENCE_GATE); content.add(Items.CHERRY_FENCE_GATE); + content.add(Items.BAMBOO_FENCE_GATE); content.add(Items.CRIMSON_FENCE_GATE); content.add(Items.WARPED_FENCE_GATE); }) @@ -1104,6 +1114,8 @@ public class ItemGroupsMixin { content.add(Items.MANGROVE_CHEST_BOAT); content.add(Items.CHERRY_BOAT); content.add(Items.CHERRY_CHEST_BOAT); + content.add(Items.BAMBOO_RAFT); + content.add(Items.BAMBOO_CHEST_RAFT); }) .build() ); From 2de9e88d6763e7a555ff423dc0e2d933caa1e0b1 Mon Sep 17 00:00:00 2001 From: TheClashFruit Date: Wed, 16 Aug 2023 10:33:35 +0200 Subject: [PATCH 7/8] docs: add downloads badge :3 --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 2fc6fc9..ed9a66d 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,7 @@ Issues Pull Requests - Version License (MIT) From 2d2901ab5e9119698e7d8bbf6e7e4e4c8cf54d8e Mon Sep 17 00:00:00 2001 From: TheClashFruit Date: Wed, 16 Aug 2023 10:36:04 +0200 Subject: [PATCH 8/8] feat: set version to rc.2 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 6062fd2..db51c94 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ yarn_mappings=1.20+build.1 loader_version=0.14.22 # Mod Properties -mod_version = 1.0.0-rc.1 +mod_version = 1.0.0-rc.2 maven_group = me.theclashfruit archives_base_name = cc