Fixed More Bugs
1. Fixed mistakes in PocketBuilder that would cause dungeons to be initialized as non-dungeon pockets. This restored Monolith spawning around dungeons. 2. Fixed a bug in DungeonSchematic - returning links through entry doors should work now. 3. Made minor changes to DungeonSchematic for clarity
This commit is contained in:
@@ -168,14 +168,14 @@ public class DungeonSchematic extends Schematic {
|
|||||||
return new DungeonSchematic(Schematic.copyFromWorld(world, x, y, z, width, height, length, doCompactBounds));
|
return new DungeonSchematic(Schematic.copyFromWorld(world, x, y, z, width, height, length, doCompactBounds));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void copyToWorld(World world, Point3D pocketCenter, int dungeonOrientation, DimLink entryLink, Random random)
|
public void copyToWorld(World world, Point3D pocketCenter, int targetOrientation, DimLink entryLink, Random random)
|
||||||
{
|
{
|
||||||
//TODO: This function is an improvised solution so we can get the release moving. In the future,
|
//TODO: This function is an improvised solution so we can get the release moving. In the future,
|
||||||
//we should generalize block transformations and implement support for them at the level of Schematic,
|
//we should generalize block transformations and implement support for them at the level of Schematic,
|
||||||
//then just use that support from DungeonSchematic instead of making this local fix.
|
//then just use that support from DungeonSchematic instead of making this local fix.
|
||||||
//It might be easiest to support transformations using a WorldOperation
|
//It might be easiest to support transformations using a WorldOperation
|
||||||
|
|
||||||
final int turnAngle = dungeonOrientation - orientation;
|
final int turnAngle = targetOrientation - this.orientation;
|
||||||
|
|
||||||
int index;
|
int index;
|
||||||
int count;
|
int count;
|
||||||
@@ -285,10 +285,10 @@ public class DungeonSchematic extends Schematic {
|
|||||||
|
|
||||||
private static void createEntranceReverseLink(NewDimData dimension, Point3D pocketCenter, DimLink entryLink)
|
private static void createEntranceReverseLink(NewDimData dimension, Point3D pocketCenter, DimLink entryLink)
|
||||||
{
|
{
|
||||||
DimLink link = dimension.createLink(pocketCenter.getX(), pocketCenter.getY(), pocketCenter.getZ(), LinkTypes.NORMAL);
|
DimLink reverseLink = dimension.createLink(pocketCenter.getX(), pocketCenter.getY(), pocketCenter.getZ(), LinkTypes.NORMAL);
|
||||||
Point4D destination = link.source();
|
Point4D destination = entryLink.source();
|
||||||
NewDimData prevDim = PocketManager.getDimensionData(destination.getDimension());
|
NewDimData prevDim = PocketManager.getDimensionData(destination.getDimension());
|
||||||
prevDim.setDestination(link, destination.getX(), destination.getY(), destination.getZ());
|
prevDim.setDestination(reverseLink, destination.getX(), destination.getY(), destination.getZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void createExitDoorLink(NewDimData dimension, Point3D point, Point3D entrance, int rotation, Point3D pocketCenter)
|
private static void createExitDoorLink(NewDimData dimension, Point3D point, Point3D entrance, int rotation, Point3D pocketCenter)
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class PocketBuilder
|
|||||||
{
|
{
|
||||||
//Register a new dimension
|
//Register a new dimension
|
||||||
NewDimData parent = PocketManager.getDimensionData(link.source().getDimension());
|
NewDimData parent = PocketManager.getDimensionData(link.source().getDimension());
|
||||||
NewDimData dimension = PocketManager.registerPocket(parent, false);
|
NewDimData dimension = PocketManager.registerPocket(parent, true);
|
||||||
|
|
||||||
//Load a world
|
//Load a world
|
||||||
World world = DimensionManager.getWorld(dimension.id());
|
World world = DimensionManager.getWorld(dimension.id());
|
||||||
@@ -106,7 +106,7 @@ public class PocketBuilder
|
|||||||
schematic.copyToWorld(world, destination, orientation, link, random);
|
schematic.copyToWorld(world, destination, orientation, link, random);
|
||||||
|
|
||||||
//Finish up destination initialization
|
//Finish up destination initialization
|
||||||
dimension.initializePocket(destination.getX(), destination.getY(), destination.getZ(), orientation, link);
|
dimension.initializeDungeon(destination.getX(), destination.getY(), destination.getZ(), orientation, link, dungeon);
|
||||||
dimension.setFilled(true);
|
dimension.setFilled(true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user