Fixed Door Bugs
Fixed the bugs that caused doors not to appear right in dungeons. First there was a bug with filters that caused them not to replace blocks properly. I made some changes to SchematicFilter and its derived classes so that the implementations are a little more intuitive. That should prevent those bugs in any future derived classes. Then doors wouldn't rotate properly. DD was never designed to rotate dimensional doors. I added code to BlockRotator for that and shifted some code from DungeonHelper to BlockRotator. More coherence, less coupling!
This commit is contained in:
@@ -46,7 +46,7 @@ public class DungeonSchematic extends Schematic {
|
||||
|
||||
private static final short[] MOD_BLOCK_FILTER_EXCEPTIONS = new short[] {
|
||||
STANDARD_FABRIC_OF_REALITY_ID,
|
||||
STANDARD_ETERNAL_FABRIC_ID//,
|
||||
STANDARD_ETERNAL_FABRIC_ID
|
||||
//STANDARD_WARP_DOOR_ID,
|
||||
//STANDARD_DIMENSIONAL_DOOR_ID
|
||||
};
|
||||
@@ -108,12 +108,6 @@ public class DungeonSchematic extends Schematic {
|
||||
dimensionalDoorLocations = finder.getDimensionalDoorLocations();
|
||||
monolithSpawnLocations = finder.getMonolithSpawnLocations();
|
||||
|
||||
//TODO: Debug prints below. Please remove them before the next release!
|
||||
System.out.println(entranceDoorLocation != null ? "Entrance was found" : "Entrance was not found");
|
||||
System.out.printf("There are %d exit doors in this room\n", exitDoorLocations.size());
|
||||
System.out.printf("There are %d dim doors in this room\n", dimensionalDoorLocations.size());
|
||||
System.out.printf("There are %d monolith spawn points in this room\n", monolithSpawnLocations.size());
|
||||
|
||||
//Filter out mod blocks except some of our own
|
||||
CompoundFilter standardizer = new CompoundFilter();
|
||||
standardizer.addFilter(new ModBlockFilter(MAX_VANILLA_BLOCK_ID, MOD_BLOCK_FILTER_EXCEPTIONS,
|
||||
|
||||
@@ -70,16 +70,22 @@ public class SpecialBlockFinder extends SchematicFilter {
|
||||
if (blocks[index] == monolithSpawnMarkerID)
|
||||
{
|
||||
monolithSpawnLocations.add(schematic.calculatePoint(index));
|
||||
return true;
|
||||
}
|
||||
else if (blocks[index] == dimensionalDoorID)
|
||||
if (blocks[index] == dimensionalDoorID)
|
||||
{
|
||||
indexBelow = schematic.calculateIndexBelow(index);
|
||||
if (indexBelow >= 0 && blocks[indexBelow] == dimensionalDoorID)
|
||||
{
|
||||
dimensionalDoorLocations.add(schematic.calculatePoint(index));
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (blocks[index] == warpDoorID)
|
||||
if (blocks[index] == warpDoorID)
|
||||
{
|
||||
indexBelow = schematic.calculateIndexBelow(index);
|
||||
if (indexBelow >= 0 && blocks[indexBelow] == warpDoorID)
|
||||
@@ -88,15 +94,17 @@ public class SpecialBlockFinder extends SchematicFilter {
|
||||
if (indexDoubleBelow >= 0 && blocks[indexDoubleBelow] == exitMarkerID)
|
||||
{
|
||||
exitDoorLocations.add(schematic.calculatePoint(index));
|
||||
return true;
|
||||
}
|
||||
else if (entranceDoorLocation == null)
|
||||
{
|
||||
entranceDoorLocation = schematic.calculatePoint(index);
|
||||
entranceOrientation = (metadata[indexBelow] & 3);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user