Skip to content

Commit aaa4af9

Browse files
committed
feat: only change maps and sets related to Biome
1 parent cb34447 commit aaa4af9

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/main/java/io/github/thebusybiscuit/slimefun4/utils/biomes/BiomeMap.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.io.InputStreamReader;
66
import java.nio.charset.StandardCharsets;
77
import java.util.EnumMap;
8+
import java.util.HashMap;
89
import java.util.Map;
910
import java.util.stream.Collectors;
1011

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

5051
/**
5152
* The {@link NamespacedKey} to identify this {@link BiomeMap}.

src/main/java/io/github/thebusybiscuit/slimefun4/utils/biomes/BiomeMapParser.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.github.thebusybiscuit.slimefun4.utils.biomes;
22

3-
import java.util.EnumMap;
4-
import java.util.EnumSet;
3+
import java.util.HashMap;
4+
import java.util.HashSet;
55
import java.util.Locale;
66
import java.util.Map;
77
import java.util.Set;
@@ -40,7 +40,7 @@ public class BiomeMapParser<T> {
4040

4141
private final NamespacedKey key;
4242
private final BiomeDataConverter<T> valueConverter;
43-
private final Map<Biome, T> map = new EnumMap<>(Biome.class);
43+
private final Map<Biome, T> map = new HashMap<>();
4444

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

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

164164
for (JsonElement element : array) {
165165
if (element.isJsonPrimitive() && element.getAsJsonPrimitive().isString()) {

0 commit comments

Comments
 (0)