Skip to content

Commit

Permalink
ConcurrentHashMap's because no one uses mods.toml properly
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Jul 8, 2024
1 parent 5f35c13 commit 54a1bcd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public record BogeyEntry(@NotNull BogeyStyle bogeyStyle, @Nullable ResourceLocation iconLocation, float scale) {
public static final Map<BogeyStyle, BogeyEntry> STYLE_TO_ENTRY = new HashMap<>();
public static final Map<BogeyStyle, BogeyEntry> STYLE_TO_ENTRY = new ConcurrentHashMap<>();

public static BogeyEntry getOrCreate(@NotNull CategoryEntry categoryEntry, @NotNull BogeyStyle bogeyStyle, @Nullable ResourceLocation iconLocation, float scale) {
BogeyEntry entry = getOrCreate(bogeyStyle, iconLocation, scale);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@
import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@ApiStatus.Internal
public class BogeyMenuManagerImpl implements BogeyMenuManager {
/** Internal use only, do NOT touch. */
@ApiStatus.Internal public static final List<CategoryEntry> CATEGORIES = new ArrayList<>();
/** Internal use only, do NOT touch. */
@ApiStatus.Internal public static final Map<Pair<BogeyStyle, BogeySizes.BogeySize>, Float> SIZES_TO_SCALE = new HashMap<>();
@ApiStatus.Internal public static final Map<Pair<BogeyStyle, BogeySizes.BogeySize>, Float> SIZES_TO_SCALE = new ConcurrentHashMap<>();

static {
CATEGORIES.add(CategoryEntry.FavoritesCategory.INSTANCE);
Expand Down

0 comments on commit 54a1bcd

Please sign in to comment.