From 448890207f17315f6bb55d867f6ba7fd818c9e53 Mon Sep 17 00:00:00 2001 From: SenseiKiwi Date: Thu, 26 Jun 2014 04:52:03 -0400 Subject: [PATCH] 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. --- .../mod_pocketDim/items/ItemRiftSignature.java | 11 +++++++++-- .../items/ItemStabilizedRiftSignature.java | 6 +++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/items/ItemRiftSignature.java b/src/main/java/StevenDimDoors/mod_pocketDim/items/ItemRiftSignature.java index b4b52e4..9cc5053 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/items/ItemRiftSignature.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/items/ItemRiftSignature.java @@ -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; + } } } diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/items/ItemStabilizedRiftSignature.java b/src/main/java/StevenDimDoors/mod_pocketDim/items/ItemStabilizedRiftSignature.java index 488227c..66ee5fd 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/items/ItemStabilizedRiftSignature.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/items/ItemStabilizedRiftSignature.java @@ -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());