Completed Changes to Stabilized Rift Signature
Completed the change to Stabilized Rift Signatures so that overwriting links that already belonged to an SRS is done for free.
This commit is contained in:
parent
fe035f6677
commit
448890207f
2 changed files with 12 additions and 5 deletions
|
@ -219,10 +219,11 @@ public class ItemRiftSignature extends Item
|
|||
{
|
||||
private Point4D point;
|
||||
private int orientation;
|
||||
|
||||
Point4DOrientation(int x, int y, int z, int orientation, int dimID)
|
||||
{
|
||||
this.point= new Point4D(x,y,z,dimID);
|
||||
this.orientation=orientation;
|
||||
this.point = new Point4D(x, y, z, dimID);
|
||||
this.orientation = orientation;
|
||||
}
|
||||
|
||||
int getX()
|
||||
|
@ -244,10 +245,16 @@ public class ItemRiftSignature extends Item
|
|||
{
|
||||
return point.getDimension();
|
||||
}
|
||||
|
||||
int getOrientation()
|
||||
{
|
||||
return orientation;
|
||||
}
|
||||
|
||||
Point4D getPoint()
|
||||
{
|
||||
return point;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -52,10 +52,10 @@ public class ItemStabilizedRiftSignature extends ItemRiftSignature
|
|||
if (source != null)
|
||||
{
|
||||
// Yes, it's initialized.
|
||||
DimLink link;
|
||||
DimLink reverse;
|
||||
NewDimData sourceDimension = PocketManager.getDimensionData(source.getDimension());
|
||||
NewDimData destinationDimension = PocketManager.getDimensionData(world);
|
||||
DimLink reverse = destinationDimension.getLink(x, adjustedY, z);
|
||||
DimLink link;
|
||||
|
||||
// Check whether the SRS is being used to restore one of its previous
|
||||
// link pairs. In other words, the SRS is being used on a location
|
||||
|
@ -63,7 +63,7 @@ public class ItemStabilizedRiftSignature extends ItemRiftSignature
|
|||
// intention of overwriting the source-side link to point there.
|
||||
// Those benign redirection operations will be handled for free.
|
||||
|
||||
if (false) //TODO Add proper check!
|
||||
if (reverse != null && source.getPoint().equals(reverse.destination()))
|
||||
{
|
||||
// Only the source-to-destination link is needed.
|
||||
link = sourceDimension.createLink(source.getX(), source.getY(), source.getZ(), LinkTypes.NORMAL, source.getOrientation());
|
||||
|
|
Loading…
Add table
Reference in a new issue