diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/LaserRelayConnectionHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/LaserRelayConnectionHandler.java index 1c6bb47b1..5eb0ad9a3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/LaserRelayConnectionHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/LaserRelayConnectionHandler.java @@ -18,6 +18,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import sun.nio.ch.Net; public class LaserRelayConnectionHandler{ @@ -183,6 +184,19 @@ public class LaserRelayConnectionHandler{ } return compound; } + + @Override + public boolean equals(Object obj){ + if(obj instanceof ConnectionPair){ + ConnectionPair pair = (ConnectionPair)obj; + if(this.firstRelay != null && this.firstRelay.equals(pair.firstRelay)){ + if(this.secondRelay != null && this.secondRelay.equals(pair.secondRelay)){ + return true; + } + } + } + return super.equals(obj); + } } public static class Network{ @@ -193,5 +207,15 @@ public class LaserRelayConnectionHandler{ public String toString(){ return this.connections.toString(); } + + @Override + public boolean equals(Object obj){ + if(obj instanceof Network){ + if(this.connections.equals(((Network)obj).connections)){ + return true; + } + } + return super.equals(obj); + } } } \ No newline at end of file