private static boolean isValidPlacement(final StendhalRPZone zone,final Entity entity,final Shape allowedArea,final int oldX,final int oldY,final int newX,final int newY,final boolean checkPath){
  if (!zone.collides(entity,newX,newY)) {
    if ((allowedArea != null) && (!allowedArea.contains(newX,newY))) {
      return false;
    }
    if (!checkPath) {
      return true;
    }
    final List<Node> path=Path.searchPath(entity,zone,oldX,oldY,new Rectangle(newX,newY,1,1),400,false);
    if (!path.isEmpty()) {
      return true;
    }
  }
  return false;
}

private static boolean isValidPlacement ( final StendhalRPZone zone , final Entity entity , final Shape allowedArea , final int oldX , final int oldY , final int newX , final int newY , final boolean checkPath ) { if ( ! zone . collides ( entity , newX , newY ) ) { if ( ( allowedArea != null ) && ( ! allowedArea . contains ( newX , newY ) ) ) { return false ; } if ( ! checkPath ) { return true ; } final List < Node > path = Path . searchPath ( entity , zone , oldX , oldY , new Rectangle ( newX , newY , 1 , 1 ) , 400 , false ) ; if ( ! path . isEmpty ( ) ) { return true ; } } return false ; }
checks if a new placement for an entity is valid .
