mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 23:28:35 +01:00
Added equals for Networks and ConnectionPairs
Just in case that was screwing something up at some point
This commit is contained in:
parent
32446f3921
commit
505c88f031
1 changed files with 24 additions and 0 deletions
|
@ -18,6 +18,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.nbt.NBTTagList;
|
import net.minecraft.nbt.NBTTagList;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import sun.nio.ch.Net;
|
||||||
|
|
||||||
public class LaserRelayConnectionHandler{
|
public class LaserRelayConnectionHandler{
|
||||||
|
|
||||||
|
@ -183,6 +184,19 @@ public class LaserRelayConnectionHandler{
|
||||||
}
|
}
|
||||||
return compound;
|
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{
|
public static class Network{
|
||||||
|
@ -193,5 +207,15 @@ public class LaserRelayConnectionHandler{
|
||||||
public String toString(){
|
public String toString(){
|
||||||
return this.connections.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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue