mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-12-28 03:57:39 +01:00
Converted Map to EnumMap
When all the keys of a Map are values from the same enum, the Map can be replaced with an EnumMap, which can be much more efficient than other sets because the underlying data structure is a simple array.
This commit is contained in:
parent
7b55ca70b2
commit
7e7b259531
@ -2,6 +2,7 @@ package us.tastybento.bskyblock;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
@ -132,7 +133,9 @@ public class Settings implements ISettings<Settings> {
|
||||
private boolean endIslands = true;
|
||||
|
||||
// Entities
|
||||
private Map<EntityType, Integer> entityLimits = new HashMap<>();
|
||||
@ConfigEntry(path = "island.limits.entities")
|
||||
private Map<EntityType, Integer> entityLimits = new EnumMap<>(EntityType.class);
|
||||
@ConfigEntry(path = "island.limits.tile-entities")
|
||||
private Map<String, Integer> tileEntityLimits = new HashMap<>();
|
||||
|
||||
// ---------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user