Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/13.x-1.20.2' into 1…
Browse files Browse the repository at this point in the history
…4.x-1.20.4
  • Loading branch information
shedaniel committed Aug 14, 2024
2 parents 31cff9b + 709c33c commit e00c813
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import me.shedaniel.rei.impl.common.InternalLogger;
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroupEntries;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.minecraft.core.RegistryAccess;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.flag.FeatureFlagSet;
Expand All @@ -35,16 +36,13 @@
import net.minecraft.world.item.CreativeModeTabs;
import net.minecraft.world.item.ItemStack;

import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.*;

public class CreativeModeTabCollectorImpl {
public static Map<CreativeModeTab, Collection<ItemStack>> collectTabs() {
Map<CreativeModeTab, Collection<ItemStack>> map = new LinkedHashMap<>();
FeatureFlagSet featureFlags = FeatureFlags.REGISTRY.allFlags();
CreativeModeTab.ItemDisplayParameters parameters = new CreativeModeTab.ItemDisplayParameters(featureFlags, true, BasicDisplay.registryAccess());
CreativeModeTab.ItemDisplayParameters parameters = new CreativeModeTab.ItemDisplayParameters(featureFlags, true, Objects.requireNonNullElseGet(BasicDisplay.registryAccess(), () -> RegistryAccess.fromRegistryOfRegistries(BuiltInRegistries.REGISTRY)));

for (CreativeModeTab tab : CreativeModeTabs.allTabs()) {
if (tab.getType() != CreativeModeTab.Type.HOTBAR && tab.getType() != CreativeModeTab.Type.INVENTORY) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import me.shedaniel.rei.api.common.display.basic.BasicDisplay;
import me.shedaniel.rei.impl.common.InternalLogger;
import net.minecraft.core.RegistryAccess;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.flag.FeatureFlagSet;
Expand All @@ -37,12 +38,13 @@
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;

public class CreativeModeTabCollectorImpl {
public static Map<CreativeModeTab, Collection<ItemStack>> collectTabs() {
Map<CreativeModeTab, Collection<ItemStack>> map = new LinkedHashMap<>();
FeatureFlagSet featureFlags = FeatureFlags.REGISTRY.allFlags();
CreativeModeTab.ItemDisplayParameters parameters = new CreativeModeTab.ItemDisplayParameters(featureFlags, true, BasicDisplay.registryAccess());
CreativeModeTab.ItemDisplayParameters parameters = new CreativeModeTab.ItemDisplayParameters(featureFlags, true, Objects.requireNonNullElseGet(BasicDisplay.registryAccess(), () -> RegistryAccess.fromRegistryOfRegistries(BuiltInRegistries.REGISTRY)));

for (CreativeModeTab tab : CreativeModeTabs.allTabs()) {
if (tab.getType() != CreativeModeTab.Type.HOTBAR && tab.getType() != CreativeModeTab.Type.INVENTORY) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import me.shedaniel.rei.api.common.display.basic.BasicDisplay;
import me.shedaniel.rei.impl.common.InternalLogger;
import net.minecraft.core.RegistryAccess;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.flag.FeatureFlagSet;
Expand All @@ -37,12 +38,13 @@
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;

public class CreativeModeTabCollectorImpl {
public static Map<CreativeModeTab, Collection<ItemStack>> collectTabs() {
Map<CreativeModeTab, Collection<ItemStack>> map = new LinkedHashMap<>();
FeatureFlagSet featureFlags = FeatureFlags.REGISTRY.allFlags();
CreativeModeTab.ItemDisplayParameters parameters = new CreativeModeTab.ItemDisplayParameters(featureFlags, true, BasicDisplay.registryAccess());
CreativeModeTab.ItemDisplayParameters parameters = new CreativeModeTab.ItemDisplayParameters(featureFlags, true, Objects.requireNonNullElseGet(BasicDisplay.registryAccess(), () -> RegistryAccess.fromRegistryOfRegistries(BuiltInRegistries.REGISTRY)));

for (CreativeModeTab tab : CreativeModeTabs.allTabs()) {
if (tab.getType() != CreativeModeTab.Type.HOTBAR && tab.getType() != CreativeModeTab.Type.INVENTORY) {
Expand Down

0 comments on commit e00c813

Please sign in to comment.