Modified NewDimData and IDimLink

Modified how links are created so that the caller must specify a link
type when the link is created, rather than setting it later. This was
done to avoid having to send two link data packets following the way
links would be handled logically. Turns out this was good idea overall
for ensuring link integrity, because there was one case where I forgot
to set the link type after creating the link.
This commit is contained in:
SenseiKiwi
2013-09-01 10:50:20 -04:00
parent 4086e75ead
commit efa5b3eb4c
10 changed files with 51 additions and 41 deletions

View File

@@ -284,7 +284,7 @@ public class DungeonSchematic extends Schematic {
private static void createEntranceReverseLink(NewDimData dimension, Point3D pocketCenter, IDimLink entryLink)
{
IDimLink link = dimension.createLink(pocketCenter.getX(), pocketCenter.getY(), pocketCenter.getZ());
IDimLink link = dimension.createLink(pocketCenter.getX(), pocketCenter.getY(), pocketCenter.getZ(), IDimLink.TYPE_NORMAL);
Point4D destination = link.source();
link.setDestination(destination.getX(), destination.getY(), destination.getZ(),
PocketManager.getDimensionData(destination.getDimension()));
@@ -295,7 +295,7 @@ public class DungeonSchematic extends Schematic {
//Transform the door's location to the pocket coordinate system
Point3D location = point.clone();
BlockRotator.transformPoint(location, entrance, rotation, pocketCenter);
dimension.createLink(location.getX(), location.getY(), location.getZ()).setLinkType(IDimLink.TYPE_DUNGEON_EXIT);
dimension.createLink(location.getX(), location.getY(), location.getZ(), IDimLink.TYPE_DUNGEON_EXIT);
}
private static void createDimensionalDoorLink(NewDimData dimension, Point3D point, Point3D entrance, int rotation, Point3D pocketCenter)
@@ -303,7 +303,7 @@ public class DungeonSchematic extends Schematic {
//Transform the door's location to the pocket coordinate system
Point3D location = point.clone();
BlockRotator.transformPoint(location, entrance, rotation, pocketCenter);
dimension.createLink(location.getX(), location.getY(), location.getZ()).setLinkType(IDimLink.TYPE_DUNGEON);
dimension.createLink(location.getX(), location.getY(), location.getZ(), IDimLink.TYPE_DUNGEON);
}
private static void spawnMonolith(World world, Point3D point, Point3D entrance, int rotation, Point3D pocketCenter)