mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 23:03:01 +00:00
Teleporting works! Tomorrow I'll try and implement the Portable Teleporter.
This commit is contained in:
1 parent
cefd4ba107
commit
d16a6f06ee
3 files changed
+73
-90
No files matched your search
@@ -54,6 +54,47 @@ public class Frequency
|
||||
return !publicFreq;
|
||||
}
|
||||
|
||||
public Coord4D getClosestCoords(Coord4D coord)
|
||||
{
|
||||
Coord4D closest = null;
|
||||
|
||||
for(Coord4D iterCoord : activeCoords)
|
||||
{
|
||||
if(iterCoord.equals(coord))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if(closest == null)
|
||||
{
|
||||
closest = iterCoord;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(coord.dimensionId != closest.dimensionId && coord.dimensionId == iterCoord.dimensionId)
|
||||
{
|
||||
closest = iterCoord;
|
||||
continue;
|
||||
}
|
||||
else if(coord.dimensionId == closest.dimensionId && coord.dimensionId != iterCoord.dimensionId)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
if(coord.distanceTo(closest) > coord.distanceTo(iterCoord))
|
||||
{
|
||||
closest = iterCoord;
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return closest;
|
||||
}
|
||||
|
||||
public void write(NBTTagCompound nbtTags)
|
||||
{
|
||||
nbtTags.setString("name", name);
|
||||
|
||||
Reference in new issue
Block a user