From d9c630d8ca6429f515ff5541d6b358f76bab2984 Mon Sep 17 00:00:00 2001 From: IThundxr Date: Mon, 5 Feb 2024 13:30:37 -0500 Subject: [PATCH 1/2] Remove uneeded dependency on mixin extras (#1297) * dep on mixin extras isnt needed anymore since loader bundles it * remove dep --- build.gradle | 2 -- 1 file changed, 2 deletions(-) diff --git a/build.gradle b/build.gradle index f845ddddbf..867f8040a7 100644 --- a/build.gradle +++ b/build.gradle @@ -79,8 +79,6 @@ def setup(DependencyHandler deps) { it.officialMojangMappings { nameSyntheticMembers = false } }) deps.modImplementation("net.fabricmc:fabric-loader:$loader_version") - - deps.implementation(deps.annotationProcessor("io.github.llamalad7:mixinextras-fabric:0.3.5")) } // setup mods that enhance development From aee3d7ba921199d81f20165623f962429147f3bc Mon Sep 17 00:00:00 2001 From: IThundxr Date: Thu, 8 Feb 2024 14:36:28 -0500 Subject: [PATCH 2/2] Make creative tabs more like the forge version (#1302) --- .../simibubi/create/AllCreativeModeTabs.java | 35 ++++--------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/src/main/java/com/simibubi/create/AllCreativeModeTabs.java b/src/main/java/com/simibubi/create/AllCreativeModeTabs.java index 995cfb54f4..d9ea7e59bc 100644 --- a/src/main/java/com/simibubi/create/AllCreativeModeTabs.java +++ b/src/main/java/com/simibubi/create/AllCreativeModeTabs.java @@ -59,14 +59,14 @@ public class AllCreativeModeTabs { () -> FabricItemGroup.builder() .title(Components.translatable("itemGroup.create.base")) .icon(() -> AllBlocks.COGWHEEL.asStack()) - .displayItems(new RegistrateDisplayItemsGenerator(true, Tabs.BASE)) + .displayItems(new RegistrateDisplayItemsGenerator(true, () -> AllCreativeModeTabs.BASE_CREATIVE_TAB)) .build()); public static final TabInfo PALETTES_CREATIVE_TAB = register("palettes", () -> FabricItemGroup.builder() .title(Components.translatable("itemGroup.create.palettes")) .icon(() -> AllPaletteBlocks.ORNATE_IRON_WINDOW.asStack()) - .displayItems(new RegistrateDisplayItemsGenerator(false, Tabs.PALETTES)) + .displayItems(new RegistrateDisplayItemsGenerator(false, () -> AllCreativeModeTabs.PALETTES_CREATIVE_TAB)) .build()); private static TabInfo register(String name, Supplier supplier) { @@ -81,29 +81,6 @@ public static void register() { // fabric: just load the class } - public static ResourceKey getBaseTabKey() { - return BASE_CREATIVE_TAB.key(); - } - - public static ResourceKey getPalettesTabKey() { - return PALETTES_CREATIVE_TAB.key(); - } - - public enum Tabs { - BASE(AllCreativeModeTabs::getBaseTabKey), - PALETTES(AllCreativeModeTabs::getPalettesTabKey); - - private final Supplier> keySupplier; - - Tabs(Supplier> keySupplier) { - this.keySupplier = keySupplier; - } - - public ResourceKey getKey() { - return keySupplier.get(); - } - } - private static class RegistrateDisplayItemsGenerator implements DisplayItemsGenerator { private static final Predicate IS_ITEM_3D_PREDICATE; @@ -131,9 +108,9 @@ private static Predicate makeClient3dItemPredicate() { } private final boolean addItems; - private final Tabs tabFilter; + private final Supplier tabFilter; - public RegistrateDisplayItemsGenerator(boolean addItems, Tabs tabFilter) { + public RegistrateDisplayItemsGenerator(boolean addItems, Supplier tabFilter) { this.addItems = addItems; this.tabFilter = tabFilter; } @@ -307,7 +284,7 @@ public void accept(ItemDisplayParameters parameters, Output output) { private List collectBlocks(Predicate exclusionPredicate) { List items = new ReferenceArrayList<>(); for (RegistryEntry entry : Create.REGISTRATE.getAll(Registries.BLOCK)) { - if (!CreateRegistrate.isInCreativeTab(entry, tabFilter.getKey())) + if (!CreateRegistrate.isInCreativeTab(entry, tabFilter.get().key())) continue; Item item = entry.get() .asItem(); @@ -323,7 +300,7 @@ private List collectBlocks(Predicate exclusionPredicate) { private List collectItems(Predicate exclusionPredicate) { List items = new ReferenceArrayList<>(); for (RegistryEntry entry : Create.REGISTRATE.getAll(Registries.ITEM)) { - if (!CreateRegistrate.isInCreativeTab(entry, tabFilter.getKey())) + if (!CreateRegistrate.isInCreativeTab(entry, tabFilter.get().key())) continue; Item item = entry.get(); if (item instanceof BlockItem)