Created DungeonSchematic Class

Created DungeonSchematic, a class that extends Schematic and adds
DD-specific functionality such as methods for filtering the schematic's
block before importing and exporting. Testing confirms that
DungeonSchematic works well so far, although it still lacks critical
features.

Made some minor changes to Schematic and copied
SchematicLoader.setBlockDirectly(). I realized during testing that
setting blocks without using that function could cause problems. First,
it's possible that the blocks would not be placed if chunks weren't
created. Second, there are issues with blocks updating if we use World
to set them, even if block updates are disabled. That causes some
torches to break and other weird problems.

Added classes to support block filtering operations applied to
Schematic. These are used to implement ID standardization and removing
mod blocks when importing.
This commit is contained in:
SenseiKiwi
2013-07-29 09:58:47 -04:00
parent 8b64165e2e
commit 877678c945
8 changed files with 446 additions and 10 deletions

View File

@@ -17,8 +17,8 @@ import StevenDimDoors.mod_pocketDim.DimData;
import StevenDimDoors.mod_pocketDim.DungeonGenerator;
import StevenDimDoors.mod_pocketDim.LinkData;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import StevenDimDoors.mod_pocketDim.dungeon.DungeonSchematic;
import StevenDimDoors.mod_pocketDim.items.itemDimDoor;
import StevenDimDoors.mod_pocketDim.schematic.Schematic;
import StevenDimDoors.mod_pocketDim.util.WeightedContainer;
public class DungeonHelper
@@ -383,9 +383,10 @@ public class DungeonHelper
try
{
short size = (short) 2 * MAX_EXPORT_RADIUS + 1;
Schematic schematic = Schematic.copyFromWorld(world,
DungeonSchematic dungeon = DungeonSchematic.copyFromWorld(world,
centerX - MAX_EXPORT_RADIUS, centerY - MAX_EXPORT_RADIUS, centerZ - MAX_EXPORT_RADIUS, size, size, size, true);
schematic.writeToFile(exportPath);
dungeon.ApplyExportFilters(properties);
dungeon.writeToFile(exportPath);
return true;
}
catch(Exception e)