From f5429410742f4f472092a66fb9de5a0fe944f32e Mon Sep 17 00:00:00 2001 From: SenseiKiwi Date: Sun, 16 Jun 2013 11:06:08 -0400 Subject: [PATCH] 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. --- StevenDimDoors/mod_pocketDim/DDLoot.java | 4 ++-- StevenDimDoors/mod_pocketDim/helpers/DungeonHelper.java | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/StevenDimDoors/mod_pocketDim/DDLoot.java b/StevenDimDoors/mod_pocketDim/DDLoot.java index 7e6c6461..42266978 100644 --- a/StevenDimDoors/mod_pocketDim/DDLoot.java +++ b/StevenDimDoors/mod_pocketDim/DDLoot.java @@ -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 container = new Hashtable(); + HashMap container = new HashMap(); for (String category : categories) { diff --git a/StevenDimDoors/mod_pocketDim/helpers/DungeonHelper.java b/StevenDimDoors/mod_pocketDim/helpers/DungeonHelper.java index af664695..2ca027d6 100644 --- a/StevenDimDoors/mod_pocketDim/helpers/DungeonHelper.java +++ b/StevenDimDoors/mod_pocketDim/helpers/DungeonHelper.java @@ -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 dungeonTypeChecker; - private Hashtable> dungeonTypeMapping; + private HashMap> dungeonTypeMapping; private DungeonHelper() { @@ -88,7 +87,7 @@ public class DungeonHelper } //Add all the basic dungeon types to dungeonTypeMapping - dungeonTypeMapping = new Hashtable>(); + dungeonTypeMapping = new HashMap>(); dungeonTypeMapping.put(SIMPLE_HALL_DUNGEON_TYPE, simpleHalls); dungeonTypeMapping.put(COMPLEX_HALL_DUNGEON_TYPE, complexHalls); dungeonTypeMapping.put(HUB_DUNGEON_TYPE, hubs);