diff --git a/StevenDimDoors/mod_pocketDim/core/PocketManager.java b/StevenDimDoors/mod_pocketDim/core/PocketManager.java index d8ac4a4d..9a27143b 100644 --- a/StevenDimDoors/mod_pocketDim/core/PocketManager.java +++ b/StevenDimDoors/mod_pocketDim/core/PocketManager.java @@ -21,6 +21,7 @@ import StevenDimDoors.mod_pocketDim.helpers.DeleteFolder; import StevenDimDoors.mod_pocketDim.saving.DDSaveHandler; import StevenDimDoors.mod_pocketDim.saving.IPackable; import StevenDimDoors.mod_pocketDim.saving.PackedDimData; +import StevenDimDoors.mod_pocketDim.saving.PackedDungeonData; import StevenDimDoors.mod_pocketDim.saving.PackedLinkData; import StevenDimDoors.mod_pocketDim.saving.PackedLinkTail; import StevenDimDoors.mod_pocketDim.util.Point4D; @@ -96,6 +97,7 @@ public class PocketManager ArrayList ChildIDs = new ArrayList(); ArrayList Links = new ArrayList(); ArrayList Tails = new ArrayList(); + PackedDungeonData packedDungeon = new PackedDungeonData(); //TODO pack dungeon Data //Make a list of children for(NewDimData data : this.children) { @@ -122,7 +124,9 @@ public class PocketManager { Tails.add(tempTail); - } + } + + } int parentID=this.id; Point3D originPoint=new Point3D(0,0,0); @@ -135,7 +139,7 @@ public class PocketManager originPoint=this.origin.toPoint3D(); } return new PackedDimData(this.id, depth, this.packDepth, parentID, this.root().id(), orientation, - isDungeon, isFilled, originPoint, ChildIDs, Links, Tails); + isDungeon, isFilled,packedDungeon, originPoint, ChildIDs, Links, Tails); // FIXME: IMPLEMENTATION PLZTHX //I tried } diff --git a/StevenDimDoors/mod_pocketDim/saving/DimDataProcessor.java b/StevenDimDoors/mod_pocketDim/saving/DimDataProcessor.java index cca6ad33..d48e49e6 100644 --- a/StevenDimDoors/mod_pocketDim/saving/DimDataProcessor.java +++ b/StevenDimDoors/mod_pocketDim/saving/DimDataProcessor.java @@ -66,7 +66,7 @@ public class DimDataProcessor extends BaseConfigurationProcessor catch (IOException e) { // not sure if this is kosher, we need it to explode, but not by throwing the IO exception. - throw new ConfigurationProcessingException(); + throw new ConfigurationProcessingException("Incorrectly formatted save data"); } // TODO Auto-generated method stub @@ -86,6 +86,7 @@ public class DimDataProcessor extends BaseConfigurationProcessor int PackDepth; int ParentID; int RootID; + PackedDungeonData Dungeon; Point3D Origin; int Orientation; List ChildIDs; @@ -121,6 +122,8 @@ public class DimDataProcessor extends BaseConfigurationProcessor reader.nextName(); RootID= reader.nextInt(); + reader.nextName(); + Dungeon = createDungeonDataFromJson(reader); reader.nextName(); Origin = createPointFromJson(reader); @@ -133,7 +136,7 @@ public class DimDataProcessor extends BaseConfigurationProcessor reader.nextName(); Links = this.createLinksListFromJson(reader); - return new PackedDimData(ID, Depth, PackDepth, ParentID, RootID, Orientation, IsDungeon, IsFilled, Origin, ChildIDs, Links, Tails); + return new PackedDimData(ID, Depth, PackDepth, ParentID, RootID, Orientation, IsDungeon, IsFilled, Dungeon, Origin, ChildIDs, Links, Tails); } private Point3D createPointFromJson(JsonReader reader) throws IOException @@ -239,6 +242,9 @@ public class DimDataProcessor extends BaseConfigurationProcessor } private PackedDungeonData createDungeonDataFromJson(JsonReader reader) throws IOException { + reader.beginObject(); + //TODO read in dungeon Data + reader.endObject(); return null; } private PackedLinkTail createLinkTailFromJson(JsonReader reader) throws IOException diff --git a/StevenDimDoors/mod_pocketDim/saving/PackedDimData.java b/StevenDimDoors/mod_pocketDim/saving/PackedDimData.java index 0719ae3b..524ef549 100644 --- a/StevenDimDoors/mod_pocketDim/saving/PackedDimData.java +++ b/StevenDimDoors/mod_pocketDim/saving/PackedDimData.java @@ -16,6 +16,7 @@ public class PackedDimData public final int PackDepth; public final int ParentID; public final int RootID; + public final PackedDungeonData DungeonData; public final Point3D Origin; public final int Orientation; public final List ChildIDs; @@ -25,7 +26,7 @@ public class PackedDimData // FIXME Missing dungeon data, not sure how to include it public PackedDimData(int id, int depth, int packDepth, int parentID, int rootID, int orientation, - boolean isDungeon, boolean isFilled, Point3D origin, List childIDs, List links, + boolean isDungeon, boolean isFilled,PackedDungeonData dungeonData, Point3D origin, List childIDs, List links, List tails) { ID = id; @@ -36,6 +37,7 @@ public class PackedDimData Orientation = orientation; IsDungeon = isDungeon; IsFilled = isFilled; + DungeonData = dungeonData; Origin = origin; ChildIDs = childIDs; Links = links;