Replaced Hashtable with HashMap
Replaced all instances of Hashtable in our code with HashMap. I had never given that much thought until Steven mentioned it. HashMap is a better alternative for our code.
This commit is contained in:
parent
63be7fefc1
commit
f542941074
2 changed files with 4 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
|||
package StevenDimDoors.mod_pocketDim;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Hashtable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
|
@ -77,7 +77,7 @@ public class DDLoot {
|
|||
//the same item. For instance, it cannot distinguish between different types of wood. That shouldn't
|
||||
//matter for most chest loot, though. This could be fixed if we cared enough.
|
||||
Random random = new Random();
|
||||
Hashtable<Integer, WeightedRandomChestContent> container = new Hashtable<Integer, WeightedRandomChestContent>();
|
||||
HashMap<Integer, WeightedRandomChestContent> container = new HashMap<Integer, WeightedRandomChestContent>();
|
||||
|
||||
for (String category : categories)
|
||||
{
|
||||
|
|
|
@ -5,7 +5,6 @@ import java.io.FileOutputStream;
|
|||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Random;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
@ -75,7 +74,7 @@ public class DungeonHelper
|
|||
public DungeonGenerator defaultUp = new DungeonGenerator(0, "/schematic/simpleStairsUp.schematic", true);
|
||||
|
||||
private HashSet<String> dungeonTypeChecker;
|
||||
private Hashtable<String, ArrayList<DungeonGenerator>> dungeonTypeMapping;
|
||||
private HashMap<String, ArrayList<DungeonGenerator>> dungeonTypeMapping;
|
||||
|
||||
private DungeonHelper()
|
||||
{
|
||||
|
@ -88,7 +87,7 @@ public class DungeonHelper
|
|||
}
|
||||
|
||||
//Add all the basic dungeon types to dungeonTypeMapping
|
||||
dungeonTypeMapping = new Hashtable<String, ArrayList<DungeonGenerator>>();
|
||||
dungeonTypeMapping = new HashMap<String, ArrayList<DungeonGenerator>>();
|
||||
dungeonTypeMapping.put(SIMPLE_HALL_DUNGEON_TYPE, simpleHalls);
|
||||
dungeonTypeMapping.put(COMPLEX_HALL_DUNGEON_TYPE, complexHalls);
|
||||
dungeonTypeMapping.put(HUB_DUNGEON_TYPE, hubs);
|
||||
|
|
Loading…
Reference in a new issue