Fixed Vertical Dungeon Clipping

Added code to SchematicLoader to adjust the Y coordinate of the
destination link into a dungeon before the dungeon is created.
IMPORTANT: The code is commented out at the moment because it causes a
link-related NullPointerException. A link needs to be updated through
DimHelper but the code is hard to follow so I've decided to just not
touch it - Steven will have to do it.

The function adjustDestinationY() checks if the given entrance location
would place any portion of the dungeon outside the vertical bounds of
the world. If so, it corrects the location while moving it as little as
possible from its original place.

Also added some checks to make sure that any schematic we load has an
entrance door. Otherwise, load defaultBreak instead. And I cut down on
the absurd number of compiler warnings in dimHelper. <_< Stop accessing
static fields as instance fields!
This commit is contained in:
SenseiKiwi
2013-07-31 12:09:47 -04:00
parent 356bfe4bd0
commit 96c1b3d7a4
3 changed files with 129 additions and 96 deletions

View File

@@ -363,7 +363,6 @@ public class DungeonHelper
int depth = dimHelper.instance.getDimDepth(incoming.locDimID);
int depthWeight = rand.nextInt(depth + 2) + rand.nextInt(depth + 2) - 2;
int count = 10;
boolean flag = true;
try
@@ -508,6 +507,7 @@ public class DungeonHelper
}
}
dimHelper.dimList.get(incoming.destDimID).dungeonGenerator = dungeon;
//dimHelper.dimList.get(incoming.destDimID).dungeonGenerator = defaultUp;
}
public Collection<String> getDungeonNames() {