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 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)