reformatted all src files (#141)
This commit is contained in:
@@ -19,87 +19,75 @@
|
||||
package appeng.me.pathfinding;
|
||||
|
||||
|
||||
import appeng.core.AEConfig;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.IGridVisitor;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.tile.networking.TileController;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
|
||||
public class ControllerValidator implements IGridVisitor
|
||||
{
|
||||
public class ControllerValidator implements IGridVisitor {
|
||||
|
||||
private boolean isValid = true;
|
||||
private int found = 0;
|
||||
private int minX;
|
||||
private int minY;
|
||||
private int minZ;
|
||||
private int maxX;
|
||||
private int maxY;
|
||||
private int maxZ;
|
||||
private boolean isValid = true;
|
||||
private int found = 0;
|
||||
private int minX;
|
||||
private int minY;
|
||||
private int minZ;
|
||||
private int maxX;
|
||||
private int maxY;
|
||||
private int maxZ;
|
||||
|
||||
public ControllerValidator( final int x, final int y, final int z )
|
||||
{
|
||||
this.minX = x;
|
||||
this.maxX = x;
|
||||
this.minY = y;
|
||||
this.maxY = y;
|
||||
this.minZ = z;
|
||||
this.maxZ = z;
|
||||
}
|
||||
public ControllerValidator(final int x, final int y, final int z) {
|
||||
this.minX = x;
|
||||
this.maxX = x;
|
||||
this.minY = y;
|
||||
this.maxY = y;
|
||||
this.minZ = z;
|
||||
this.maxZ = z;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visitNode( final IGridNode n )
|
||||
{
|
||||
final IGridHost host = n.getMachine();
|
||||
if( this.isValid() && host instanceof TileController )
|
||||
{
|
||||
final TileController c = (TileController) host;
|
||||
@Override
|
||||
public boolean visitNode(final IGridNode n) {
|
||||
final IGridHost host = n.getMachine();
|
||||
if (this.isValid() && host instanceof TileController) {
|
||||
final TileController c = (TileController) host;
|
||||
|
||||
final BlockPos pos = c.getPos();
|
||||
final BlockPos pos = c.getPos();
|
||||
|
||||
this.minX = Math.min( pos.getX(), this.minX );
|
||||
this.maxX = Math.max( pos.getX(), this.maxX );
|
||||
this.minY = Math.min( pos.getY(), this.minY );
|
||||
this.maxY = Math.max( pos.getY(), this.maxY );
|
||||
this.minZ = Math.min( pos.getZ(), this.minZ );
|
||||
this.maxZ = Math.max( pos.getZ(), this.maxZ );
|
||||
this.minX = Math.min(pos.getX(), this.minX);
|
||||
this.maxX = Math.max(pos.getX(), this.maxX);
|
||||
this.minY = Math.min(pos.getY(), this.minY);
|
||||
this.maxY = Math.max(pos.getY(), this.maxY);
|
||||
this.minZ = Math.min(pos.getZ(), this.minZ);
|
||||
this.maxZ = Math.max(pos.getZ(), this.maxZ);
|
||||
|
||||
if( this.maxX - this.minX < AEConfig.instance().getMaxControllerSizeX() && this.maxY - this.minY < AEConfig.instance().getMaxControllerSizeY() && this.maxZ - this.minZ < AEConfig.instance().getMaxControllerSizeZ() )
|
||||
{
|
||||
this.setFound( this.getFound() + 1 );
|
||||
return true;
|
||||
}
|
||||
if (this.maxX - this.minX < AEConfig.instance().getMaxControllerSizeX() && this.maxY - this.minY < AEConfig.instance().getMaxControllerSizeY() && this.maxZ - this.minZ < AEConfig.instance().getMaxControllerSizeZ()) {
|
||||
this.setFound(this.getFound() + 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
this.setValid( false );
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.setValid(false);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.isValid();
|
||||
}
|
||||
return this.isValid();
|
||||
}
|
||||
|
||||
public boolean isValid()
|
||||
{
|
||||
return this.isValid;
|
||||
}
|
||||
public boolean isValid() {
|
||||
return this.isValid;
|
||||
}
|
||||
|
||||
private void setValid( final boolean isValid )
|
||||
{
|
||||
this.isValid = isValid;
|
||||
}
|
||||
private void setValid(final boolean isValid) {
|
||||
this.isValid = isValid;
|
||||
}
|
||||
|
||||
public int getFound()
|
||||
{
|
||||
return this.found;
|
||||
}
|
||||
public int getFound() {
|
||||
return this.found;
|
||||
}
|
||||
|
||||
private void setFound( final int found )
|
||||
{
|
||||
this.found = found;
|
||||
}
|
||||
private void setFound(final int found) {
|
||||
this.found = found;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user