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:
@@ -1,13 +1,17 @@
|
||||
package StevenDimDoors.mod_pocketDim.commands;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||
import StevenDimDoors.mod_pocketDim.DungeonGenerator;
|
||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
||||
import StevenDimDoors.mod_pocketDim.dungeon.DungeonSchematic;
|
||||
import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper;
|
||||
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
||||
import StevenDimDoors.mod_pocketDim.schematic.InvalidSchematicException;
|
||||
|
||||
public class CommandCreateDungeonRift extends DDCommandBase
|
||||
{
|
||||
@@ -81,6 +85,25 @@ public class CommandCreateDungeonRift extends DDCommandBase
|
||||
link = dimHelper.instance.createPocket(link, true, true);
|
||||
dimHelper.dimList.get(link.destDimID).dungeonGenerator = result;
|
||||
sender.sendChatToPlayer("Created a rift to \"" + getSchematicName(result) + "\" dungeon (Dimension ID = " + link.destDimID + ").");
|
||||
|
||||
/*try {
|
||||
DungeonSchematic dungeon;
|
||||
if ((new File(result.schematicPath)).exists())
|
||||
{
|
||||
dungeon = DungeonSchematic.readFromFile(result.schematicPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
dungeon = DungeonSchematic.readFromResource(result.schematicPath);
|
||||
}
|
||||
dungeon.ApplyImportFilters(DDProperties.instance());
|
||||
dungeon.copyToWorld(sender.worldObj, x, y, z);
|
||||
} catch (InvalidSchematicException e) {
|
||||
e.printStackTrace();
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}*/
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user