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:
@@ -1,7 +1,7 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
package StevenDimDoors.mod_pocketDim;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Hashtable;
|
import java.util.HashMap;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import net.minecraft.item.Item;
|
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
|
//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.
|
//matter for most chest loot, though. This could be fixed if we cared enough.
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
Hashtable<Integer, WeightedRandomChestContent> container = new Hashtable<Integer, WeightedRandomChestContent>();
|
HashMap<Integer, WeightedRandomChestContent> container = new HashMap<Integer, WeightedRandomChestContent>();
|
||||||
|
|
||||||
for (String category : categories)
|
for (String category : categories)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import java.io.FileOutputStream;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Hashtable;
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
@@ -75,7 +74,7 @@ public class DungeonHelper
|
|||||||
public DungeonGenerator defaultUp = new DungeonGenerator(0, "/schematic/simpleStairsUp.schematic", true);
|
public DungeonGenerator defaultUp = new DungeonGenerator(0, "/schematic/simpleStairsUp.schematic", true);
|
||||||
|
|
||||||
private HashSet<String> dungeonTypeChecker;
|
private HashSet<String> dungeonTypeChecker;
|
||||||
private Hashtable<String, ArrayList<DungeonGenerator>> dungeonTypeMapping;
|
private HashMap<String, ArrayList<DungeonGenerator>> dungeonTypeMapping;
|
||||||
|
|
||||||
private DungeonHelper()
|
private DungeonHelper()
|
||||||
{
|
{
|
||||||
@@ -88,7 +87,7 @@ public class DungeonHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Add all the basic dungeon types to dungeonTypeMapping
|
//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(SIMPLE_HALL_DUNGEON_TYPE, simpleHalls);
|
||||||
dungeonTypeMapping.put(COMPLEX_HALL_DUNGEON_TYPE, complexHalls);
|
dungeonTypeMapping.put(COMPLEX_HALL_DUNGEON_TYPE, complexHalls);
|
||||||
dungeonTypeMapping.put(HUB_DUNGEON_TYPE, hubs);
|
dungeonTypeMapping.put(HUB_DUNGEON_TYPE, hubs);
|
||||||
|
|||||||
Reference in New Issue
Block a user