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:
@@ -219,6 +219,7 @@ public class ItemRiftSignature extends Item
|
|||||||
{
|
{
|
||||||
private Point4D point;
|
private Point4D point;
|
||||||
private int orientation;
|
private int orientation;
|
||||||
|
|
||||||
Point4DOrientation(int x, int y, int z, int orientation, int dimID)
|
Point4DOrientation(int x, int y, int z, int orientation, int dimID)
|
||||||
{
|
{
|
||||||
this.point = new Point4D(x, y, z, dimID);
|
this.point = new Point4D(x, y, z, dimID);
|
||||||
@@ -244,10 +245,16 @@ public class ItemRiftSignature extends Item
|
|||||||
{
|
{
|
||||||
return point.getDimension();
|
return point.getDimension();
|
||||||
}
|
}
|
||||||
|
|
||||||
int getOrientation()
|
int getOrientation()
|
||||||
{
|
{
|
||||||
return orientation;
|
return orientation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Point4D getPoint()
|
||||||
|
{
|
||||||
|
return point;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,10 +52,10 @@ public class ItemStabilizedRiftSignature extends ItemRiftSignature
|
|||||||
if (source != null)
|
if (source != null)
|
||||||
{
|
{
|
||||||
// Yes, it's initialized.
|
// Yes, it's initialized.
|
||||||
DimLink link;
|
|
||||||
DimLink reverse;
|
|
||||||
NewDimData sourceDimension = PocketManager.getDimensionData(source.getDimension());
|
NewDimData sourceDimension = PocketManager.getDimensionData(source.getDimension());
|
||||||
NewDimData destinationDimension = PocketManager.getDimensionData(world);
|
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
|
// 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
|
// 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.
|
// intention of overwriting the source-side link to point there.
|
||||||
// Those benign redirection operations will be handled for free.
|
// 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.
|
// Only the source-to-destination link is needed.
|
||||||
link = sourceDimension.createLink(source.getX(), source.getY(), source.getZ(), LinkTypes.NORMAL, source.getOrientation());
|
link = sourceDimension.createLink(source.getX(), source.getY(), source.getZ(), LinkTypes.NORMAL, source.getOrientation());
|
||||||
|
|||||||
Reference in New Issue
Block a user