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:
@@ -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