Completed Dungeon Pack Implementation
Added code so that the mod loads dungeon packs stored in the custom dungeons folder. Changed the code for loading bundled dungeons so that they're loaded as dungeon packs. This means dungeon packs are now fully integrated into the mod. The changes were tested and seem to be working perfectly.
This commit is contained in:
@@ -4,13 +4,11 @@ import java.io.File;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Random;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.dungeon.pack.DungeonPack;
|
||||
import StevenDimDoors.mod_pocketDim.dungeon.pack.DungeonType;
|
||||
import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class DungeonGenerator implements Serializable
|
||||
{
|
||||
//This static field is hax so that I don't have to add an instance field to DungeonGenerator to support DungeonType.
|
||||
@@ -48,7 +46,13 @@ public class DungeonGenerator implements Serializable
|
||||
{
|
||||
File file = new File(schematicPath);
|
||||
String typeName = file.getName().split("_")[0];
|
||||
type = DungeonHelper.instance().RuinsPack.getType(typeName);
|
||||
String packName = file.getParentFile().getName();
|
||||
DungeonPack pack = DungeonHelper.instance().getDungeonPack(packName);
|
||||
if (pack == null)
|
||||
{
|
||||
pack = DungeonHelper.instance().getDungeonPack("ruins");
|
||||
}
|
||||
type = pack.getType(typeName);
|
||||
}
|
||||
catch (Exception e) { }
|
||||
if (type == null)
|
||||
|
||||
Reference in New Issue
Block a user