Skip to content

Commit

Permalink
feat: only change maps and sets related to Biome
Browse files Browse the repository at this point in the history
  • Loading branch information
ybw0014 committed Nov 12, 2024
1 parent cb34447 commit aaa4af9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -45,7 +46,7 @@ public class BiomeMap<T> implements Keyed {
/**
* Our internal {@link EnumMap} holding all the data.
*/
private final Map<Biome, T> dataMap = new EnumMap<>(Biome.class);
private final Map<Biome, T> dataMap = new HashMap<>();

/**
* The {@link NamespacedKey} to identify this {@link BiomeMap}.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.thebusybiscuit.slimefun4.utils.biomes;

import java.util.EnumMap;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -40,7 +40,7 @@ public class BiomeMapParser<T> {

private final NamespacedKey key;
private final BiomeDataConverter<T> valueConverter;
private final Map<Biome, T> map = new EnumMap<>(Biome.class);
private final Map<Biome, T> map = new HashMap<>();

/**
* This flag specifies whether the parsing is "lenient" or not.
Expand Down Expand Up @@ -159,7 +159,7 @@ private void readEntry(@Nonnull JsonObject entry) throws BiomeMapException {

private @Nonnull Set<Biome> readBiomes(@Nonnull JsonArray array) throws BiomeMapException {
Validate.notNull(array, "The JSON array should not be null!");
Set<Biome> biomes = EnumSet.noneOf(Biome.class);
Set<Biome> biomes = new HashSet<>();

for (JsonElement element : array) {
if (element.isJsonPrimitive() && element.getAsJsonPrimitive().isString()) {
Expand Down

0 comments on commit aaa4af9

Please sign in to comment.