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

@@ -187,7 +187,7 @@ public class ItemRiftBlade extends ItemSword
NewDimData dimension = PocketManager.getDimensionData(world);
if (!dimension.isPocketDimension() && dimension.getLink(x, y + 1, z) == null)
{
dimension.createLink(x, y + 1, z).setLinkType(IDimLink.TYPE_POCKET);
dimension.createLink(x, y + 1, z, IDimLink.TYPE_POCKET);
player.worldObj.playSoundAtEntity(player,"mods.DimDoors.sfx.riftDoor", 0.6f, 1);
ItemDimensionalDoor.placeDoorBlock(world, x, y, z, orientation, mod_pocketDim.transientDoor);
}

View File

@@ -66,8 +66,8 @@ public class ItemRiftSignature extends Item
//The link was used before and already has an endpoint stored. Create links connecting the two endpoints.
NewDimData sourceDimension = PocketManager.getDimensionData(source.getDimension());
NewDimData destinationDimension = PocketManager.getDimensionData(world);
IDimLink link = sourceDimension.createLink(source.getX(), source.getY(), source.getZ()).setLinkType(IDimLink.TYPE_NORMAL);
IDimLink reverse = destinationDimension.createLink(x, y, z).setLinkType(IDimLink.TYPE_NORMAL);
IDimLink link = sourceDimension.createLink(source.getX(), source.getY(), source.getZ(), IDimLink.TYPE_NORMAL);
IDimLink reverse = destinationDimension.createLink(x, y, z, IDimLink.TYPE_NORMAL);
link.setDestination(x, y, z, destinationDimension);
reverse.setDestination(source.getX(), source.getY(), source.getZ(), sourceDimension);