Improved and Integrated DungeonSchematic

Improved DungeonSchematic to the point that it can replace
SchematicLoader as our method of loading dungeons. Some of the code was
copied over rather than refactored to save time. It's been subdivided so
make it much more readable. Also, we can reimplement portions of it as
WorldOperations later on further remove redudancy. Testing shows that
there is one problem left to fix: door blocks are not being set up
correctly at the moment. Rifts are being set up properly and attaching
doors to rifts will show that dungeons continue to generate fine.

Added classes to support DungeonSchematic and its additional filtering
logic on import and export. SpecialBlockFinder handles listing the
entrance, other doors in the dungeon, and end portal frames.
FillContainersOperation is a WorldOperation that fills chests and
dispensers. BlockRotator is a temporary class to hold
transformMetadata() and transformPoint() until we rewrite that code
later.

Stripped out most of the code from SchematicLoader to ensure it's no
longer used. The only remaining function sets up dungeon pockets. We can
phase it out in a later version so as not to delay our release. Removed
references to SchematicLoader in mod_pocketDim since it no longer needs
to be instantiated.
This commit is contained in:
SenseiKiwi
2013-07-30 13:58:14 -04:00
parent 877678c945
commit f4653d0522
11 changed files with 1338 additions and 1273 deletions

View File

@@ -385,7 +385,7 @@ public class DungeonHelper
short size = (short) 2 * MAX_EXPORT_RADIUS + 1;
DungeonSchematic dungeon = DungeonSchematic.copyFromWorld(world,
centerX - MAX_EXPORT_RADIUS, centerY - MAX_EXPORT_RADIUS, centerZ - MAX_EXPORT_RADIUS, size, size, size, true);
dungeon.ApplyExportFilters(properties);
dungeon.applyExportFilters(properties);
dungeon.writeToFile(exportPath);
return true;
}

View File

@@ -39,6 +39,7 @@ import StevenDimDoors.mod_pocketDim.LinkData;
import StevenDimDoors.mod_pocketDim.ObjectSaveInputStream;
import StevenDimDoors.mod_pocketDim.PacketHandler;
import StevenDimDoors.mod_pocketDim.Point3D;
import StevenDimDoors.mod_pocketDim.SchematicLoader;
import StevenDimDoors.mod_pocketDim.TileEntityRift;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import StevenDimDoors.mod_pocketDim.world.LimboProvider;
@@ -759,12 +760,8 @@ public class dimHelper extends DimensionManager
}
else if(!data.hasBeenFilled&&data.isPocket&&data.isDimRandomRift)
{
//System.out.println("genning dungeon pocket");
mod_pocketDim.loader.generateDungeonPocket(incomingLink);
SchematicLoader.generateDungeonPocket(incomingLink, properties);
data.hasBeenFilled=true;
}
}
@@ -778,7 +775,7 @@ public class dimHelper extends DimensionManager
mod_pocketDim.hasInitDims=true;
this.load();
if(!this.dimList.isEmpty())
if(!dimHelper.dimList.isEmpty())
{