Basic reformat, hit once, hope never again
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.services.compass;
|
||||
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
|
||||
@@ -28,9 +29,15 @@ public class CompassReader
|
||||
private final int dimensionId;
|
||||
private final File rootFolder;
|
||||
|
||||
public CompassReader( int dimensionId, File rootFolder )
|
||||
{
|
||||
this.dimensionId = dimensionId;
|
||||
this.rootFolder = rootFolder;
|
||||
}
|
||||
|
||||
public void close()
|
||||
{
|
||||
for (CompassRegion r : this.regions.values())
|
||||
for( CompassRegion r : this.regions.values() )
|
||||
{
|
||||
r.close();
|
||||
}
|
||||
@@ -38,39 +45,31 @@ public class CompassReader
|
||||
this.regions.clear();
|
||||
}
|
||||
|
||||
public CompassReader(int dimensionId, File rootFolder)
|
||||
{
|
||||
this.dimensionId = dimensionId;
|
||||
this.rootFolder = rootFolder;
|
||||
}
|
||||
|
||||
public void setHasBeacon(int cx, int cz, int cdy, boolean hasBeacon)
|
||||
public void setHasBeacon( int cx, int cz, int cdy, boolean hasBeacon )
|
||||
{
|
||||
CompassRegion r = this.getRegion( cx, cz );
|
||||
r.setHasBeacon( cx, cz, cdy, hasBeacon );
|
||||
}
|
||||
|
||||
public boolean hasBeacon(int cx, int cz)
|
||||
{
|
||||
CompassRegion r = this.getRegion( cx, cz );
|
||||
return r.hasBeacon( cx, cz );
|
||||
}
|
||||
|
||||
private CompassRegion getRegion(int cx, int cz)
|
||||
private CompassRegion getRegion( int cx, int cz )
|
||||
{
|
||||
long pos = cx >> 10;
|
||||
pos <<= 32;
|
||||
pos |= ( cz >> 10 );
|
||||
|
||||
CompassRegion cr = this.regions.get( pos );
|
||||
if ( cr == null )
|
||||
if( cr == null )
|
||||
{
|
||||
cr = new CompassRegion( cx, cz, this.dimensionId, this.rootFolder );
|
||||
this.regions.put( pos, cr );
|
||||
}
|
||||
|
||||
return cr;
|
||||
|
||||
}
|
||||
|
||||
public boolean hasBeacon( int cx, int cz )
|
||||
{
|
||||
CompassRegion r = this.getRegion( cx, cz );
|
||||
return r.hasBeacon( cx, cz );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user